├── .screenshots └── desktop.png ├── .config ├── yabai │ └── yabairc ├── fish │ └── config.fish ├── starship.toml ├── nvim │ ├── init.vim │ └── README.md ├── ranger │ ├── README.md │ ├── scope.sh │ └── rc.conf └── skhd │ └── skhdrc ├── LICENSE ├── .Xresources └── README.md /.screenshots/desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jorgeloopzz/dotfiles/HEAD/.screenshots/desktop.png -------------------------------------------------------------------------------- /.config/yabai/yabairc: -------------------------------------------------------------------------------- 1 | # bsp or float (default: float) 2 | yabai -m config layout bsp 3 | 4 | # Set all padding and gaps to 20pt (default: 0) 5 | yabai -m config top_padding 5 6 | yabai -m config bottom_padding 5 7 | yabai -m config left_padding 5 8 | yabai -m config right_padding 5 9 | yabai -m config window_gap 5 10 | 11 | # set focus follows mouse mode (default: off, options: off, autoraise, autofocus) 12 | yabai -m config focus_follows_mouse autoraise 13 | 14 | # set mouse follows focus mode (default: off) 15 | yabai -m config mouse_follows_focus on 16 | 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jorge López 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # _______________ __ __ 2 | # / ____/ _/ ___// / / / 3 | # / /_ / / \__ \/ /_/ / 4 | # / __/ _/ / ___/ / __ / 5 | # /_/ /___//____/_/ /_/ 6 | # 7 | # https://github.com/jorgeloopzz 8 | 9 | if status is-interactive 10 | 11 | ## DISABLE GREETING ## 12 | set -U fish_greeting 13 | 14 | ## MAKE NEOVIM DEFAULT IDE ## 15 | export EDITOR='nvim' 16 | export VISUAL='nvim' 17 | 18 | ## ALIASES ## 19 | alias l="eza -la --icons" 20 | alias cl="clear" 21 | alias update="brew update && brew upgrade ; brew cleanup" 22 | alias fishcfg="nvim $HOME/.config/fish/config.fish && source $HOME/.config/fish/config.fish" 23 | 24 | # DOTFILES ALIASES 25 | alias dotfiles="/usr/bin/env git --git-dir=$HOME/dotfiles/ --work-tree=$HOME" 26 | alias da="dotfiles add" 27 | alias dc="dotfiles commit -m" 28 | alias dp="dotfiles push origin mac" 29 | 30 | ## USE HOMEBREW ## 31 | export PATH="/opt/homebrew/bin:$PATH" 32 | 33 | ## INTEGRATE ITERM2 UTILITIES ## 34 | test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish 35 | 36 | ## SETTING THE STARSHIP PROMPT ## 37 | starship init fish | source 38 | 39 | ## INIT SCRIPT ## 40 | colorscript random 41 | 42 | end 43 | 44 | -------------------------------------------------------------------------------- /.config/starship.toml: -------------------------------------------------------------------------------- 1 | # ______________ ____ _____ __ __________ 2 | # / ___/_ __/ | / __ \/ ___// / / / _/ __ \ 3 | # \__ \ / / / /| | / /_/ /\__ \/ /_/ // // /_/ / 4 | # ___/ // / / ___ |/ _, _/___/ / __ // // ____/ 5 | # /____//_/ /_/ |_/_/ |_|/____/_/ /_/___/_/ 6 | # 7 | # https://github.com/jorgeloopzz 8 | 9 | # Inserts a blank line between shell prompts 10 | add_newline = true 11 | 12 | # Standard configuration 13 | [character] 14 | success_symbol = "[➜](bold green)" 15 | error_symbol = "[✗](bold red)" 16 | vimcmd_symbol = '[](bold green)' 17 | vimcmd_replace_one_symbol = '[󰑓](bold yellow)' 18 | vimcmd_visual_symbol = '[](bold yellow)' 19 | 20 | [username] 21 | format = '[ $user](bold blue) in ' 22 | disabled = false 23 | show_always = true 24 | 25 | # Programming languages configuration 26 | [python] 27 | symbol = " " 28 | 29 | [nodejs] 30 | symbol = " " 31 | detect_files = ['package.json'] 32 | detect_folders = ["node_modules"] 33 | detect_extensions = [""] 34 | 35 | [rust] 36 | symbol = "󱘗 " 37 | detect_files = ['Cargo.toml'] 38 | detect_extensions = ['rs'] 39 | 40 | [java] 41 | symbol = "󰬷 " 42 | detect_files = [''] 43 | detect_extensions = ['java', 'class', 'gradle', 'jar', 'cljs', 'cljc'] 44 | 45 | [c] 46 | symbol = " " 47 | detect_extensions = ['c', 'h'] 48 | 49 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | " _ ____________ _ ________ ___ 2 | " / | / / ____/ __ \ | / / _/ |/ / 3 | " / |/ / __/ / / / / | / // // /|_/ / 4 | " / /| / /___/ /_/ /| |/ // // / / / 5 | " /_/ |_/_____/\____/ |___/___/_/ /_/ 6 | " 7 | " https://github.com/jorgeloopzz 8 | 9 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 10 | " => General Settings 11 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 12 | set mouse=a " enable mouse click 13 | set cursorcolumn " highlight current column 14 | set cursorline " highlight current line 15 | set nocompatible " disable compatibility to old-time vi 16 | set nobackup " backup file is immediately deleted upon writing the original file 17 | set nowritebackup " only in case you don't want a backup file while editing 18 | set noswapfile " no swap files 19 | set number relativenumber " lines will show relative number except the current line wich will show it's absolute number 20 | set clipboard=unnamedplus " using system clipboard 21 | set smartcase " enable sensitive case depending on the situation 22 | 23 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 24 | " => Appearance 25 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 26 | syntax on 27 | let g:airline_powerline_fonts=1 28 | let g:rainbow_active = 1 29 | let g:airline_theme='onedark' 30 | colorscheme onedark 31 | 32 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 33 | " => Keybindings 34 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 35 | nnoremap :NERDTreeToggle 36 | nnoremap :split 37 | nnoremap :vsplit 38 | nnoremap :q 39 | 40 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | ! _ __ ____ ___________ ____ __ ______ _________________ 2 | ! | |/ // __ \/ ____/ ___// __ \/ / / / __ \/ ____/ ____/ ___/ 3 | ! | // /_/ / __/ \__ \/ / / / / / / /_/ / / / __/ \__ \ 4 | ! / |/ _, _/ /___ ___/ / /_/ / /_/ / _, _/ /___/ /___ ___/ / 5 | ! /_/|_/_/ |_/_____//____/\____/\____/_/ |_|\____/_____//____/ 6 | ! 7 | ! https://github.com/jorgeloopzz/dotfiles 8 | 9 | ! COLORS FOR SXIV 10 | Sxiv.foreground: #FFFFFF 11 | Sxiv.background: #16161d 12 | Sxiv.font: DaddyTimeMono Nerd Font-12 13 | 14 | ! Scale external monitors 15 | Xft.dpi: 96 16 | 17 | ! Cursor size 18 | Xcursor.size: 12 19 | 20 | ! URXVT CONFIGURATION 21 | ! Disable scrollbar 22 | URxvt.scrollBar: false 23 | 24 | ! Fonts 25 | URxvt.font: xft:SpaceMono Nerd Font:size=13 26 | URxvt.letterSpace: -1 27 | URxvt.saveLines: 2000 28 | 29 | !Clipboard 30 | URxvt.clipboard.autocopy: true 31 | URxvt.keysym.M-c: perl:clipboard:copy 32 | URxvt.keysym.M-v: perl:clipboard:paste 33 | 34 | 35 | !! Catppuccin colorscheme 36 | ! special 37 | URxvt.foreground: #DADAE8 38 | URxvt.background: #1E1E29 39 | URxvt.cursorColor: #B1E3AD 40 | 41 | ! black 42 | URxvt.color0: #6E6C7E 43 | URxvt.color8: #6E6C7E 44 | 45 | ! red 46 | URxvt.color1: #E38C8F 47 | URxvt.color9: #E38C8F 48 | 49 | ! green 50 | URxvt.color2: #B1E3AD 51 | URxvt.color10: #B1E3AD 52 | 53 | ! yellow 54 | URxvt.color3: #EBDDAA 55 | URxvt.color11: #EBDDAA 56 | 57 | ! blue 58 | URxvt.color4: #A4B9EF 59 | URxvt.color12: #A4B9EF 60 | 61 | ! magenta 62 | URxvt.color5: #C6AAE8 63 | URxvt.color13: #C6AAE8 64 | 65 | ! cyan 66 | URxvt.color6: #E5B4E2 67 | URxvt.color14: #E5B4E2 68 | 69 | ! white 70 | URxvt.color7: #DADAE8 71 | URxvt.color15: #DADAE8 72 | 73 | !! URxvt Appearance 74 | URxvt.lineSpace: 0 75 | URxvt.geometry: 92x24 76 | URxvt.internalBorder: 24 77 | URxvt.cursorBlink: true 78 | URxvt.cursorUnderline: false 79 | URxvt.saveline: 2048 80 | URxvt.urgentOnBell: true 81 | URxvt.depth: 24 82 | URxvt.iso14755: false 83 | -------------------------------------------------------------------------------- /.config/nvim/README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | [Neovim](https://neovim.io/) is a fork of Vim aiming to improve the codebase for easier API implementation, a better user experience and plugin implementations. 7 | 8 | ## Keybindings 9 | The standard customization of keybindings follows the next structure: 10 | 11 | `Mapping mode < Keybindigs > :command ` 12 | 13 | Below are some common Neovim keybindings to know: 14 | 15 | - `inoremap`: maps the key in insert mode 16 | - `nnoremap`: maps the key in normal mode 17 | - `vnoremap`: maps the key in visual mode 18 | - ``: Represents the control key 19 | - ``: Represents the alt key 20 | 21 | ## Plugins 22 | Vim plugins allow you to extend Neovim's functionality according to your workflow and preferences. There are some ways to install plugins in Neovim, either with a package manager as [vim-plug](https://github.com/junegunn/vim-plug), [lazy.nvim](https://github.com/folke/lazy.nvim), etc, or manually. I personally stand with this option. 23 | 24 | ### Manual 25 | Tipically, Neovim plugins are organised in `pack` directory, as well as Vim, so firstly let's create the structure for it: 26 | 27 | ```bash 28 | mkdir -p ~/.config/nvim/pack/vendor/start 29 | ``` 30 | 31 | Then, inside `start` directory , clone whatever plugin you like from their github repository. 32 | 33 | #### My plugins 34 | 35 | - [NERDTree](https://github.com/preservim/nerdtree) 36 | - [vim-airline](https://github.com/vim-airline/vim-airline) 37 | - [VimDevIcons](https://github.com/ryanoasis/vim-devicons) 38 | 39 | ### Theme 40 | My favourite color scheme for any environment is One Dark, see the [installation](https://github.com/joshdick/onedark.vim?tab=readme-ov-file#installation) for Neovim. Themes can be handled manually too. 41 | 42 | -------------------------------------------------------------------------------- /.config/ranger/README.md: -------------------------------------------------------------------------------- 1 | # 📑 Contents 2 | 3 | - [What is Ranger?](#-what-is-ranger) 4 | - [Preview images](#️-preview-images) 5 | - [Ueberzug](#ueberzug) 6 | - [w3mimagedisplay](#w3mimagedisplay) 7 | - [iTerm2](#iterm2) 8 | - [Plugins](#-plugins) 9 | - [Installation](#installation) 10 | 11 | 12 | 13 | ## ❓ What is Ranger? 14 | 15 | **_Ranger_** is a text-based file manager written in Python. Directories are displayed in one pane with three columns. Moving between them is accomplished with keystrokes, bookmarks, the mouse or the command history. File previews and directory contents show automatically for the current selection. After startup, ranger creates a directory `~/.config/ranger`. To copy the default configuration to this directory issue the following command: 16 | 17 | ```bash 18 | ranger --copy-config=all 19 | ``` 20 | 21 |   22 | 23 | ## 🖼️ Preview images 24 | 25 | By default, ranger will preview PDF like an image, also as text files or programming files, but for images there`s to work a little. In order to preview we can choose one of the next programs for it. 26 | 27 | First, make sure you have this settings in your `rc.conf` file. 28 | 29 | ``` 30 | set preview_script ~/.config/ranger/scope.sh 31 | set use_preview_script true 32 | set preview_images true 33 | ``` 34 | 35 | ### Ueberzug 36 | 37 | ```bash 38 | brew install jstkdng/programs/ueberzugpp 39 | ``` 40 | 41 | Now change this line in `rc.conf`. 42 | 43 | ``` 44 | set preview_images_method ueberzug 45 | ``` 46 | 47 | Modify `scope.sh` file to have same settings as [this](https://github.com/jorgeloopzz/dotfiles/blob/master/.config/ranger/scope.sh#L141C9-L150C15). 48 | 49 | ### w3mimagedisplay 50 | 51 | If you decide to use [w3mimagedisplay](https://salsa.debian.org/debian/w3m) there`s no much difference, just the package to install: 52 | 53 | ```bash 54 | brew install w3m 55 | ``` 56 | 57 | And with that, follow same step like above, only change this line: 58 | 59 | ``` 60 | set preview_images_method w3m 61 | ``` 62 | 63 | ### iTerm2 64 | For iTerm2 users the best option would be to do [Shell Integration](https://iterm2.com/documentation-shell-integration.html), which comes with [imgcat](https://iterm2.com/documentation-images.html) to display images within the terminal. 65 | 66 | ``` 67 | set preview_images_method iTerm2 68 | ``` 69 | 70 | > To preview videos, you need [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer), no matter what you chose before. In this case, you should have [this](https://github.com/jorgeloopzz/dotfiles/blob/master/.config/ranger/scope.sh#L156C9-L160C21) configuration. 71 | > 72 | > All this preview images are stored in `~/.cache/ranger/` or `~/.cache/ueberzugpp`. 73 | 74 |   75 | 76 | ## 🧩 Plugins 77 | 78 | You are able to improve ranger by installing plugins. Take a look at [this](https://github.com/topics/ranger-plugin) list if you are interested in some of them but I personally only use [ranger_devicons](https://github.com/alexanderjeurissen/ranger_devicons). 79 | 80 | ### Installation 81 | 82 | - Make a folder called _plugins_ in `~/.config/ranger`. 83 | 84 | ```bash 85 | mkdir -p ~/.config/ranger/plugins 86 | ``` 87 | 88 | - Then clone the plugin you want to install. 89 | 90 | > [!NOTE] 91 | > For more information browse the [Arch Wiki](https://wiki.archlinux.org/title/Ranger). 92 | 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | :rice: 4 | 5 | 6 | ~ My configuration files ~ 7 | 8 | 9 | :rice: 10 |

11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 |   19 | 20 | 21 | 22 | 23 |   24 | 25 | # :computer: Machine 26 | 27 | ### Software 28 | 29 | | Program | Name | 30 | | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | 31 | | OS | [Arco Linux](https://github.com/jorgeloopzz/dotfiles/tree/master), [macOS Sonoma](https://github.com/jorgeloopzz/dotfiles/tree/mac) | 32 | | WM | [Amethyst](https://github.com/ianyh/Amethyst) | 33 | | Terminal emulator | [iTerm2](https://iterm2.com/) | 34 | | Shell | [Fish](https://fishshell.com/) | 35 | | Prompt | [Starship](https://starship.rs/) | 36 | | Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | 37 | | File manager | [Finder](), [Ranger](https://github.com/jorgeloopzz/dotfiles/tree/mac/.config/ranger) | 38 | | IDE'S | [VS Code](https://wiki.archlinux.org/title/Visual_Studio_Code), [Neovim](https://wiki.archlinux.org/title/Neovim) | 39 | | Video/Audio player | [VLC](https://wiki.archlinux.org/title/VLC_media_player) | 40 | | Torrent client | [qBittorrent](https://www.qbittorrent.org/) | 41 | | Launcher | [Spotlight]() | 42 | 43 | ### Hardware 44 | 45 | | Component | Name | 46 | |-------------- |----------------------- | 47 | | Laptop | Macbook Air 2020 | 48 | | CPU | Apple M1 | 49 | | GPU | Apple M1 (Integrated) | 50 | | Architecture | arm64 | 51 | | Disk space | 256 GB | 52 | | Memory | 8 GB | 53 | 54 |   55 | 56 | > [!NOTE] 57 | > For more information check the [wiki](https://github.com/jorgeloopzz/dotfiles/wiki) 58 | 59 | 60 |

61 | 62 | -------------------------------------------------------------------------------- /.config/skhd/skhdrc: -------------------------------------------------------------------------------- 1 | # ################################################################ # 2 | # THE FOLLOWING IS AN EXPLANATION OF THE GRAMMAR THAT SKHD PARSES. # 3 | # FOR SIMPLE EXAMPLE MAPPINGS LOOK FURTHER DOWN THIS FILE.. # 4 | # ################################################################ # 5 | 6 | # A list of all built-in modifier and literal keywords can 7 | # be found at https://github.com/koekeishiya/skhd/issues/1 8 | # 9 | # A hotkey is written according to the following rules: 10 | # 11 | # hotkey = '<' | 12 | # 13 | # mode = 'name of mode' | ',' 14 | # 15 | # action = '[' ']' | '->' '[' ']' 16 | # ':' | '->' ':' 17 | # ';' | '->' ';' 18 | # 19 | # keysym = '-' | 20 | # 21 | # mod = 'modifier keyword' | '+' 22 | # 23 | # key = | 24 | # 25 | # literal = 'single letter or built-in keyword' 26 | # 27 | # keycode = 'apple keyboard kVK_ values (0x3C)' 28 | # 29 | # proc_map_lst = * 30 | # 31 | # proc_map = ':' | '~' | 32 | # '*' ':' | '*' '~' 33 | # 34 | # string = '"' 'sequence of characters' '"' 35 | # 36 | # command = command is executed through '$SHELL -c' and 37 | # follows valid shell syntax. if the $SHELL environment 38 | # variable is not set, it will default to '/bin/bash'. 39 | # when bash is used, the ';' delimeter can be specified 40 | # to chain commands. 41 | # 42 | # to allow a command to extend into multiple lines, 43 | # prepend '\' at the end of the previous line. 44 | # 45 | # an EOL character signifies the end of the bind. 46 | # 47 | # -> = keypress is not consumed by skhd 48 | # 49 | # * = matches every application not specified in 50 | # 51 | # ~ = application is unbound and keypress is forwarded per usual, when specified in a 52 | # 53 | # A mode is declared according to the following rules: 54 | # 55 | # mode_decl = '::' '@' ':' | '::' ':' | 56 | # '::' '@' | '::' 57 | # 58 | # name = desired name for this mode, 59 | # 60 | # @ = capture keypresses regardless of being bound to an action 61 | # 62 | # command = command is executed through '$SHELL -c' and 63 | # follows valid shell syntax. if the $SHELL environment 64 | # variable is not set, it will default to '/bin/bash'. 65 | # when bash is used, the ';' delimeter can be specified 66 | # to chain commands. 67 | # 68 | # to allow a command to extend into multiple lines, 69 | # prepend '\' at the end of the previous line. 70 | # 71 | # an EOL character signifies the end of the bind. 72 | 73 | # ############################################################### # 74 | # THE FOLLOWING SECTION CONTAIN SIMPLE MAPPINGS DEMONSTRATING HOW # 75 | # TO INTERACT WITH THE YABAI WM. THESE ARE SUPPOSED TO BE USED AS # 76 | # A REFERENCE ONLY, WHEN MAKING YOUR OWN CONFIGURATION.. # 77 | # ############################################################### # 78 | # 79 | # open terminal 80 | cmd - return : open -na iTerm 81 | 82 | # focus window 83 | cmd - h : yabai -m window --focus west 84 | cmd - j : yabai -m window --focus south 85 | cmd - k : yabai -m window --focus north 86 | cmd - l : yabai -m window --focus east 87 | 88 | # swap managed window 89 | shift + cmd - h : yabai -m window --swap west 90 | shift + cmd - j : yabai -m window --swap south 91 | shift + cmd - k : yabai -m window --swap north 92 | shift + cmd - l : yabai -m window --swap east 93 | 94 | # move managed window 95 | # shift + cmd - h : yabai -m window --warp east 96 | 97 | # balance size of windows 98 | # shift + alt - 0 : yabai -m space --balance 99 | 100 | # make floating window fill screen 101 | # shift + alt - up : yabai -m window --grid 1:1:0:0:1:1 102 | 103 | # make floating window fill left-half of screen 104 | # shift + alt - left : yabai -m window --grid 1:2:0:0:1:1 105 | 106 | # create desktop, move window and follow focus - uses jq for parsing json (brew install jq) 107 | # shift + cmd - n : yabai -m space --create && \ 108 | # index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \ 109 | # yabai -m window --space "${index}" && \ 110 | # yabai -m space --focus "${index}" 111 | 112 | # fast focus desktop 113 | # cmd + alt - x : yabai -m space --focus recent 114 | 115 | # Create space on the active display 116 | # alt -n : yabai -m space --create 117 | 118 | # Delete focused space and focus first space on display 119 | # alt - x : yabai -m space --destroy 120 | 121 | # send window to desktop and follow focus 122 | # shift + cmd - z : yabai -m window --space next; yabai -m space --focus next 123 | # shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2 124 | 125 | # focus monitor 126 | # ctrl + alt - z : yabai -m display --focus prev 127 | # ctrl + alt - 3 : yabai -m display --focus 3 128 | 129 | # send window to monitor and follow focus 130 | # ctrl + cmd - c : yabai -m window --display next; yabai -m display --focus next 131 | # ctrl + cmd - 1 : yabai -m window --display 1; yabai -m display --focus 1 132 | 133 | # move floating window 134 | # shift + ctrl - a : yabai -m window --move rel:-20:0 135 | # shift + ctrl - s : yabai -m window --move rel:0:20 136 | 137 | # increase window size 138 | # shift + alt - a : yabai -m window --resize left:-20:0 139 | # shift + alt - w : yabai -m window --resize top:0:-20 140 | 141 | # decrease window size 142 | # shift + cmd - s : yabai -m window --resize bottom:0:-20 143 | # shift + cmd - w : yabai -m window --resize top:0:20 144 | 145 | # set insertion point in focused container 146 | # ctrl + alt - h : yabai -m window --insert west 147 | 148 | # toggle window zoom 149 | # alt - d : yabai -m window --toggle zoom-parent 150 | # alt - f : yabai -m window --toggle zoom-fullscreen 151 | 152 | # toggle window split type 153 | # alt - e : yabai -m window --toggle split 154 | 155 | # float / unfloat window and center on screen 156 | # alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2 157 | 158 | # toggle sticky(+float), picture-in-picture 159 | # alt - p : yabai -m window --toggle sticky --toggle pip 160 | -------------------------------------------------------------------------------- /.config/ranger/scope.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o noclobber -o noglob -o nounset -o pipefail 4 | IFS=$'\n' 5 | 6 | ## If the option `use_preview_script` is set to `true`, 7 | ## then this script will be called and its output will be displayed in ranger. 8 | ## ANSI color codes are supported. 9 | ## STDIN is disabled, so interactive scripts won't work properly 10 | 11 | ## This script is considered a configuration file and must be updated manually. 12 | ## It will be left untouched if you upgrade ranger. 13 | 14 | ## Because of some automated testing we do on the script #'s for comments need 15 | ## to be doubled up. Code that is commented out, because it's an alternative for 16 | ## example, gets only one #. 17 | 18 | ## Meanings of exit codes: 19 | ## code | meaning | action of ranger 20 | ## -----+------------+------------------------------------------- 21 | ## 0 | success | Display stdout as preview 22 | ## 1 | no preview | Display no preview at all 23 | ## 2 | plain text | Display the plain content of the file 24 | ## 3 | fix width | Don't reload when width changes 25 | ## 4 | fix height | Don't reload when height changes 26 | ## 5 | fix both | Don't ever reload 27 | ## 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview 28 | ## 7 | image | Display the file directly as an image 29 | 30 | ## Script arguments 31 | FILE_PATH="${1}" # Full path of the highlighted file 32 | PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters) 33 | ## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused 34 | PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters) 35 | IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview 36 | PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise. 37 | 38 | FILE_EXTENSION="${FILE_PATH##*.}" 39 | FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')" 40 | 41 | ## Settings 42 | HIGHLIGHT_SIZE_MAX=262143 # 256KiB 43 | HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8} 44 | HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo} 45 | HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}" 46 | PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn} 47 | OPENSCAD_IMGSIZE=${RNGR_OPENSCAD_IMGSIZE:-1000,1000} 48 | OPENSCAD_COLORSCHEME=${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night} 49 | 50 | handle_extension() { 51 | case "${FILE_EXTENSION_LOWER}" in 52 | ## Archive 53 | a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ 54 | rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) 55 | atool --list -- "${FILE_PATH}" && exit 5 56 | bsdtar --list --file "${FILE_PATH}" && exit 5 57 | exit 1;; 58 | rar) 59 | ## Avoid password prompt by providing empty password 60 | unrar lt -p- -- "${FILE_PATH}" && exit 5 61 | exit 1;; 62 | 7z) 63 | ## Avoid password prompt by providing empty password 64 | 7z l -p -- "${FILE_PATH}" && exit 5 65 | exit 1;; 66 | 67 | ## PDF 68 | pdf) 69 | ## Preview as text conversion 70 | pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \ 71 | fmt -w "${PV_WIDTH}" && exit 5 72 | mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \ 73 | fmt -w "${PV_WIDTH}" && exit 5 74 | exiftool "${FILE_PATH}" && exit 5 75 | exit 1;; 76 | 77 | ## BitTorrent 78 | torrent) 79 | transmission-show -- "${FILE_PATH}" && exit 5 80 | exit 1;; 81 | 82 | ## OpenDocument 83 | odt|ods|odp|sxw) 84 | ## Preview as text conversion 85 | odt2txt "${FILE_PATH}" && exit 5 86 | ## Preview as markdown conversion 87 | pandoc -s -t markdown -- "${FILE_PATH}" && exit 5 88 | exit 1;; 89 | 90 | ## XLSX 91 | xlsx) 92 | ## Preview as csv conversion 93 | ## Uses: https://github.com/dilshod/xlsx2csv 94 | xlsx2csv -- "${FILE_PATH}" && exit 5 95 | exit 1;; 96 | 97 | ## HTML 98 | htm|html|xhtml) 99 | ## Preview as text conversion 100 | w3m -dump "${FILE_PATH}" && exit 5 101 | lynx -dump -- "${FILE_PATH}" && exit 5 102 | elinks -dump "${FILE_PATH}" && exit 5 103 | pandoc -s -t markdown -- "${FILE_PATH}" && exit 5 104 | ;; 105 | 106 | ## JSON 107 | json) 108 | jq --color-output . "${FILE_PATH}" && exit 5 109 | python -m json.tool -- "${FILE_PATH}" && exit 5 110 | ;; 111 | 112 | ## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected 113 | ## by file(1). 114 | dff|dsf|wv|wvc) 115 | mediainfo "${FILE_PATH}" && exit 5 116 | exiftool "${FILE_PATH}" && exit 5 117 | ;; # Continue with next handler on failure 118 | esac 119 | } 120 | 121 | handle_image() { 122 | ## Size of the preview if there are multiple options or it has to be 123 | ## rendered from vector graphics. If the conversion program allows 124 | ## specifying only one dimension while keeping the aspect ratio, the width 125 | ## will be used. 126 | local DEFAULT_SIZE="1920x1080" 127 | 128 | local mimetype="${1}" 129 | case "${mimetype}" in 130 | ## SVG 131 | image/svg+xml|image/svg) 132 | convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6 133 | exit 1;; 134 | 135 | ## DjVu 136 | # image/vnd.djvu) 137 | # ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \ 138 | # - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \ 139 | # && exit 6 || exit 1;; 140 | 141 | ## Image 142 | image/*) 143 | local orientation 144 | orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )" 145 | ## If orientation data is present and the image actually 146 | ## needs rotating ("1" means no rotation)... 147 | if [[ -n "$orientation" && "$orientation" != 1 ]]; then 148 | ## ...auto-rotate the image according to the EXIF data. 149 | convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6 150 | fi 151 | 152 | ## `w3mimgdisplay` will be called for all images (unless overriden 153 | ## as above), but might fail for unsupported types. 154 | exit 7;; 155 | 156 | ## Video 157 | video/*) 158 | # Thumbnail 159 | ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 160 | exit 1;; 161 | 162 | ## PDF 163 | application/pdf) 164 | pdftoppm -f 1 -l 1 \ 165 | -scale-to-x "${DEFAULT_SIZE%x*}" \ 166 | -scale-to-y -1 \ 167 | -singlefile \ 168 | -jpeg -tiffcompression jpeg \ 169 | -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \ 170 | && exit 6 || exit 1;; 171 | 172 | 173 | ## ePub, MOBI, FB2 (using Calibre) 174 | # application/epub+zip|application/x-mobipocket-ebook|\ 175 | # application/x-fictionbook+xml) 176 | # # ePub (using https://github.com/marianosimone/epub-thumbnailer) 177 | # epub-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" \ 178 | # "${DEFAULT_SIZE%x*}" && exit 6 179 | # ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" \ 180 | # >/dev/null && exit 6 181 | # exit 1;; 182 | 183 | ## Font 184 | application/font*|application/*opentype) 185 | preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png" 186 | if fontimage -o "${preview_png}" \ 187 | --pixelsize "120" \ 188 | --fontname \ 189 | --pixelsize "80" \ 190 | --text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \ 191 | --text " abcdefghijklmnopqrstuvwxyz " \ 192 | --text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \ 193 | --text " The quick brown fox jumps over the lazy dog. " \ 194 | "${FILE_PATH}"; 195 | then 196 | convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \ 197 | && rm "${preview_png}" \ 198 | && exit 6 199 | else 200 | exit 1 201 | fi 202 | ;; 203 | 204 | ## Preview archives using the first image inside. 205 | ## (Very useful for comic book collections for example.) 206 | # application/zip|application/x-rar|application/x-7z-compressed|\ 207 | # application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar) 208 | # local fn=""; local fe="" 209 | # local zip=""; local rar=""; local tar=""; local bsd="" 210 | # case "${mimetype}" in 211 | # application/zip) zip=1 ;; 212 | # application/x-rar) rar=1 ;; 213 | # application/x-7z-compressed) ;; 214 | # *) tar=1 ;; 215 | # esac 216 | # { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \ 217 | # { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \ 218 | # { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \ 219 | # { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return 220 | # 221 | # fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \ 222 | # [ print(l, end='') for l in sys.stdin if \ 223 | # (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\ 224 | # sort -V | head -n 1) 225 | # [ "$fn" = "" ] && return 226 | # [ "$bsd" ] && fn=$(printf '%b' "$fn") 227 | # 228 | # [ "$tar" ] && tar --extract --to-stdout \ 229 | # --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6 230 | # fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g') 231 | # [ "$bsd" ] && bsdtar --extract --to-stdout \ 232 | # --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6 233 | # [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}" 234 | # [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \ 235 | # "${IMAGE_CACHE_PATH}" && exit 6 236 | # [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \ 237 | # "${IMAGE_CACHE_PATH}" && exit 6 238 | # [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}" 239 | # ;; 240 | esac 241 | 242 | # openscad_image() { 243 | # TMPPNG="$(mktemp -t XXXXXX.png)" 244 | # openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \ 245 | # --imgsize="${OPENSCAD_IMGSIZE/x/,}" \ 246 | # -o "${TMPPNG}" "${1}" 247 | # mv "${TMPPNG}" "${IMAGE_CACHE_PATH}" 248 | # } 249 | 250 | # case "${FILE_EXTENSION_LOWER}" in 251 | # ## 3D models 252 | # ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH} 253 | # ## is hardcoded as jpeg. So we make a tempfile.png and just 254 | # ## move/rename it to jpg. This works because image libraries are 255 | # ## smart enough to handle it. 256 | # csg|scad) 257 | # openscad_image "${FILE_PATH}" && exit 6 258 | # ;; 259 | # 3mf|amf|dxf|off|stl) 260 | # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 261 | # ;; 262 | # esac 263 | } 264 | 265 | handle_mime() { 266 | local mimetype="${1}" 267 | case "${mimetype}" in 268 | ## RTF and DOC 269 | text/rtf|*msword) 270 | ## Preview as text conversion 271 | ## note: catdoc does not always work for .doc files 272 | ## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/ 273 | catdoc -- "${FILE_PATH}" && exit 5 274 | exit 1;; 275 | 276 | ## DOCX, ePub, FB2 (using markdown) 277 | ## You might want to remove "|epub" and/or "|fb2" below if you have 278 | ## uncommented other methods to preview those formats 279 | *wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml) 280 | ## Preview as markdown conversion 281 | pandoc -s -t markdown -- "${FILE_PATH}" && exit 5 282 | exit 1;; 283 | 284 | ## XLS 285 | *ms-excel) 286 | ## Preview as csv conversion 287 | ## xls2csv comes with catdoc: 288 | ## http://www.wagner.pp.ru/~vitus/software/catdoc/ 289 | xls2csv -- "${FILE_PATH}" && exit 5 290 | exit 1;; 291 | 292 | ## Text 293 | text/* | */xml) 294 | ## Syntax highlight 295 | if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then 296 | exit 2 297 | fi 298 | if [[ "$( tput colors )" -ge 256 ]]; then 299 | local pygmentize_format='terminal256' 300 | local highlight_format='xterm256' 301 | else 302 | local pygmentize_format='terminal' 303 | local highlight_format='ansi' 304 | fi 305 | env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \ 306 | --out-format="${highlight_format}" \ 307 | --force -- "${FILE_PATH}" && exit 5 308 | env COLORTERM=8bit bat --color=always --style="plain" \ 309 | -- "${FILE_PATH}" && exit 5 310 | pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\ 311 | -- "${FILE_PATH}" && exit 5 312 | exit 2;; 313 | 314 | ## DjVu 315 | image/vnd.djvu) 316 | ## Preview as text conversion (requires djvulibre) 317 | djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5 318 | exiftool "${FILE_PATH}" && exit 5 319 | exit 1;; 320 | 321 | ## Image 322 | image/*) 323 | ## Preview as text conversion 324 | # img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4 325 | exiftool "${FILE_PATH}" && exit 5 326 | exit 1;; 327 | 328 | ## Video and audio 329 | video/* | audio/*) 330 | mediainfo "${FILE_PATH}" && exit 5 331 | exiftool "${FILE_PATH}" && exit 5 332 | exit 1;; 333 | esac 334 | } 335 | 336 | handle_fallback() { 337 | echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5 338 | exit 1 339 | } 340 | 341 | 342 | MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" 343 | if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then 344 | handle_image "${MIMETYPE}" 345 | fi 346 | handle_extension 347 | handle_mime "${MIMETYPE}" 348 | handle_fallback 349 | 350 | exit 1 351 | -------------------------------------------------------------------------------- /.config/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | # ____ ___ _ __________________ 2 | # / __ \/ | / | / / ____/ ____/ __ \ 3 | # / /_/ / /| | / |/ / / __/ __/ / /_/ / 4 | # / _, _/ ___ |/ /| / /_/ / /___/ _, _/ 5 | # /_/ |_/_/ |_/_/ |_/\____/_____/_/ |_| 6 | # 7 | # https://github.com/jorgeloopzz 8 | 9 | 10 | # =================================================================== 11 | # == Options 12 | # =================================================================== 13 | 14 | # Which viewmode should be used? Possible values are: 15 | # miller: Use miller columns which show multiple levels of the hierarchy 16 | # multipane: Midnight-commander like multipane view showing all tabs next 17 | # to each other 18 | set viewmode miller 19 | #set viewmode multipane 20 | 21 | # How many columns are there, and what are their relative widths? 22 | set column_ratios 1,3,4 23 | 24 | # Which files should be hidden? (regular expression) 25 | set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ 26 | 27 | # Show hidden files? You can toggle this by typing 'zh' 28 | set show_hidden false 29 | 30 | # Ask for a confirmation when running the "delete" command? 31 | # Valid values are "always", "never", "multiple" (default) 32 | # With "multiple", ranger will ask only if you delete multiple files at once. 33 | set confirm_on_delete multiple 34 | 35 | # Use non-default path for file preview script? 36 | # ranger ships with scope.sh, a script that calls external programs (see 37 | # README.md for dependencies) to preview images, archives, etc. 38 | set preview_script ~/.config/ranger/scope.sh 39 | 40 | # Use the external preview script or display simple plain text or image previews? 41 | set use_preview_script true 42 | 43 | # Automatically count files in the directory, even before entering them? 44 | set automatically_count_files true 45 | 46 | # Open all images in this directory when running certain image viewers 47 | # like feh or sxiv? You can still open selected files by marking them. 48 | set open_all_images true 49 | 50 | # Be aware of version control systems and display information. 51 | set vcs_aware true 52 | 53 | # State of the four backends git, hg, bzr, svn. The possible states are 54 | # disabled, local (only show local info), enabled (show local and remote 55 | # information). 56 | set vcs_backend_git enabled 57 | 58 | # Truncate the long commit messages to this length when shown in the statusbar. 59 | set vcs_msg_length 50 60 | 61 | # Use one of the supported image preview protocols 62 | set preview_images true 63 | 64 | # Set the preview image method. Supported methods: 65 | # 66 | # * w3m (default): 67 | # Preview images in full color with the external command "w3mimgpreview"? 68 | # This requires the console web browser "w3m" and a supported terminal. 69 | # It has been successfully tested with "xterm" and "urxvt" without tmux. 70 | # 71 | # * iterm2: 72 | # Preview images in full color using iTerm2 image previews 73 | # (http://iterm2.com/images.html). This requires using iTerm2 compiled 74 | # with image preview support. 75 | # 76 | # This feature relies on the dimensions of the terminal's font. By default, a 77 | # width of 8 and height of 11 are used. To use other values, set the options 78 | # iterm2_font_width and iterm2_font_height to the desired values. 79 | # 80 | # * terminology: 81 | # Previews images in full color in the terminology terminal emulator. 82 | # Supports a wide variety of formats, even vector graphics like svg. 83 | # 84 | # * urxvt: 85 | # Preview images in full color using urxvt image backgrounds. This 86 | # requires using urxvt compiled with pixbuf support. 87 | # 88 | # * urxvt-full: 89 | # The same as urxvt but utilizing not only the preview pane but the 90 | # whole terminal window. 91 | # 92 | # * kitty: 93 | # Preview images in full color using kitty image protocol. 94 | # Requires python PIL or pillow library. 95 | # If ranger does not share the local filesystem with kitty 96 | # the transfer method is changed to encode the whole image; 97 | # while slower, this allows remote previews, 98 | # for example during an ssh session. 99 | # Tmux is unsupported. 100 | # 101 | # * ueberzug: 102 | # Preview images in full color with the external command "ueberzug". 103 | # Images are shown by using a child window. 104 | # Only for users who run X11 in GNU/Linux. 105 | set preview_images_method iterm2 106 | 107 | # Delay in seconds before displaying an image with the w3m method. 108 | # Increase it in case of experiencing display corruption. 109 | set w3m_delay 0.2 110 | 111 | # Manually adjust the w3mimg offset when using a terminal which needs this 112 | set w3m_offset 6 113 | 114 | # Use a unicode "..." character to mark cut-off filenames? 115 | set unicode_ellipsis false 116 | 117 | # Show dotfiles in the bookmark preview box? 118 | set show_hidden_bookmarks true 119 | 120 | # Which colorscheme to use? → Default-jungle-snow-solarized 121 | set colorscheme default 122 | 123 | # Preview files on the rightmost column? 124 | # And collapse (shrink) the last column if there is nothing to preview? 125 | set preview_files true 126 | set preview_directories true 127 | set collapse_preview true 128 | 129 | # Wrap long lines in plain text previews? 130 | set wrap_plaintext_previews false 131 | 132 | # Save the console history on exit? 133 | set save_console_history true 134 | 135 | # Draw a progress bar in the status bar which displays the average state of all 136 | # currently running tasks which support progress bars? 137 | set draw_progress_bar_in_status_bar true 138 | 139 | # Draw borders around columns? (separators, outline, both, or none) 140 | # Separators are vertical lines between columns. 141 | # Outline draws a box around all the columns. 142 | # Both or true combines the two. 143 | set draw_borders true 144 | 145 | # Display the directory name in tabs? 146 | set dirname_in_tabs true 147 | 148 | # Enable the mouse support? 149 | set mouse_enabled false 150 | 151 | # Display the file size in the main column or status bar? 152 | set display_size_in_main_column true 153 | set display_size_in_status_bar false 154 | 155 | # Display the free disk space in the status bar? 156 | set display_free_space_in_status_bar false 157 | 158 | # Display files tags in all columns or only in main column? 159 | set display_tags_in_all_columns true 160 | 161 | # Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME` 162 | set update_title false 163 | 164 | # Set the tmux/screen window-name to "ranger"? 165 | set update_tmux_title true 166 | 167 | # Shorten the title if it gets long? The number defines how many 168 | # directories are displayed at once, 0 turns off this feature. 169 | set shorten_title 3 170 | 171 | # Show hostname in titlebar? 172 | set hostname_in_titlebar false 173 | 174 | # Abbreviate $HOME with ~ in the titlebar (first line) of ranger? 175 | set tilde_in_titlebar true 176 | 177 | # How many directory-changes or console-commands should be kept in history? 178 | set max_history_size 20 179 | set max_console_history_size 50 180 | 181 | # Try to keep so much space between the top/bottom border when scrolling: 182 | set scroll_offset 8 183 | 184 | # Flush the input after each key hit? (Noticeable when ranger lags) 185 | set flushinput true 186 | 187 | # Padding on the right when there's no preview? 188 | # This allows you to click into the space to run the file. 189 | set padding_right true 190 | 191 | # Save bookmarks (used with mX and `X) instantly? 192 | # This helps to synchronize bookmarks between multiple ranger 193 | # instances but leads to *slight* performance loss. 194 | # When false, bookmarks are saved when ranger is exited. 195 | set autosave_bookmarks true 196 | 197 | # Save the "`" bookmark to disk. This can be used to switch to the last 198 | # directory by typing "``". 199 | set save_backtick_bookmark true 200 | 201 | # You can display the "real" cumulative size of directories by using the 202 | # command :get_cumulative_size or typing "dc". The size is expensive to 203 | # calculate and will not be updated automatically. You can choose 204 | # to update it automatically though by turning on this option: 205 | set autoupdate_cumulative_size false 206 | 207 | # Turning this on makes sense for screen readers: 208 | set show_cursor false 209 | 210 | # One of: size, natural, basename, atime, ctime, mtime, type, random 211 | set sort natural 212 | 213 | # Additional sorting options 214 | set sort_reverse false 215 | set sort_case_insensitive true 216 | set sort_directories_first true 217 | set sort_unicode false 218 | 219 | # Enable this if key combinations with the Alt Key don't work for you. 220 | # (Especially on xterm) 221 | set xterm_alt_key false 222 | 223 | # Whether to include bookmarks in cd command 224 | set cd_bookmarks true 225 | 226 | # Changes case sensitivity for the cd command tab completion 227 | set cd_tab_case sensitive 228 | 229 | # Use fuzzy tab completion with the "cd" command. For example, 230 | # ":cd /u/lo/b" expands to ":cd /usr/local/bin". 231 | set cd_tab_fuzzy false 232 | 233 | # Avoid previewing files larger than this size, in bytes. Use a value of 0 to 234 | # disable this feature. 235 | set preview_max_size 0 236 | 237 | # The key hint lists up to this size have their sublists expanded. 238 | # Otherwise the submaps are replaced with "...". 239 | set hint_collapse_threshold 10 240 | 241 | # Add the highlighted file to the path in the titlebar 242 | set show_selection_in_titlebar true 243 | 244 | # The delay that ranger idly waits for user input, in milliseconds, with a 245 | # resolution of 100ms. Lower delay reduces lag between directory updates but 246 | # increases CPU load. 247 | set idle_delay 2000 248 | 249 | # When the metadata manager module looks for metadata, should it only look for 250 | # a ".metadata.json" file in the current directory, or do a deep search and 251 | # check all directories above the current one as well? 252 | set metadata_deep_search false 253 | 254 | # Clear all existing filters when leaving a directory 255 | set clear_filters_on_dir_change false 256 | 257 | # Save tabs on exit 258 | set save_tabs_on_exit false 259 | 260 | # Enable scroll wrapping - moving down while on the last item will wrap around to 261 | # the top and vice versa. 262 | set wrap_scroll false 263 | 264 | # Set the global_inode_type_filter to nothing. Possible options: d, f and l for 265 | # directories, files and symlinks respectively. 266 | set global_inode_type_filter 267 | 268 | # This setting allows to freeze the list of files to save I/O bandwidth. It 269 | # should be 'false' during start-up, but you can toggle it by pressing F. 270 | set freeze_files false 271 | 272 | # Print file sizes in bytes instead of the default human-readable format. 273 | set size_in_bytes false 274 | 275 | # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words 276 | # give a warning when you nest ranger in a subshell started by ranger. 277 | # Special value "error" makes the warning more visible. 278 | set nested_ranger_warning true 279 | 280 | # =================================================================== 281 | # == Local Options 282 | # =================================================================== 283 | # You can set local options that only affect a single directory. 284 | 285 | # Examples: 286 | # setlocal path=~/downloads sort mtime 287 | 288 | # =================================================================== 289 | # == Command Aliases in the Console 290 | # =================================================================== 291 | 292 | alias e edit 293 | alias q quit 294 | alias q! quit! 295 | alias qa quitall 296 | alias qa! quitall! 297 | alias qall quitall 298 | alias qall! quitall! 299 | alias setl setlocal 300 | 301 | alias filter scout -prts 302 | alias find scout -aets 303 | alias mark scout -mr 304 | alias unmark scout -Mr 305 | alias search scout -rs 306 | alias search_inc scout -rts 307 | alias travel scout -aefklst 308 | 309 | # =================================================================== 310 | # == Define keys for the browser 311 | # =================================================================== 312 | 313 | # Basic 314 | map Q quitall 315 | map q quit 316 | copymap q ZZ ZQ 317 | 318 | map R reload_cwd 319 | map F set freeze_files! 320 | map reset 321 | map redraw_window 322 | map abort 323 | map change_mode normal 324 | map ~ set viewmode! 325 | 326 | map i display_file 327 | map scroll_preview 1 328 | map scroll_preview -1 329 | map ? help 330 | map W display_log 331 | map w taskview_open 332 | map S shell $SHELL 333 | 334 | map : console 335 | map ; console 336 | map ! console shell%space 337 | map @ console -p6 shell %%s 338 | map # console shell -p%space 339 | map s console shell%space 340 | map r chain draw_possible_programs; console open_with%space 341 | map f console find%space 342 | map cd console cd%space 343 | 344 | map chain console; eval fm.ui.console.history_move(-1) 345 | 346 | # Change the line mode 347 | map Mf linemode filename 348 | map Mi linemode fileinfo 349 | map Mm linemode mtime 350 | map Mh linemode humanreadablemtime 351 | map Mp linemode permissions 352 | map Ms linemode sizemtime 353 | map MH linemode sizehumanreadablemtime 354 | map Mt linemode metatitle 355 | 356 | # Tagging / Marking 357 | map t tag_toggle 358 | map ut tag_remove 359 | map " tag_toggle tag=%any 360 | map mark_files toggle=True 361 | map v mark_files all=True toggle=True 362 | map uv mark_files all=True val=False 363 | map V toggle_visual_mode 364 | map uV toggle_visual_mode reverse=True 365 | 366 | # For the nostalgics: Midnight Commander bindings 367 | map help 368 | map rename_append 369 | map display_file 370 | map edit 371 | map copy 372 | map cut 373 | map console mkdir%space 374 | map console delete 375 | #map console trash 376 | map exit 377 | 378 | # In case you work on a keyboard with dvorak layout 379 | map move up=1 380 | map move down=1 381 | map move left=1 382 | map move right=1 383 | map move to=0 384 | map move to=-1 385 | map move down=1 pages=True 386 | map move up=1 pages=True 387 | map move right=1 388 | #map console delete 389 | map console touch%space 390 | 391 | # VIM-like 392 | copymap k 393 | copymap j 394 | copymap h 395 | copymap l 396 | copymap gg 397 | copymap G 398 | copymap 399 | copymap 400 | 401 | map J move down=0.5 pages=True 402 | map K move up=0.5 pages=True 403 | copymap J 404 | copymap K 405 | 406 | # Jumping around 407 | map H history_go -1 408 | map L history_go 1 409 | map ] move_parent 1 410 | map [ move_parent -1 411 | map } traverse 412 | map { traverse_backwards 413 | map ) jump_non 414 | 415 | map gh cd ~ 416 | map ge cd /etc 417 | map gu cd /usr 418 | map gd cd /dev 419 | map gl cd -r . 420 | map gL cd -r %f 421 | map go cd /opt 422 | map gv cd /var 423 | map gm cd /media 424 | map gi eval fm.cd('/run/media/' + os.getenv('USER')) 425 | map gM cd /mnt 426 | map gs cd /srv 427 | map gp cd /tmp 428 | map gr cd / 429 | map gR eval fm.cd(ranger.RANGERDIR) 430 | map g/ cd / 431 | map g? cd /usr/share/doc/ranger 432 | 433 | # External Programs 434 | map E edit 435 | map du shell -p du --max-depth=1 -h --apparent-size 436 | map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh 437 | map yp yank path 438 | map yd yank dir 439 | map yn yank name 440 | map y. yank name_without_extension 441 | 442 | # Filesystem Operations 443 | map = chmod 444 | 445 | map cw console rename%space 446 | map a rename_append 447 | map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) 448 | map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7) 449 | 450 | map pp paste 451 | map po paste overwrite=True 452 | map pP paste append=True 453 | map pO paste overwrite=True append=True 454 | map pl paste_symlink relative=False 455 | map pL paste_symlink relative=True 456 | map phl paste_hardlink 457 | map pht paste_hardlinked_subtree 458 | map pd console paste dest= 459 | map p` paste dest=%any_path 460 | map p' paste dest=%any_path 461 | 462 | map dD console delete 463 | map dT console trash 464 | 465 | map dd cut 466 | map ud uncut 467 | map da cut mode=add 468 | map dr cut mode=remove 469 | map dt cut mode=toggle 470 | 471 | map yy copy 472 | map uy uncut 473 | map ya copy mode=add 474 | map yr copy mode=remove 475 | map yt copy mode=toggle 476 | 477 | # Temporary workarounds 478 | map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) 479 | map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) 480 | map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) 481 | map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) 482 | map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) 483 | map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) 484 | map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) 485 | map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) 486 | 487 | # Searching 488 | map / console search%space 489 | map n search_next 490 | map N search_next forward=False 491 | map ct search_next order=tag 492 | map cs search_next order=size 493 | map ci search_next order=mimetype 494 | map cc search_next order=ctime 495 | map cm search_next order=mtime 496 | map ca search_next order=atime 497 | 498 | # Tabs 499 | map tab_new 500 | map tab_close 501 | map tab_move 1 502 | map tab_move -1 503 | map tab_move 1 504 | map tab_move -1 505 | map gt tab_move 1 506 | map gT tab_move -1 507 | map gn tab_new 508 | map gc tab_close 509 | map uq tab_restore 510 | map tab_open 1 511 | map tab_open 2 512 | map tab_open 3 513 | map tab_open 4 514 | map tab_open 5 515 | map tab_open 6 516 | map tab_open 7 517 | map tab_open 8 518 | map tab_open 9 519 | map tab_shift 1 520 | map tab_shift -1 521 | 522 | # Sorting 523 | map or set sort_reverse! 524 | map oz set sort=random 525 | map os chain set sort=size; set sort_reverse=False 526 | map ob chain set sort=basename; set sort_reverse=False 527 | map on chain set sort=natural; set sort_reverse=False 528 | map om chain set sort=mtime; set sort_reverse=False 529 | map oc chain set sort=ctime; set sort_reverse=False 530 | map oa chain set sort=atime; set sort_reverse=False 531 | map ot chain set sort=type; set sort_reverse=False 532 | map oe chain set sort=extension; set sort_reverse=False 533 | 534 | map oS chain set sort=size; set sort_reverse=True 535 | map oB chain set sort=basename; set sort_reverse=True 536 | map oN chain set sort=natural; set sort_reverse=True 537 | map oM chain set sort=mtime; set sort_reverse=True 538 | map oC chain set sort=ctime; set sort_reverse=True 539 | map oA chain set sort=atime; set sort_reverse=True 540 | map oT chain set sort=type; set sort_reverse=True 541 | map oE chain set sort=extension; set sort_reverse=True 542 | 543 | map dc get_cumulative_size 544 | 545 | # Settings 546 | map zc set collapse_preview! 547 | map zd set sort_directories_first! 548 | map zh set show_hidden! 549 | map set show_hidden! 550 | copymap 551 | copymap 552 | map zI set flushinput! 553 | map zi set preview_images! 554 | map zm set mouse_enabled! 555 | map zp set preview_files! 556 | map zP set preview_directories! 557 | map zs set sort_case_insensitive! 558 | map zu set autoupdate_cumulative_size! 559 | map zv set use_preview_script! 560 | map zf console filter%space 561 | copymap zf zz 562 | 563 | # Filter stack 564 | map .d filter_stack add type d 565 | map .f filter_stack add type f 566 | map .l filter_stack add type l 567 | map .m console filter_stack add mime%space 568 | map .n console filter_stack add name%space 569 | map .# console filter_stack add hash%space 570 | map ." filter_stack add duplicate 571 | map .' filter_stack add unique 572 | map .| filter_stack add or 573 | map .& filter_stack add and 574 | map .! filter_stack add not 575 | map .r filter_stack rotate 576 | map .c filter_stack clear 577 | map .* filter_stack decompose 578 | map .p filter_stack pop 579 | map .. filter_stack show 580 | 581 | # Bookmarks 582 | map ` enter_bookmark %any 583 | map ' enter_bookmark %any 584 | map m set_bookmark %any 585 | map um unset_bookmark %any 586 | 587 | map m draw_bookmarks 588 | copymap m um ` ' 589 | 590 | # Generate all the chmod bindings with some python help: 591 | eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) 592 | eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) 593 | eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) 594 | eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) 595 | eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) 596 | 597 | eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) 598 | eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) 599 | eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) 600 | eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) 601 | eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) 602 | 603 | # =================================================================== 604 | # == Define keys for the console 605 | # =================================================================== 606 | # Note: Unmapped keys are passed directly to the console. 607 | 608 | # Basic 609 | cmap eval fm.ui.console.tab() 610 | cmap eval fm.ui.console.tab(-1) 611 | cmap eval fm.ui.console.close() 612 | cmap eval fm.ui.console.execute() 613 | cmap redraw_window 614 | 615 | copycmap 616 | copycmap 617 | 618 | # Move around 619 | cmap eval fm.ui.console.history_move(-1) 620 | cmap eval fm.ui.console.history_move(1) 621 | cmap eval fm.ui.console.move(left=1) 622 | cmap eval fm.ui.console.move(right=1) 623 | cmap eval fm.ui.console.move(right=0, absolute=True) 624 | cmap eval fm.ui.console.move(right=-1, absolute=True) 625 | cmap eval fm.ui.console.move_word(left=1) 626 | cmap eval fm.ui.console.move_word(right=1) 627 | 628 | copycmap 629 | copycmap 630 | 631 | # Line Editing 632 | cmap eval fm.ui.console.delete(-1) 633 | cmap eval fm.ui.console.delete(0) 634 | cmap eval fm.ui.console.delete_word() 635 | cmap eval fm.ui.console.delete_word(backward=False) 636 | cmap eval fm.ui.console.delete_rest(1) 637 | cmap eval fm.ui.console.delete_rest(-1) 638 | cmap eval fm.ui.console.paste() 639 | 640 | # And of course the emacs way 641 | copycmap 642 | copycmap 643 | copycmap 644 | copycmap 645 | copycmap 646 | copycmap 647 | copycmap 648 | copycmap 649 | copycmap 650 | 651 | # Note: There are multiple ways to express backspaces. (code 263) 652 | # and (code 127). To be sure, use both. 653 | copycmap 654 | 655 | # This special expression allows typing in numerals: 656 | cmap false 657 | 658 | # =================================================================== 659 | # == Pager Keybindings 660 | # =================================================================== 661 | 662 | # Movement 663 | pmap pager_move down=1 664 | pmap pager_move up=1 665 | pmap pager_move left=4 666 | pmap pager_move right=4 667 | pmap pager_move to=0 668 | pmap pager_move to=-1 669 | pmap pager_move down=1.0 pages=True 670 | pmap pager_move up=1.0 pages=True 671 | pmap pager_move down=0.5 pages=True 672 | pmap pager_move up=0.5 pages=True 673 | 674 | copypmap k 675 | copypmap j 676 | copypmap h 677 | copypmap l 678 | copypmap g 679 | copypmap G 680 | copypmap d 681 | copypmap u 682 | copypmap n f 683 | copypmap p b 684 | 685 | # Basic 686 | pmap redraw_window 687 | pmap pager_close 688 | copypmap q Q i 689 | pmap E edit_file 690 | 691 | # =================================================================== 692 | # == Taskview Keybindings 693 | # =================================================================== 694 | 695 | # Movement 696 | tmap taskview_move up=1 697 | tmap taskview_move down=1 698 | tmap taskview_move to=0 699 | tmap taskview_move to=-1 700 | tmap taskview_move down=1.0 pages=True 701 | tmap taskview_move up=1.0 pages=True 702 | tmap taskview_move down=0.5 pages=True 703 | tmap taskview_move up=0.5 pages=True 704 | 705 | copytmap k 706 | copytmap j 707 | copytmap g 708 | copytmap G 709 | copytmap u 710 | copytmap n f 711 | copytmap p b 712 | 713 | # Changing priority and deleting tasks 714 | tmap J eval -q fm.ui.taskview.task_move(-1) 715 | tmap K eval -q fm.ui.taskview.task_move(0) 716 | tmap dd eval -q fm.ui.taskview.task_remove() 717 | tmap eval -q fm.ui.taskview.task_move(-1) 718 | tmap eval -q fm.ui.taskview.task_move(0) 719 | tmap eval -q fm.ui.taskview.task_remove() 720 | 721 | # Basic 722 | tmap redraw_window 723 | tmap taskview_close 724 | copytmap q Q w 725 | 726 | # Set icons 727 | default_linemode devicons 728 | 729 | --------------------------------------------------------------------------------