├── .gitignore ├── Brewfile ├── Brewfile.lock.json ├── README.markdown ├── bin ├── +x ├── add-keys ├── adr-new ├── afro ├── anybar-internet ├── bak ├── build_status ├── date-iso ├── desktop-images-to-funny ├── fresh-convert ├── gbrt ├── ghu ├── git-author ├── git-files-modified-on-branch ├── git-github-url ├── git-last-commit-message ├── git-rm-tag ├── git-rm-untracked ├── git-swap-latest ├── git-time-spent ├── heroku-remote-add ├── hex_to_uicolor ├── keypad ├── open-urls ├── osx-defaults ├── plot_coconut_battery ├── psg ├── rubygems-github-urls ├── shorten ├── skype-search ├── squash-whitespace ├── tor-proxy ├── uuid ├── wemux-connect ├── whiteboard-clean ├── xcode └── zsh_profile_sort_timings ├── config ├── ackrc ├── alacritty │ └── alacritty.yml ├── asdfrc ├── ctags ├── gitconfig ├── gitignore ├── hushlogin ├── inputrc ├── khdrc ├── kwm │ └── kwmrc ├── modalmenu.json ├── nvim │ ├── init.lua │ └── plugins │ │ └── gitsigns.lua ├── pryrc ├── ranger │ └── rc.conf ├── ssh │ └── config └── tmux.conf ├── freshrc ├── git-hooks └── prepare-commit-msg ├── shell ├── aliases │ ├── aliases.sh │ ├── git.sh │ └── ruby.sh ├── asdf.sh ├── exports.sh ├── functions │ ├── cucumber.sh │ ├── ghr.sh │ ├── h.sh │ ├── hitch.sh │ ├── o.sh │ ├── pubkey.sh │ ├── simple_prompt.sh │ ├── tmux.sh │ └── z.sh ├── nodenv.sh └── zsh │ ├── aliases.zsh │ ├── aurora_prompt.zsh │ ├── completion.zsh │ ├── completions │ └── _gh │ ├── direnv.zsh │ ├── keybindings.zsh │ ├── profile_end.zsh │ ├── profile_start.zsh │ ├── prompt.zsh │ ├── selecta.zsh │ ├── title.zsh │ ├── tmux-words.zsh │ ├── zsh-syntax-highlighting.zsh │ └── zshrc └── vim ├── coc-settings.json ├── colors ├── bclear_custom.vim ├── jellybeans_custom.vim └── solarized_custom.vim ├── config ├── auto_commands.vim ├── coc.vim ├── dirvish.vim ├── fast_escape.vim ├── fzf.vim ├── gitgutter.vim ├── github-open.vim ├── go.vim ├── keybindings.vim ├── marked.vim ├── ruby_refactoring.vim ├── rust.vim ├── statusline.vim ├── tabularize.vim └── winresizer.vim ├── gvimrc ├── leader.vim ├── plug.vim └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | config/ssh/config.local 2 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | brew 'tmux' 2 | brew 'vim' 3 | brew 'git' # for diff-highlight 4 | brew 'ctags-exuberant' 5 | brew 'direnv' 6 | brew 'yt-dlp' 7 | brew 'ffmpeg' 8 | brew 'fzf' 9 | brew 'rg' 10 | brew 'wget' 11 | brew 'python' 12 | brew 'cloc' 13 | 14 | # cargo binstall ronfmt 15 | -------------------------------------------------------------------------------- /Brewfile.lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "entries": { 3 | "brew": { 4 | "tmux": { 5 | "version": "3.4_1", 6 | "bottle": { 7 | "rebuild": 2, 8 | "root_url": "https://ghcr.io/v2/homebrew/core", 9 | "files": { 10 | "arm64_sonoma": { 11 | "cellar": ":any", 12 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:6b407b3351b79919c482d46134c9e83552f3e848f1c482a7deec65c36cf16d37", 13 | "sha256": "6b407b3351b79919c482d46134c9e83552f3e848f1c482a7deec65c36cf16d37" 14 | }, 15 | "arm64_ventura": { 16 | "cellar": ":any", 17 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:a5a47403c75e2d14370ff07641294bd361eceb8ca2dc65925e5eb7e41453d727", 18 | "sha256": "a5a47403c75e2d14370ff07641294bd361eceb8ca2dc65925e5eb7e41453d727" 19 | }, 20 | "arm64_monterey": { 21 | "cellar": ":any", 22 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:2233d5fd7333fdf3da6dbe48157735c276f27cd7dd274d0e704985c9105e77b0", 23 | "sha256": "2233d5fd7333fdf3da6dbe48157735c276f27cd7dd274d0e704985c9105e77b0" 24 | }, 25 | "sonoma": { 26 | "cellar": ":any", 27 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:2a085e0752332536a198aac71cd6b24a10f6feb0bf1825f90551cd6ef5e8c890", 28 | "sha256": "2a085e0752332536a198aac71cd6b24a10f6feb0bf1825f90551cd6ef5e8c890" 29 | }, 30 | "ventura": { 31 | "cellar": ":any", 32 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:0648a51759f9c37ab98ff9b2558d30aa7ec07a7c7979a4107263e080382d0c0c", 33 | "sha256": "0648a51759f9c37ab98ff9b2558d30aa7ec07a7c7979a4107263e080382d0c0c" 34 | }, 35 | "monterey": { 36 | "cellar": ":any", 37 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:ec64b5ad6daf6bf6cb99cd2580fdf6cfee9830fcedc4971fa9be033710d1774a", 38 | "sha256": "ec64b5ad6daf6bf6cb99cd2580fdf6cfee9830fcedc4971fa9be033710d1774a" 39 | }, 40 | "x86_64_linux": { 41 | "cellar": ":any_skip_relocation", 42 | "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:05e737d00a0f331d48468c8f7f96f70e8879c5e9ffb9fcae9fb1fdae4f71bcd4", 43 | "sha256": "05e737d00a0f331d48468c8f7f96f70e8879c5e9ffb9fcae9fb1fdae4f71bcd4" 44 | } 45 | } 46 | } 47 | }, 48 | "vim": { 49 | "version": "9.1.0700", 50 | "bottle": { 51 | "rebuild": 0, 52 | "root_url": "https://ghcr.io/v2/homebrew/core", 53 | "files": { 54 | "arm64_sonoma": { 55 | "cellar": "/opt/homebrew/Cellar", 56 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:2d92ee06491ac41c6c1fe0e6f7c3e5ab01a8d01dbca38d2c98efc421d4419862", 57 | "sha256": "2d92ee06491ac41c6c1fe0e6f7c3e5ab01a8d01dbca38d2c98efc421d4419862" 58 | }, 59 | "arm64_ventura": { 60 | "cellar": "/opt/homebrew/Cellar", 61 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:32561daf533f6e9dd27e639da59907d2e52809819baefdb5d64b55e0b62f6eb1", 62 | "sha256": "32561daf533f6e9dd27e639da59907d2e52809819baefdb5d64b55e0b62f6eb1" 63 | }, 64 | "arm64_monterey": { 65 | "cellar": "/opt/homebrew/Cellar", 66 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:9eddf896d5f4497c688191a47bcd7af93f80625772c3731e10f67b750a7a5d4b", 67 | "sha256": "9eddf896d5f4497c688191a47bcd7af93f80625772c3731e10f67b750a7a5d4b" 68 | }, 69 | "sonoma": { 70 | "cellar": "/usr/local/Cellar", 71 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:66f81a933c00057b36e8d19f261006da0435988d7e3e6eacc3ff1d70117c9d5e", 72 | "sha256": "66f81a933c00057b36e8d19f261006da0435988d7e3e6eacc3ff1d70117c9d5e" 73 | }, 74 | "ventura": { 75 | "cellar": "/usr/local/Cellar", 76 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:eb050f208f53ca87d6d83cccab0d894013e3375ed746ee8e676def132ccbc354", 77 | "sha256": "eb050f208f53ca87d6d83cccab0d894013e3375ed746ee8e676def132ccbc354" 78 | }, 79 | "monterey": { 80 | "cellar": "/usr/local/Cellar", 81 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:e50c222bc92921fd9502a35087047c7dbc41e09fd0ae6cf676b6db5bf1a032d9", 82 | "sha256": "e50c222bc92921fd9502a35087047c7dbc41e09fd0ae6cf676b6db5bf1a032d9" 83 | }, 84 | "x86_64_linux": { 85 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 86 | "url": "https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:4fcdf11c4ff064cbff8e96a7059061bb093ad19ca68cea09736f1eac29762525", 87 | "sha256": "4fcdf11c4ff064cbff8e96a7059061bb093ad19ca68cea09736f1eac29762525" 88 | } 89 | } 90 | } 91 | }, 92 | "git": { 93 | "version": "2.44.0", 94 | "bottle": { 95 | "rebuild": 0, 96 | "root_url": "https://ghcr.io/v2/homebrew/core", 97 | "files": { 98 | "arm64_sonoma": { 99 | "cellar": "/opt/homebrew/Cellar", 100 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:5c7ecbe7bcaf95fa6ef3766d97045754d9f56c9aa86935a6f0150a23f4aab068", 101 | "sha256": "5c7ecbe7bcaf95fa6ef3766d97045754d9f56c9aa86935a6f0150a23f4aab068" 102 | }, 103 | "arm64_ventura": { 104 | "cellar": "/opt/homebrew/Cellar", 105 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:ac1be4aa1f685950a350862642188e6e5070d54e4e177d966e2e37aa129f8180", 106 | "sha256": "ac1be4aa1f685950a350862642188e6e5070d54e4e177d966e2e37aa129f8180" 107 | }, 108 | "arm64_monterey": { 109 | "cellar": "/opt/homebrew/Cellar", 110 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:5feb852cc15aa4ca597588a9983053b62c1574dda11427fad406b71bd1400f0f", 111 | "sha256": "5feb852cc15aa4ca597588a9983053b62c1574dda11427fad406b71bd1400f0f" 112 | }, 113 | "sonoma": { 114 | "cellar": "/usr/local/Cellar", 115 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:36bf410d7c148714230fc2679e4913351756a31f7f647a5095036e4a43d50b25", 116 | "sha256": "36bf410d7c148714230fc2679e4913351756a31f7f647a5095036e4a43d50b25" 117 | }, 118 | "ventura": { 119 | "cellar": "/usr/local/Cellar", 120 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:967526b438eda92001575ad97e6e3fb5c18992b66e6b015629ff256b57bd523d", 121 | "sha256": "967526b438eda92001575ad97e6e3fb5c18992b66e6b015629ff256b57bd523d" 122 | }, 123 | "monterey": { 124 | "cellar": "/usr/local/Cellar", 125 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:e30ed725acb314c409b7e82f0b725d445909504f16fd6045c135819f43f3e817", 126 | "sha256": "e30ed725acb314c409b7e82f0b725d445909504f16fd6045c135819f43f3e817" 127 | }, 128 | "x86_64_linux": { 129 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 130 | "url": "https://ghcr.io/v2/homebrew/core/git/blobs/sha256:d2a6fded265ac04d96dcb79d852068cffe24c22126cf25f7839850a9cb5d60d9", 131 | "sha256": "d2a6fded265ac04d96dcb79d852068cffe24c22126cf25f7839850a9cb5d60d9" 132 | } 133 | } 134 | } 135 | }, 136 | "ctags-exuberant": { 137 | "version": "5.8_2", 138 | "bottle": { 139 | "rebuild": 0, 140 | "root_url": "https://ghcr.io/v2/homebrew/core", 141 | "files": { 142 | "arm64_sonoma": { 143 | "cellar": ":any_skip_relocation", 144 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:b28f3ab751719782670837ff160aa2aee6889b8e0e064da834ac525d383b2e7a", 145 | "sha256": "b28f3ab751719782670837ff160aa2aee6889b8e0e064da834ac525d383b2e7a" 146 | }, 147 | "arm64_ventura": { 148 | "cellar": ":any_skip_relocation", 149 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:1663c12c3c741cbb744beaeeeeef5b149e3683aa62f3bdb41c8516bb161194e3", 150 | "sha256": "1663c12c3c741cbb744beaeeeeef5b149e3683aa62f3bdb41c8516bb161194e3" 151 | }, 152 | "arm64_monterey": { 153 | "cellar": ":any_skip_relocation", 154 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:fe6b329a45efc1ac2048d4fce13b8fed5758f1814b5cc8a55bd4f542d846b59f", 155 | "sha256": "fe6b329a45efc1ac2048d4fce13b8fed5758f1814b5cc8a55bd4f542d846b59f" 156 | }, 157 | "arm64_big_sur": { 158 | "cellar": ":any_skip_relocation", 159 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:8e8ee6051008e73c999dbc8476221f220ef87fdf9cbc409a308df6a956e114e6", 160 | "sha256": "8e8ee6051008e73c999dbc8476221f220ef87fdf9cbc409a308df6a956e114e6" 161 | }, 162 | "sonoma": { 163 | "cellar": ":any_skip_relocation", 164 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:a421a97ec72230b9a77ee06040aa5cae3170974a0fb5e130938df3bed16eb6e8", 165 | "sha256": "a421a97ec72230b9a77ee06040aa5cae3170974a0fb5e130938df3bed16eb6e8" 166 | }, 167 | "ventura": { 168 | "cellar": ":any_skip_relocation", 169 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:936d4fd1280ecbcff4c3b07a5af8a07c2115c0ffa36bb7aa4418ac2a23d284f2", 170 | "sha256": "936d4fd1280ecbcff4c3b07a5af8a07c2115c0ffa36bb7aa4418ac2a23d284f2" 171 | }, 172 | "monterey": { 173 | "cellar": ":any_skip_relocation", 174 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:dac2afa169f02a036b20d719540124fb030d8e3342a754bd6bbb405f94f417ca", 175 | "sha256": "dac2afa169f02a036b20d719540124fb030d8e3342a754bd6bbb405f94f417ca" 176 | }, 177 | "big_sur": { 178 | "cellar": ":any_skip_relocation", 179 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:9986b3f6897b60cbdf5d73b4ad819d2d30726043dc0d665b77ba2def399a60b4", 180 | "sha256": "9986b3f6897b60cbdf5d73b4ad819d2d30726043dc0d665b77ba2def399a60b4" 181 | }, 182 | "catalina": { 183 | "cellar": ":any_skip_relocation", 184 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:2292b70a7b744c2238507417e40c2dc7273c6d919c9fe037bf668cf00863ad92", 185 | "sha256": "2292b70a7b744c2238507417e40c2dc7273c6d919c9fe037bf668cf00863ad92" 186 | }, 187 | "mojave": { 188 | "cellar": ":any_skip_relocation", 189 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:238b65e5e1614f1d24fd88b6741c04d1cf48fd5f5d247cdbcd1f82d5796197d5", 190 | "sha256": "238b65e5e1614f1d24fd88b6741c04d1cf48fd5f5d247cdbcd1f82d5796197d5" 191 | }, 192 | "x86_64_linux": { 193 | "cellar": ":any_skip_relocation", 194 | "url": "https://ghcr.io/v2/homebrew/core/ctags/blobs/sha256:b8630326626ccee22ad669f9e7c459735a8dc72c765ae40ec218f31e015dc76a", 195 | "sha256": "b8630326626ccee22ad669f9e7c459735a8dc72c765ae40ec218f31e015dc76a" 196 | } 197 | } 198 | } 199 | }, 200 | "direnv": { 201 | "version": "2.34.0", 202 | "bottle": { 203 | "rebuild": 0, 204 | "root_url": "https://ghcr.io/v2/homebrew/core", 205 | "files": { 206 | "arm64_sonoma": { 207 | "cellar": "/opt/homebrew/Cellar", 208 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:fd210e16bd6764b33cd2e556a7f07ed579453ba19d518ec11de33edcf3c5c2c7", 209 | "sha256": "fd210e16bd6764b33cd2e556a7f07ed579453ba19d518ec11de33edcf3c5c2c7" 210 | }, 211 | "arm64_ventura": { 212 | "cellar": "/opt/homebrew/Cellar", 213 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:59af7e0d05a50eda59d60a8c2c67eb0a3491c0650a334568ae13988da3b32951", 214 | "sha256": "59af7e0d05a50eda59d60a8c2c67eb0a3491c0650a334568ae13988da3b32951" 215 | }, 216 | "arm64_monterey": { 217 | "cellar": "/opt/homebrew/Cellar", 218 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:2577f8c5e2c3c7d1ee2f6966e3c92a16853edb9302d78089ddfc4f8ef9efda24", 219 | "sha256": "2577f8c5e2c3c7d1ee2f6966e3c92a16853edb9302d78089ddfc4f8ef9efda24" 220 | }, 221 | "sonoma": { 222 | "cellar": "/usr/local/Cellar", 223 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:4148bce1352772af61eb44303877e57e54a8531240cb551ec2c879660ac90c54", 224 | "sha256": "4148bce1352772af61eb44303877e57e54a8531240cb551ec2c879660ac90c54" 225 | }, 226 | "ventura": { 227 | "cellar": "/usr/local/Cellar", 228 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:b4eefec1b63c6c32713290af5f5e1f2c318d3c64ba052aab786aab0b87c1b437", 229 | "sha256": "b4eefec1b63c6c32713290af5f5e1f2c318d3c64ba052aab786aab0b87c1b437" 230 | }, 231 | "monterey": { 232 | "cellar": "/usr/local/Cellar", 233 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:41cadfe20ab1913f07376ac5206ee49c3322ac8689ecd9a5dc85c5146850dff2", 234 | "sha256": "41cadfe20ab1913f07376ac5206ee49c3322ac8689ecd9a5dc85c5146850dff2" 235 | }, 236 | "x86_64_linux": { 237 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 238 | "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:be4b933f8f607bf1a705c13abe75d04a99856f1698c3ebcb71e07e469850e964", 239 | "sha256": "be4b933f8f607bf1a705c13abe75d04a99856f1698c3ebcb71e07e469850e964" 240 | } 241 | } 242 | } 243 | }, 244 | "yt-dlp": { 245 | "version": "2024.8.6", 246 | "bottle": { 247 | "rebuild": 0, 248 | "root_url": "https://ghcr.io/v2/homebrew/core", 249 | "files": { 250 | "arm64_sonoma": { 251 | "cellar": ":any_skip_relocation", 252 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:b797b9c734c968900c690934f542cd13b8e33dd2f8b9d97413511008495542c0", 253 | "sha256": "b797b9c734c968900c690934f542cd13b8e33dd2f8b9d97413511008495542c0" 254 | }, 255 | "arm64_ventura": { 256 | "cellar": ":any_skip_relocation", 257 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:1a785f580e0075cff2b1c52cc3b468be99ef38114744d0684e83af000d3f9fcf", 258 | "sha256": "1a785f580e0075cff2b1c52cc3b468be99ef38114744d0684e83af000d3f9fcf" 259 | }, 260 | "arm64_monterey": { 261 | "cellar": ":any_skip_relocation", 262 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:cd7cf194bec80d202936154aa558384660917741dd69cb374b157d30867a5f8c", 263 | "sha256": "cd7cf194bec80d202936154aa558384660917741dd69cb374b157d30867a5f8c" 264 | }, 265 | "sonoma": { 266 | "cellar": ":any_skip_relocation", 267 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:f4cdbd90d33c45a57ab7f1613db0f8f06a652ba8d1b37796f85d6d4607cf9b14", 268 | "sha256": "f4cdbd90d33c45a57ab7f1613db0f8f06a652ba8d1b37796f85d6d4607cf9b14" 269 | }, 270 | "ventura": { 271 | "cellar": ":any_skip_relocation", 272 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:017176aa114602671f31ae0c3b549f63fd7c5ee0e6e01574a85b468f039820b7", 273 | "sha256": "017176aa114602671f31ae0c3b549f63fd7c5ee0e6e01574a85b468f039820b7" 274 | }, 275 | "monterey": { 276 | "cellar": ":any_skip_relocation", 277 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:fc342e130a8e9eb8bc64da6db261821c3edba7d2e7f9aecfaeead86caa8c7569", 278 | "sha256": "fc342e130a8e9eb8bc64da6db261821c3edba7d2e7f9aecfaeead86caa8c7569" 279 | }, 280 | "x86_64_linux": { 281 | "cellar": ":any_skip_relocation", 282 | "url": "https://ghcr.io/v2/homebrew/core/yt-dlp/blobs/sha256:856e6287992355951c8b5981c142928465b9414d5bf68f64789d8db9a32bfb13", 283 | "sha256": "856e6287992355951c8b5981c142928465b9414d5bf68f64789d8db9a32bfb13" 284 | } 285 | } 286 | } 287 | }, 288 | "fzf": { 289 | "version": "0.50.0", 290 | "bottle": { 291 | "rebuild": 0, 292 | "root_url": "https://ghcr.io/v2/homebrew/core", 293 | "files": { 294 | "arm64_sonoma": { 295 | "cellar": ":any_skip_relocation", 296 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499", 297 | "sha256": "0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499" 298 | }, 299 | "arm64_ventura": { 300 | "cellar": ":any_skip_relocation", 301 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499", 302 | "sha256": "0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499" 303 | }, 304 | "arm64_monterey": { 305 | "cellar": ":any_skip_relocation", 306 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499", 307 | "sha256": "0ac2f272f6106c5266de224e982bcb9a05c291cfb84a6d797bc759f1a854f499" 308 | }, 309 | "sonoma": { 310 | "cellar": ":any_skip_relocation", 311 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231", 312 | "sha256": "c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231" 313 | }, 314 | "ventura": { 315 | "cellar": ":any_skip_relocation", 316 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231", 317 | "sha256": "c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231" 318 | }, 319 | "monterey": { 320 | "cellar": ":any_skip_relocation", 321 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231", 322 | "sha256": "c964cfe2f826a26f2f7216938152489838480b1ca300b5a70889da9a8fe8e231" 323 | }, 324 | "x86_64_linux": { 325 | "cellar": ":any_skip_relocation", 326 | "url": "https://ghcr.io/v2/homebrew/core/fzf/blobs/sha256:46cf359fa71ad2128170b543989fd28d9ceca2b6ca661e9de70b5d79f6ad9763", 327 | "sha256": "46cf359fa71ad2128170b543989fd28d9ceca2b6ca661e9de70b5d79f6ad9763" 328 | } 329 | } 330 | } 331 | }, 332 | "rg": { 333 | "version": "14.1.0", 334 | "bottle": { 335 | "rebuild": 0, 336 | "root_url": "https://ghcr.io/v2/homebrew/core", 337 | "files": { 338 | "arm64_sonoma": { 339 | "cellar": ":any", 340 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:22cc1f3423a7fddb550fb94bd2715ce5455076d17f2c88ef0c157749ea4b87d6", 341 | "sha256": "22cc1f3423a7fddb550fb94bd2715ce5455076d17f2c88ef0c157749ea4b87d6" 342 | }, 343 | "arm64_ventura": { 344 | "cellar": ":any", 345 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:837aaf1b32879f1177f9599e67d73a7f474d25ad5d3ba053216b05cbf8539b2a", 346 | "sha256": "837aaf1b32879f1177f9599e67d73a7f474d25ad5d3ba053216b05cbf8539b2a" 347 | }, 348 | "arm64_monterey": { 349 | "cellar": ":any", 350 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:9a6e788f0a35d38ed325c7880e772775fe04c61e27c3506785ce10f6095ec891", 351 | "sha256": "9a6e788f0a35d38ed325c7880e772775fe04c61e27c3506785ce10f6095ec891" 352 | }, 353 | "sonoma": { 354 | "cellar": ":any", 355 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:35ee71e72b612f0cc7748ff0e58b4cdfeec0693c83df6f553d9be1160cc7ba74", 356 | "sha256": "35ee71e72b612f0cc7748ff0e58b4cdfeec0693c83df6f553d9be1160cc7ba74" 357 | }, 358 | "ventura": { 359 | "cellar": ":any", 360 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:42eaa5b6b69a460c31c859c44b263d651e649d6eae4478651b09e155a14faf64", 361 | "sha256": "42eaa5b6b69a460c31c859c44b263d651e649d6eae4478651b09e155a14faf64" 362 | }, 363 | "monterey": { 364 | "cellar": ":any", 365 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:69c2e49f5d8054e1d2efb6e77aa8f83183b6bcfd6470354da30a2bfb251edd00", 366 | "sha256": "69c2e49f5d8054e1d2efb6e77aa8f83183b6bcfd6470354da30a2bfb251edd00" 367 | }, 368 | "x86_64_linux": { 369 | "cellar": ":any_skip_relocation", 370 | "url": "https://ghcr.io/v2/homebrew/core/ripgrep/blobs/sha256:bf2810ab20dc5006c02d9ced344bb47f1c2e5770ae051c35f81faaa34fe48d9d", 371 | "sha256": "bf2810ab20dc5006c02d9ced344bb47f1c2e5770ae051c35f81faaa34fe48d9d" 372 | } 373 | } 374 | } 375 | }, 376 | "wget": { 377 | "version": "1.24.5", 378 | "bottle": { 379 | "rebuild": 0, 380 | "root_url": "https://ghcr.io/v2/homebrew/core", 381 | "files": { 382 | "arm64_sonoma": { 383 | "cellar": "/opt/homebrew/Cellar", 384 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:9befdad158e59763fb0622083974a6252878019702d8c961e1bec3a5f5305339", 385 | "sha256": "9befdad158e59763fb0622083974a6252878019702d8c961e1bec3a5f5305339" 386 | }, 387 | "arm64_ventura": { 388 | "cellar": "/opt/homebrew/Cellar", 389 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:ac4c0330b70dae06eaa8065bfbea78dda277699d1ae8002478017a1bd9cf1908", 390 | "sha256": "ac4c0330b70dae06eaa8065bfbea78dda277699d1ae8002478017a1bd9cf1908" 391 | }, 392 | "arm64_monterey": { 393 | "cellar": "/opt/homebrew/Cellar", 394 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:02313702fc03880f221d60ce4d0b652c8b44fe68c15609329d757d031bce6bc4", 395 | "sha256": "02313702fc03880f221d60ce4d0b652c8b44fe68c15609329d757d031bce6bc4" 396 | }, 397 | "sonoma": { 398 | "cellar": "/usr/local/Cellar", 399 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:034528edb247df85f90997aca6a51ddb988a880af6bb571b8473de1702a887af", 400 | "sha256": "034528edb247df85f90997aca6a51ddb988a880af6bb571b8473de1702a887af" 401 | }, 402 | "ventura": { 403 | "cellar": "/usr/local/Cellar", 404 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:1b7e2f76c90553543a5e25dadf031c6fcfe280f52bf27d89e04006f9d33fd20b", 405 | "sha256": "1b7e2f76c90553543a5e25dadf031c6fcfe280f52bf27d89e04006f9d33fd20b" 406 | }, 407 | "monterey": { 408 | "cellar": "/usr/local/Cellar", 409 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:ffc49a5064a003006e69f51434ac5f7ec4f4019c161ad32fab22c32697db61cd", 410 | "sha256": "ffc49a5064a003006e69f51434ac5f7ec4f4019c161ad32fab22c32697db61cd" 411 | }, 412 | "x86_64_linux": { 413 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 414 | "url": "https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:6a4642964fe5c4d1cc8cd3507541736d5b984e34a303a814ef550d4f2f8242f9", 415 | "sha256": "6a4642964fe5c4d1cc8cd3507541736d5b984e34a303a814ef550d4f2f8242f9" 416 | } 417 | } 418 | } 419 | }, 420 | "ffmpeg": { 421 | "version": "7.0.2", 422 | "bottle": { 423 | "rebuild": 0, 424 | "root_url": "https://ghcr.io/v2/homebrew/core", 425 | "files": { 426 | "arm64_sonoma": { 427 | "cellar": "/opt/homebrew/Cellar", 428 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:12453b675bcd28141bd0d477b74632ce63978ce479b12b608d73c8e64715c71a", 429 | "sha256": "12453b675bcd28141bd0d477b74632ce63978ce479b12b608d73c8e64715c71a" 430 | }, 431 | "arm64_ventura": { 432 | "cellar": "/opt/homebrew/Cellar", 433 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:1d3655a3c91864326096e1d0355ec26a6776211407b6f5a52586655f53deaaee", 434 | "sha256": "1d3655a3c91864326096e1d0355ec26a6776211407b6f5a52586655f53deaaee" 435 | }, 436 | "arm64_monterey": { 437 | "cellar": "/opt/homebrew/Cellar", 438 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:2f041128f269fe1cde5f44768767f65c1122290527180924dfedce1cc1b58aa1", 439 | "sha256": "2f041128f269fe1cde5f44768767f65c1122290527180924dfedce1cc1b58aa1" 440 | }, 441 | "sonoma": { 442 | "cellar": "/usr/local/Cellar", 443 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:33142c5d64d0d6e94b60229b82f579471ba0dec41ada383a6bbd27096f068f29", 444 | "sha256": "33142c5d64d0d6e94b60229b82f579471ba0dec41ada383a6bbd27096f068f29" 445 | }, 446 | "ventura": { 447 | "cellar": "/usr/local/Cellar", 448 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:6734844e0dc20f5c6ffe31e254e2ff1aa5a632e20d9352d50c01ce5ef3e16e32", 449 | "sha256": "6734844e0dc20f5c6ffe31e254e2ff1aa5a632e20d9352d50c01ce5ef3e16e32" 450 | }, 451 | "monterey": { 452 | "cellar": "/usr/local/Cellar", 453 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:c24108f419dcf6d79c66452d2b077bb462bc86981d19ebb01c4b3cc30eba9ec3", 454 | "sha256": "c24108f419dcf6d79c66452d2b077bb462bc86981d19ebb01c4b3cc30eba9ec3" 455 | }, 456 | "x86_64_linux": { 457 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 458 | "url": "https://ghcr.io/v2/homebrew/core/ffmpeg/blobs/sha256:02db2ef7802be1b309ac919af2f5a48a1daf55d5ee1adacbfeb469734a40265a", 459 | "sha256": "02db2ef7802be1b309ac919af2f5a48a1daf55d5ee1adacbfeb469734a40265a" 460 | } 461 | } 462 | } 463 | }, 464 | "python": { 465 | "version": "3.12.5", 466 | "bottle": { 467 | "rebuild": 0, 468 | "root_url": "https://ghcr.io/v2/homebrew/core", 469 | "files": { 470 | "arm64_sonoma": { 471 | "cellar": "/opt/homebrew/Cellar", 472 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:b0ff9819a9f471ac30796037098acdc318883b1a8fdfb4f9b9926590eace41dd", 473 | "sha256": "b0ff9819a9f471ac30796037098acdc318883b1a8fdfb4f9b9926590eace41dd" 474 | }, 475 | "arm64_ventura": { 476 | "cellar": "/opt/homebrew/Cellar", 477 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:46bfedee260602e564ba4da5551a676c7c4c5605357c79183f2da0855f81fac5", 478 | "sha256": "46bfedee260602e564ba4da5551a676c7c4c5605357c79183f2da0855f81fac5" 479 | }, 480 | "arm64_monterey": { 481 | "cellar": "/opt/homebrew/Cellar", 482 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:a8cbb6621923a75a61511d6478ae231ed4f56f703b9f244bfb9d5d6ec45d5b14", 483 | "sha256": "a8cbb6621923a75a61511d6478ae231ed4f56f703b9f244bfb9d5d6ec45d5b14" 484 | }, 485 | "sonoma": { 486 | "cellar": "/usr/local/Cellar", 487 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:9f9356133056b279b4dc874b44ccade6690f07d8dcbe8bc387b2158f9218a78e", 488 | "sha256": "9f9356133056b279b4dc874b44ccade6690f07d8dcbe8bc387b2158f9218a78e" 489 | }, 490 | "ventura": { 491 | "cellar": "/usr/local/Cellar", 492 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:af7af812d9b66eddb1164ff90a0851da6658516b04746abee8c44d953dc8bc8e", 493 | "sha256": "af7af812d9b66eddb1164ff90a0851da6658516b04746abee8c44d953dc8bc8e" 494 | }, 495 | "monterey": { 496 | "cellar": "/usr/local/Cellar", 497 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:26ab776eaefe245d630a22bd358c7422af2ae65afe6623f7ec4b9c64fc986b84", 498 | "sha256": "26ab776eaefe245d630a22bd358c7422af2ae65afe6623f7ec4b9c64fc986b84" 499 | }, 500 | "x86_64_linux": { 501 | "cellar": "/home/linuxbrew/.linuxbrew/Cellar", 502 | "url": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:44f7dd6260f4e4d3e802e55b8226e498c0c9949ac48eb0ba7c04b13a179ce9f1", 503 | "sha256": "44f7dd6260f4e4d3e802e55b8226e498c0c9949ac48eb0ba7c04b13a179ce9f1" 504 | } 505 | } 506 | } 507 | }, 508 | "cloc": { 509 | "version": "2.02", 510 | "bottle": { 511 | "rebuild": 0, 512 | "root_url": "https://ghcr.io/v2/homebrew/core", 513 | "files": { 514 | "arm64_sonoma": { 515 | "cellar": ":any_skip_relocation", 516 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:d5c78fcf0db5b52e2909c757749f4c540f91c00d9acc539500d0497a42c0ecc5", 517 | "sha256": "d5c78fcf0db5b52e2909c757749f4c540f91c00d9acc539500d0497a42c0ecc5" 518 | }, 519 | "arm64_ventura": { 520 | "cellar": ":any_skip_relocation", 521 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:fc419786fe93816ad32d5c9cb1ca8b9b746312561e63da3cb8ae023df4a6d863", 522 | "sha256": "fc419786fe93816ad32d5c9cb1ca8b9b746312561e63da3cb8ae023df4a6d863" 523 | }, 524 | "arm64_monterey": { 525 | "cellar": ":any_skip_relocation", 526 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:fc419786fe93816ad32d5c9cb1ca8b9b746312561e63da3cb8ae023df4a6d863", 527 | "sha256": "fc419786fe93816ad32d5c9cb1ca8b9b746312561e63da3cb8ae023df4a6d863" 528 | }, 529 | "sonoma": { 530 | "cellar": ":any_skip_relocation", 531 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:2c80b3d16087ac35012b01041cae6d3559b5c986fc462b147311fac34b1f67d9", 532 | "sha256": "2c80b3d16087ac35012b01041cae6d3559b5c986fc462b147311fac34b1f67d9" 533 | }, 534 | "ventura": { 535 | "cellar": ":any_skip_relocation", 536 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:ab94f03bef5f9bd5c921e6c31d50cba4d5c0c94447b82b7d36f04117beac363d", 537 | "sha256": "ab94f03bef5f9bd5c921e6c31d50cba4d5c0c94447b82b7d36f04117beac363d" 538 | }, 539 | "monterey": { 540 | "cellar": ":any_skip_relocation", 541 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:ab94f03bef5f9bd5c921e6c31d50cba4d5c0c94447b82b7d36f04117beac363d", 542 | "sha256": "ab94f03bef5f9bd5c921e6c31d50cba4d5c0c94447b82b7d36f04117beac363d" 543 | }, 544 | "x86_64_linux": { 545 | "cellar": ":any_skip_relocation", 546 | "url": "https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:70d559760697510aa1b248cd8ba072bcaac08f46230c2b24f7f16fe2de015163", 547 | "sha256": "70d559760697510aa1b248cd8ba072bcaac08f46230c2b24f7f16fe2de015163" 548 | } 549 | } 550 | } 551 | } 552 | } 553 | }, 554 | "system": { 555 | "macos": { 556 | "big_sur": { 557 | "HOMEBREW_VERSION": "3.0.11", 558 | "HOMEBREW_PREFIX": "/opt/homebrew", 559 | "Homebrew/homebrew-core": "e70ef73f0b663d3fba3d208412c608817cff259a", 560 | "CLT": "12.4.0.0.1.1610135815", 561 | "Xcode": "12.4", 562 | "macOS": "11.2.2" 563 | }, 564 | "sonoma": { 565 | "HOMEBREW_VERSION": "4.3.19", 566 | "HOMEBREW_PREFIX": "/opt/homebrew", 567 | "Homebrew/homebrew-core": "api", 568 | "CLT": "15.3.0.0.1.1708646388", 569 | "Xcode": "15.4", 570 | "macOS": "14.5" 571 | } 572 | } 573 | } 574 | } 575 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # [fresh] ~/.dotfiles 2 | 3 | ## Installation 4 | 5 | ``` sh 6 | FRESH_LOCAL_SOURCE=twe4ked/dotfiles bash -c "`curl -sL get.freshshell.com`" 7 | chsh -s /bin/zsh # Default on MacOS 8 | ``` 9 | 10 | My dotfiles are managed by [fresh]. 11 | 12 | [fresh]: https://github.com/freshshell/fresh 13 | 14 | ## Extras 15 | 16 | ``` 17 | # Homebrew 18 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 19 | brew bundle 20 | 21 | # Git config 22 | git config -f ~/.gitconfig.local user.name "Odin Dutton" 23 | git config -f ~/.gitconfig.local user.email "odindutton@gmail.com" 24 | ``` 25 | 26 | ## TODO 27 | 28 | - https://github.com/sdt/tmux-vim 29 | - Add supertap, see jasoncodes vim completion file (` ` inserts an actual tab) 30 | - fresh jasoncodes/dotfiles vim/config/completion.vim 31 | - http://brettterpstra.com/2016/09/29/a-better-hyper-key-hack-for-sierra/ 32 | - https://github.com/junegunn/vim-plug#on-demand-loading-of-plugins 33 | - https://github.com/benvan/sandboxd 34 | - https://kev.inburke.com/kevin/profiling-zsh-startup-time/ 35 | - https://github.com/bjeanes/dot-files/commit/cfda3f3e982ef51463b4aaf3625849a62478d8a6 36 | - https://github.com/grassdog/tagman.vim 37 | - https://github.com/unixorn/git-extra-commands 38 | - https://jvns.ca/blog/2024/02/16/popular-git-config-options/#config-changes-i-ve-made-after-writing-this-post 39 | 40 | ## Notes 41 | 42 | Use an & to in Vim substitutions: 43 | 44 | :%s/foo_bar/&_baz/g 45 | 46 | defaults write .GlobalPreferences com.apple.sound.beep.sound /Users/odin/Music/silent.aiff 47 | https://github.com/jasoncodes/dotfiles/commit/2c080abcbf328939289f3183a7c59c04096da0b0 48 | -------------------------------------------------------------------------------- /bin/+x: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec chmod +x "$@" 4 | -------------------------------------------------------------------------------- /bin/add-keys: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [[ -n "$1" ]]; then 4 | TMP_FILE=/tmp/add-keys.$$ 5 | if ! curl -s -f "https://github.com/$1.keys" > "$TMP_FILE"; then 6 | echo an error occured, was the github username typed correctly? >&2 7 | rm -f "$TMP_FILE" 8 | exit 1 9 | else 10 | echo >> "$TMP_FILE" 11 | mkdir -p ~/.ssh 12 | sed "s/$/ $1/" < "$TMP_FILE" >> ~/.ssh/authorized_keys 13 | rm -f "$TMP_FILE" 14 | echo "keys successfully added to ~/.ssh/authorized_keys" 15 | fi 16 | else 17 | echo "usage: $(basename "$0") [github username]" >&2 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /bin/adr-new: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'erb' 4 | require 'date' 5 | 6 | title = ARGV[0] 7 | path = ARGV[1] 8 | 9 | abort "usage: #{File.basename($0)} title [path]" if !title || ARGV[2] 10 | 11 | begin 12 | path ||= File.read('.adr-dir').chomp 13 | rescue 14 | end 15 | path ||= '.' 16 | 17 | n = Dir[File.join(path, '*.md')].map { |path| path[/\d{4}/].to_i }.max.to_i + 1 18 | 19 | path = File.join(path, "%04d-#{title.downcase.strip.gsub(/[^a-z0-9]+/, '-')}.md") % n 20 | 21 | abort "#{path} already exists" if File.exists?(path) 22 | 23 | File.open(path, 'w') do |f| 24 | f.write ERB.new(DATA.read).result 25 | end 26 | 27 | puts path 28 | 29 | __END__ 30 | # <%= n %>. <%= title %> 31 | 32 | Date: <%= Date.today.iso8601 %> 33 | 34 | ## Status 35 | 36 | Accepted 37 | 38 | ## Context 39 | 40 | > The issue motivating this decision, and any context that influences or constrains the decision. 41 | 42 | ## Decision 43 | 44 | > The change that we're proposing or have agreed to implement. 45 | 46 | ## Consequences 47 | 48 | > What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated. 49 | -------------------------------------------------------------------------------- /bin/afro: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # permission... perm... afro... 4 | 5 | class Afro 6 | def initialize(permission_string) 7 | @permission_string = permission_string 8 | end 9 | 10 | def self.run permission_string 11 | afro = self.new permission_string 12 | afro.run 13 | end 14 | 15 | def run 16 | result = 0 17 | @permission_string[1..-1].chars.each_slice(3).each_with_index do |set, index| 18 | multiplier = { 19 | 0 => 100, 20 | 1 => 10, 21 | 2 => 1}.fetch(index) 22 | 23 | set.each do |char| 24 | num = { 25 | "r" => 4, 26 | "w" => 2, 27 | "x" => 1, 28 | }.fetch(char, 0) 29 | result = result + num * multiplier 30 | end 31 | end 32 | result 33 | end 34 | end 35 | 36 | if ARGV.count != 1 37 | abort <<-EOF 38 | usage: #{File.basename(__FILE__)} permission_string 39 | 40 | example: 41 | 42 | $ #{File.basename(__FILE__)} -rw-r--r-- 43 | 644 44 | EOF 45 | end 46 | 47 | if ARGV[0] == "--run-tests" 48 | [ 49 | Afro.run("-rw-r--r--") == 644, 50 | Afro.run("-rw-------") == 600, 51 | Afro.run("-rwxr-xr-x") == 755, 52 | Afro.run("-rwxrwxrwx") == 777, 53 | ].uniq == [true] || abort('tests failed') 54 | else 55 | puts Afro.run(ARGV[0]) 56 | end 57 | -------------------------------------------------------------------------------- /bin/anybar-internet: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # Put the following in `~/Library/LaunchAgents/com.twe4ked.anybar-internet.plist'. 4 | # 5 | # 6 | # 7 | # 8 | # 9 | # Label 10 | # com.twe4ked.anybar-internet 11 | # Program 12 | # /Users/odin/bin/anybar-internet 13 | # KeepAlive 14 | # 15 | # 16 | # 17 | 18 | quit() { 19 | echo -n question | $ANYBAR 20 | exit 21 | } 22 | 23 | trap quit EXIT 24 | 25 | ANYBAR="nc -4u -w0 localhost 1738" 26 | 27 | while true; do 28 | if ping -c 5 -t 5 -o 8.8.8.8 &> /dev/null; then 29 | echo -n black | $ANYBAR 30 | sleep 5 31 | else 32 | echo -n red | $ANYBAR 33 | fi 34 | done 35 | -------------------------------------------------------------------------------- /bin/bak: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Move file .bak or from .bak or copy file 4 | 5 | if [[ $1 == "-c" ]]; then 6 | CMD=cp 7 | shift 8 | else 9 | CMD=mv 10 | fi 11 | 12 | if [[ $# == 0 ]]; then 13 | echo "usage: $(basename "$0") [-c] file ..." >&2 14 | exit 1 15 | fi 16 | 17 | for FILE in "$@"; do 18 | if [[ "$FILE" =~ .bak$ ]]; then 19 | "$CMD" "$FILE" "$(echo "$FILE" | sed 's/\.bak$//')" 20 | else 21 | "$CMD" "$FILE" "$FILE.bak" 22 | fi 23 | done 24 | -------------------------------------------------------------------------------- /bin/build_status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Create a `.build_status` file in your home directory 4 | # with the following information: 5 | # 6 | # url: http:///view//api/json 7 | # username: 8 | # password: 9 | 10 | require 'httparty' 11 | require 'json' 12 | require 'yaml' 13 | 14 | begin 15 | config = YAML.load_file(File.expand_path('~/.build_status')) 16 | rescue Errno::ENOENT 17 | abort "Missing config file, \`cat #{__FILE__}\` for more info." 18 | end 19 | 20 | begin 21 | response = HTTParty.get(config['url'], :basic_auth => {:username => config['username'], :password => config['password']}) 22 | rescue URI::InvalidURIError 23 | abort "Invalid url specified in config file, \`cat #{__FILE__}\` for more info." 24 | end 25 | 26 | begin 27 | json = JSON.parse(response.body)['jobs'] 28 | rescue JSON::ParserError 29 | abort "Invalid response, is your username/password correct in your config file? \`cat #{__FILE__}\` for more info." 30 | end 31 | 32 | def status(state) 33 | case state 34 | when 'blue' 35 | '.' 36 | when 'red' 37 | 'F' 38 | when /anime/ 39 | 'B' 40 | when 'aborted' 41 | 'A' 42 | end 43 | end 44 | 45 | json.each do |job| 46 | next if ARGV.map { |arg| !!(job['name'] =~ /#{arg}/) }.include? false 47 | puts "#{status(job['color']) || '?'} #{job['name']} - <#{job['url']}lastBuild>" 48 | end 49 | -------------------------------------------------------------------------------- /bin/date-iso: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | _help() { 4 | echo "usage: $(basename "$0") [--touch-markdown]" >&2 5 | } 6 | 7 | _date_iso() { 8 | date "+%Y-%m-%d" 9 | } 10 | 11 | 12 | if [[ $# -gt 1 ]]; then 13 | _help 14 | exit 1 15 | fi 16 | 17 | if [[ "$1" == *-h* ]]; then 18 | _help 19 | exit 0 20 | fi 21 | 22 | if [[ "$1" == "--touch-markdown" ]]; then 23 | bash -cx "touch "$(set +x; _date_iso).markdown"" 24 | else 25 | _date_iso 26 | fi 27 | -------------------------------------------------------------------------------- /bin/desktop-images-to-funny: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # Move all images from the desktop to funny folder 4 | 5 | find ~/Desktop \( -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' \) -print0 | 6 | xargs -0 -J % mv -i % ~/Pictures/Funny/ 7 | -------------------------------------------------------------------------------- /bin/fresh-convert: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # example usage: 4 | # 5 | # fresh-convert https://github.com/twe4ked/dotfiles/blob/master/bin/fresh-convert --bin 6 | 7 | if [[ -z "$1" ]]; then 8 | echo "usage: fresh convert [GitHub URL] [fresh options]" >&2 9 | exit 1 10 | fi 11 | 12 | fresh_line="$(echo "$1" | sed -e 's#^https://github.com/#fresh #' -e 's#/blob/master/# #')" 13 | 14 | shift 15 | 16 | for arg in "$@"; do 17 | fresh_line="$fresh_line $arg" 18 | done 19 | 20 | $fresh_line 21 | -------------------------------------------------------------------------------- /bin/gbrt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | format = "%(HEAD) | %(refname:short) | %(objectname:short) | %(upstream:trackshort) | %(committerdate:relative) | %(subject)" 4 | output = `git for-each-ref --sort=-committerdate refs/heads/ --format='#{format}'` 5 | 6 | merged_branches = `git branch --merged master --format='%(refname:short)'`.split("\n") - %w[master] 7 | 8 | output.split("\n").map { |l| 9 | l.split(" | ") 10 | }.transpose.map {|column| 11 | max_col_length = column.sort_by {|i| i.length }.last.length 12 | column.map {|i| i.ljust(max_col_length) } 13 | }.transpose.each { |current, branch_name, sha, status, timestamp, commit_message| 14 | background = "\e[48;5;#{branch_name[/^master\s*$/i] ? 235 : 0}m" 15 | merged = merged_branches.include?(branch_name.strip) 16 | 17 | puts [ 18 | background, 19 | timestamp, 20 | current, 21 | "\e[32m#{branch_name}\e[0m#{background}", 22 | (merged ? "#{status} #{sha}" : "#{status} \e[33m#{sha}\e[0m#{background}"), 23 | "\e[#{commit_message[/^temp|^wip/i] ? 31 : 90}m#{commit_message.strip}\e[0m", 24 | ].join(" ") 25 | } 26 | -------------------------------------------------------------------------------- /bin/ghu: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | function ghu() { 4 | local URL="https://$(git config remote.origin.url | sed 's/\.git//' | sed 's/https:\/\///' | sed 's/git:\/\///' | sed 's/git@//' | tr ':' '/')" 5 | 6 | case "$1" in 7 | "") 8 | URL="$URL" 9 | ;; 10 | i|issues|-i|--issues) 11 | URL="$URL/issues" 12 | _append_id "$@" 13 | ;; 14 | p|pulls|-p|--pulls) 15 | URL="$URL/pulls" 16 | _append_id "$@" 17 | ;; 18 | w|wiki|-w|--wiki) 19 | URL="$URL/wiki" 20 | ;; 21 | *) 22 | cat <] [] 24 | 25 | The following commands are performed on the current project. 26 | 27 | Available commands: 28 | 29 | -i --issues [] Open issues, optionally pass a number to open a specific issue 30 | -p --pulls [] Open pull requests, optionally pass a number to open a specific pull request 31 | -w --wiki Open wiki 32 | 33 | When no argument is supplied the main project page will be opened. 34 | EOF 35 | exit 1 36 | ;; 37 | esac 38 | 39 | open "$URL" 40 | } 41 | 42 | _append_id() { 43 | if [[ -n $2 ]]; then 44 | URL="$URL/$2" 45 | fi 46 | } 47 | 48 | ghu "$@" 49 | -------------------------------------------------------------------------------- /bin/git-author: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # displays the git author 4 | # returns 1 if different from the one set in the git config 5 | 6 | _git_author_environment_variables() { 7 | if [[ -n "$GIT_AUTHOR_NAME" && -n "$GIT_AUTHOR_EMAIL" ]]; then 8 | echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" 9 | fi 10 | } 11 | 12 | _git_author_config_file() { 13 | echo "$(git config --get user.name) <$(git config --get user.email)>" 14 | } 15 | 16 | _git_author() { 17 | if [[ -n "$(_git_author_environment_variables)" ]]; then 18 | _git_author_environment_variables 19 | else 20 | _git_author_config_file 21 | fi 22 | } 23 | 24 | _git_author 25 | [[ "$(_git_author)" == "$(_git_author_config_file)" ]] 26 | -------------------------------------------------------------------------------- /bin/git-files-modified-on-branch: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | git_root="$(git rev-parse --show-toplevel)" 4 | wd=$PWD 5 | 6 | ( 7 | cd "$git_root" && while IFS= read -r file; do 8 | absolute_path="${git_root}/${file}" 9 | echo "${absolute_path#$wd/}" 10 | done < <(git diff "$(git merge-base origin/HEAD HEAD).." --name-only | sort -u | xargs find 2> /dev/null) 11 | ) 12 | -------------------------------------------------------------------------------- /bin/git-github-url: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [[ "$#" -gt 2 ]] || [[ "$1" = "--help" ]]; then 4 | echo "usage: $(basename "$0") [line] [number]" >&2 5 | exit 1 6 | fi 7 | 8 | REMOTE="$(git config --get remote.origin.url)" 9 | 10 | if [[ "$REMOTE" = *github* ]]; then 11 | URL="$(echo "$REMOTE" | sed -E 's/.+:(.+)\.git$/https:\/\/github\.com\/\1/g')" 12 | if [[ -n "$1" ]]; then 13 | FILE="/blob/$(git rev-parse --abbrev-ref HEAD)/$1" 14 | fi 15 | if [[ -n "$2" ]]; then 16 | LINE="#L$2" 17 | fi 18 | echo "$URL$FILE$LINE" 19 | else 20 | echo "not a GitHub remote" 21 | exit 1 22 | fi 23 | -------------------------------------------------------------------------------- /bin/git-last-commit-message: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # Git commit Vim usage: 4 | # 5 | # :read !git-last-commit-message 6 | 7 | git log -1 --pretty=format:%s 8 | -------------------------------------------------------------------------------- /bin/git-rm-tag: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [[ $# -ne 1 ]] || [[ -z "$1" ]]; then 4 | echo "usage: $(basename "$0") [tag]" >&2 5 | exit 1 6 | fi 7 | 8 | git tag -d "$1" 9 | echo "git push origin :refs/tags/$1" 10 | -------------------------------------------------------------------------------- /bin/git-rm-untracked: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | git status --porcelain --untracked-files=all | grep "??" | cut -d" " -f 2 | xargs rm 4 | -------------------------------------------------------------------------------- /bin/git-swap-latest: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ -n "$(git status --porcelain)" ]; then 4 | echo "There are local changes, \`git stash\` first." 5 | else 6 | GIT_SEQUENCE_EDITOR='vim -c "normal ggddp" -c "wqa"' git rebase -i HEAD~2 7 | fi 8 | -------------------------------------------------------------------------------- /bin/git-time-spent: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Lazy sources: 4 | # 5 | # - https://stackoverflow.com/a/6018744 6 | # - https://stackoverflow.com/a/4179491 7 | 8 | require 'time' 9 | require 'open3' 10 | 11 | def ranges_overlap?(a, b) 12 | a.include?(b.begin) || b.include?(a.begin) 13 | end 14 | 15 | def merge_ranges(a, b) 16 | [a.begin, b.begin].min..[a.end, b.end].max 17 | end 18 | 19 | def merge_overlapping_ranges(overlapping_ranges) 20 | overlapping_ranges.sort_by(&:begin).inject([]) do |ranges, range| 21 | if !ranges.empty? && ranges_overlap?(ranges.last, range) 22 | ranges[0...-1] + [merge_ranges(ranges.last, range)] 23 | else 24 | ranges + [range] 25 | end 26 | end 27 | end 28 | 29 | def format_duration(range) 30 | (Time.mktime(0) + (range.end - range.begin)).strftime("%H:%M:%S") 31 | end 32 | 33 | # Find all timestamps in the git log 34 | _stdin, stdout, _stderr = Open3.popen3("git", "log", "--format='format:%ai'", *ARGV) 35 | 36 | # Pad them out to 30 minute ranges. 37 | # 38 | # This means that our calculations will assume you worked for 15 minutes before 39 | # your first commit and 15 minutes after your last commit in a given session. 40 | # 41 | # A session is defined where the ranges overlap, so minimum of 30 minutes 42 | # between a commit. 43 | ranges_padded_to_30_mins = stdout.each_line.map { |line| t = Time.parse(line); (t - 60 * 15)..(t + 60 * 15) } 44 | 45 | # Merge into sessions and print out the duration of each session. 46 | merge_overlapping_ranges(ranges_padded_to_30_mins).each_with_index do |range, i| 47 | puts 'Session %04i (%s - %s): %s' % [ 48 | i + 1, 49 | range.begin.to_date.to_s, 50 | range.end.to_date.to_s, 51 | format_duration(range), 52 | ] 53 | end 54 | -------------------------------------------------------------------------------- /bin/heroku-remote-add: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [[ $# -ne 1 ]] || [[ -z "$1" ]]; then 4 | echo "usage: $(basename "$0") [heroku app name]" >&2 5 | exit 1 6 | fi 7 | 8 | git remote add "$1" "git@heroku.com:$1.git" 9 | -------------------------------------------------------------------------------- /bin/hex_to_uicolor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | def convert(color) 4 | hex_color = color.gsub("#", "") 5 | case hex_color.size 6 | when 3 7 | colors = hex_color.scan(%r{[0-9A-Fa-f]}).map{ |el| (el * 2).to_i(16) } 8 | when 6 9 | colors = hex_color.scan(%r<[0-9A-Fa-f]{2}>).map{ |el| el.to_i(16) } 10 | else 11 | raise ArgumentError 12 | end 13 | if colors.size == 3 14 | "UIColor(red: #{(colors[0]/255.0)}, green: #{(colors[1]/255.0)}, blue: #{(colors[2]/255.0)}, alpha: 1)" 15 | else 16 | raise ArgumentError 17 | end 18 | end 19 | 20 | if ARGV.size == 1 21 | puts convert(ARGV[0]) 22 | end 23 | -------------------------------------------------------------------------------- /bin/keypad: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | input = ARGV[0] 4 | 5 | help = "usage: #$0 [input]" 6 | 7 | unless input 8 | abort help 9 | end 10 | 11 | if %w[--help -h].include? input 12 | puts help 13 | exit 14 | end 15 | 16 | output = [] 17 | 18 | input.chars.each do |char| 19 | output << case char 20 | when /[abc]/i 21 | 2 22 | when /[def]/i 23 | 3 24 | when /[ghi]/i 25 | 4 26 | when /[jkl]/i 27 | 5 28 | when /[mno]/i 29 | 6 30 | when /[pqrs]/i 31 | 7 32 | when /[tuv]/i 33 | 8 34 | when /[wxyz]/i 35 | 9 36 | else 37 | char 38 | end 39 | end 40 | 41 | puts output.join 42 | -------------------------------------------------------------------------------- /bin/open-urls: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | while read LINE; do 4 | echo "$LINE" 5 | echo "$LINE" | 6 | perl -pe 's/\e\[?.*?[\@-~]//g' | 7 | tr "<>\"'" '\n\n\n\n' | 8 | egrep -oi 'https?://[^ ]+' | 9 | xargs --no-run-if-empty open 10 | done 11 | -------------------------------------------------------------------------------- /bin/osx-defaults: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | defaults write com.apple.screencapture disable-shadow -bool true 4 | defaults write com.apple.screencapture location ~/Pictures/Screenshots 5 | 6 | killall SystemUIServer 7 | -------------------------------------------------------------------------------- /bin/plot_coconut_battery: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | FILE="$HOME/Documents/coconutBattery" 4 | MAX_LOADCYCLES="$(tail -n 1 "${FILE}.csv" | cut -d',' -f 3)" 5 | 6 | gnuplot < "${FILE}.png" 7 | reset 8 | set datafile separator "," 9 | 10 | set terminal png medium 11 | set title "coconutBattery" 12 | set xlabel "Loadcycles" 13 | set ylabel "Capacity (mAh)" 14 | set grid 15 | set key off 16 | 17 | design_capacity = 6330 18 | set arrow from 0,design_capacity to $MAX_LOADCYCLES,design_capacity nohead linetype 1 19 | 20 | plot "${FILE}.csv" using 3:2 with lines linetype 20 21 | EOF 22 | 23 | echo "${FILE}.png" 24 | -------------------------------------------------------------------------------- /bin/psg: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # See what's running or kill it. 4 | 5 | if [[ -z "$1" ]]; then 6 | echo "usage: $(basename "$0") [pattern] [-k]" >&2 7 | exit 1 8 | fi 9 | 10 | _kill=false 11 | index=0 12 | parms=("$@") 13 | for arg in "$@"; do 14 | if [[ "$arg" == "-k" || "$arg" == "--kill" ]]; then 15 | unset parms[$index] 16 | set -- "${parms[@]}" 17 | _kill=true 18 | fi 19 | let "index+=1" 20 | done 21 | 22 | 23 | if $_kill; then 24 | pkill -fli "$@" 25 | else 26 | pgrep -fli "$@" 27 | fi 28 | -------------------------------------------------------------------------------- /bin/rubygems-github-urls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | begin 4 | require 'gems' 5 | rescue LoadError 6 | abort <<-EOF 7 | The "gems" gem is missing and must be installed. 8 | 9 | gem install gems 10 | EOF 11 | end 12 | 13 | abort "usage: ruby #{File.basename($0)} [gem name]" if ARGV.size != 1 14 | 15 | info = Gems.info(ARGV[0]) 16 | 17 | abort info unless info.is_a?(Hash) 18 | 19 | urls = info.select { |key,value| key =~ /_uri/ && value =~ %r{^https?://github.com/[^/]+/[^/]+$} }.values 20 | 21 | abort 'No GitHub URLs were found.' if urls.empty? 22 | 23 | urls.uniq.each do |url| 24 | puts url 25 | end 26 | -------------------------------------------------------------------------------- /bin/shorten: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env ruby 2 | # 3 | # Shorten a URL at on.odin.bz 4 | # 5 | # USAGE: 6 | # 7 | # $ shorten http://google.com 8 | # # => http://on.odin.bz/afno21r 9 | # 10 | # $ shorten http://google.com google 11 | # # => http://on.odin.bz/google 12 | # 13 | # AUTHOR: 14 | # 15 | # Parker Moore (@parkr) 16 | 17 | ARGV.empty? && abort('Provide the URL at least. Gosh.') 18 | 19 | HOST = ENV['SHORTEN_HOST'] || 'http://on.odin.bz' 20 | 21 | args = ['url', 'code'].zip(ARGV) 22 | args.reject! { |_, v| v.nil? || v.empty? } 23 | curl_args = args.map { |pair| %Q{-F "#{pair.join('=')}"} }.join(' ') 24 | 25 | response = `curl #{HOST} -si #{curl_args}` 26 | match_data = /^Location:\s+(.+)$/.match(response) 27 | 28 | if match_data && match_data[1] 29 | puts match_data[1].strip 30 | else 31 | puts response 32 | abort 'WHOA I GOT NOTHING' 33 | end 34 | -------------------------------------------------------------------------------- /bin/skype-search: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | gem 'sqlite3', '~> 1.3.0' 4 | gem 'nokogiri', '~> 1.5.0' 5 | 6 | require 'sqlite3' 7 | require 'nokogiri' 8 | 9 | class Message 10 | attr_reader :body, :username, :conversation_id 11 | 12 | def initialize(message) 13 | @body = strip_html message[0] 14 | @username = message[1] 15 | @conversation_id = message[2] 16 | end 17 | 18 | private 19 | 20 | def strip_html(string) 21 | Nokogiri::HTML.fragment(string).text 22 | end 23 | end 24 | 25 | def word_wrap(text, *args) 26 | line_width = 70 27 | text.split("\n").collect do |line| 28 | line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line 29 | end * "\n" 30 | end 31 | 32 | abort 'usage: skype-search ' unless ARGV[0] 33 | 34 | database_files = Dir["#{Dir.home}/Library/Application\ Support/Skype/*/main.db"] 35 | 36 | if database_files.count > 1 37 | abort 'Multiple database files found' 38 | else 39 | database = SQLite3::Database.new database_files.first 40 | end 41 | 42 | results = database.execute "SELECT body_xml, from_dispname, convo_id FROM Messages WHERE body_xml LIKE '%#{SQLite3::Database.quote ARGV[0]}%';" 43 | results = results[0..999] 44 | 45 | results.each_with_index do |result, index| 46 | message = Message.new(result) 47 | thread_name = database.execute("SELECT displayname FROM Conversations WHERE id = #{message.conversation_id}").flatten.first 48 | 49 | green_start = "\e[1;32m" 50 | grey_start = "\e[1;30m" 51 | color_end = "\e[0m" 52 | 53 | lines = [] 54 | lines << green_start + message.username + color_end + grey_start + ' (' + thread_name + ')' + color_end 55 | lines << word_wrap(message.body) 56 | lines << "" unless (results.count - 1) == index 57 | 58 | lines.each do |line| 59 | puts line 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /bin/squash-whitespace: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Squashes extra whitespace between columns. 4 | # 5 | # If you `grep` a large amount of columned text you will often end up with extra 6 | # unwanted space between the columns. Add this to your pipeline to squash space. 7 | 8 | cat | sed -E 's/[[:space:]]+/‽/g' | column -t -s ‽ 9 | -------------------------------------------------------------------------------- /bin/tor-proxy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$1" == --help ]]; then 4 | cat >&2 <" >&2 5 | exit 1 6 | fi 7 | 8 | ssh "wemux@$1" 9 | -------------------------------------------------------------------------------- /bin/whiteboard-clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # https://gist.github.com/lelandbatey/8677901 4 | 5 | if [[ $# -ne 2 ]] || [[ -z "$1" ]]; then 6 | echo "usage: $(basename "$0") input output" >&2 7 | exit 1 8 | fi 9 | 10 | convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2 11 | -------------------------------------------------------------------------------- /bin/xcode: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ -e *.xcworkspace ]; then 4 | open *.xcworkspace 5 | elif [ -e *.xcodeproj ]; then 6 | open *.xcodeproj 7 | else 8 | echo No Xcode project found 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /bin/zsh_profile_sort_timings: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # 3 | # https://esham.io/2018/02/zsh-profiling 4 | 5 | typeset -a lines 6 | typeset -i prev_time=0 7 | typeset prev_command 8 | 9 | while read line; do 10 | if [[ $line =~ '^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.+)' ]]; then 11 | integer this_time=$match[1]$match[2] 12 | 13 | if [[ $prev_time -gt 0 ]]; then 14 | time_difference=$(( $this_time - $prev_time )) 15 | lines+="$time_difference $prev_command" 16 | fi 17 | 18 | prev_time=$this_time 19 | 20 | local this_command=$match[3] 21 | if [[ ${#this_command} -le 80 ]]; then 22 | prev_command=$this_command 23 | else 24 | prev_command="${this_command:0:77}..." 25 | fi 26 | fi 27 | done < ${1:-/dev/stdin} 28 | 29 | print -l ${(@On)lines} 30 | -------------------------------------------------------------------------------- /config/ackrc: -------------------------------------------------------------------------------- 1 | --sort-files 2 | --color 3 | --context=1 4 | --follow 5 | --group 6 | --type-add=ruby=.haml,.feature,.ru 7 | --type-add=css=.sass,.scss 8 | --type-set=markdown=.markdown,.mdown,.md 9 | --type-add=objc=.pch 10 | --type-set=xcode=.pbxproj,.pbxuser,.perspectivev3 11 | --type-set=ragel=.rl 12 | --type-set=nib=.xib 13 | --type-set=plist=.plist 14 | --type-set=tmstuff=.tmproj,.tm_build_errors 15 | --type-set=javascript=.coffee 16 | --nonib 17 | --notmstuff 18 | --noxcode 19 | --ignore-dir=log 20 | --ignore-dir=tmp 21 | --ignore-dir=vendor/bundle 22 | --ignore-dir=.bundle 23 | --ignore-dir=results 24 | --ignore-dir=coverage 25 | --ignore-dir=_site 26 | --smart-case 27 | -------------------------------------------------------------------------------- /config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | # Configuration for Alacritty, the GPU enhanced terminal emulator. 2 | 3 | # Any items in the `env` entry below will be added as 4 | # environment variables. Some entries may override variables 5 | # set by alacritty itself. 6 | #env: 7 | # TERM variable 8 | # 9 | # This value is used to set the `$TERM` environment variable for 10 | # each instance of Alacritty. If it is not present, alacritty will 11 | # check the local terminfo database and use `alacritty` if it is 12 | # available, otherwise `xterm-256color` is used. 13 | #TERM: xterm-256color 14 | 15 | window: 16 | # Window dimensions (changes require restart) 17 | # 18 | # Specified in number of columns/lines, not pixels. 19 | # If both are `0`, this setting is ignored. 20 | dimensions: 21 | columns: 0 22 | lines: 0 23 | 24 | # Window position (changes require restart) 25 | # 26 | # Specified in number of pixels. 27 | # If the position is not set, the window manager will handle the placement. 28 | #position: 29 | # x: 0 30 | # y: 0 31 | 32 | # Window padding (changes require restart) 33 | # 34 | # Blank space added around the window in pixels. This padding is scaled 35 | # by DPI and the specified value is always added at both opposing sides. 36 | padding: 37 | x: 0 38 | y: 0 39 | 40 | # Spread additional padding evenly around the terminal content. 41 | dynamic_padding: false 42 | 43 | # Window decorations 44 | # 45 | # Values for `decorations`: 46 | # - full: Borders and title bar 47 | # - none: Neither borders nor title bar 48 | # 49 | # Values for `decorations` (macOS only): 50 | # - transparent: Title bar, transparent background and title bar buttons 51 | # - buttonless: Title bar, transparent background, but no title bar buttons 52 | decorations: full 53 | 54 | # Startup Mode (changes require restart) 55 | # 56 | # Values for `startup_mode`: 57 | # - Windowed 58 | # - Maximized 59 | # - Fullscreen 60 | # 61 | # Values for `startup_mode` (macOS only): 62 | # - SimpleFullscreen 63 | startup_mode: Windowed 64 | 65 | # Window title 66 | #title: Alacritty 67 | 68 | # Window class (Linux only): 69 | #class: Alacritty 70 | 71 | scrolling: 72 | # Maximum number of lines in the scrollback buffer. 73 | # Specifying '0' will disable scrolling. 74 | history: 10000 75 | 76 | # Number of lines the viewport will move for every line scrolled when 77 | # scrollback is enabled (history > 0). 78 | multiplier: 3 79 | 80 | # Faux Scrolling 81 | # 82 | # The `faux_multiplier` setting controls the number of lines the terminal 83 | # should scroll when the alternate screen buffer is active. This is used 84 | # to allow mouse scrolling for applications like `man`. 85 | # 86 | # Specifying `0` will disable faux scrolling. 87 | faux_multiplier: 3 88 | 89 | # Scroll to the bottom when new text is written to the terminal. 90 | auto_scroll: false 91 | 92 | # Spaces per Tab (changes require restart) 93 | # 94 | # This setting defines the width of a tab in cells. 95 | # 96 | # Some applications, like Emacs, rely on knowing about the width of a tab. 97 | # To prevent unexpected behavior in these applications, it's also required to 98 | # change the `it` value in terminfo when altering this setting. 99 | tabspaces: 8 100 | 101 | # Font configuration (changes require restart) 102 | font: 103 | # Normal (roman) font face 104 | #normal: 105 | # Font family 106 | # 107 | # Default: 108 | # - (macOS) Menlo 109 | # - (Linux) monospace 110 | # - (Windows) Consolas 111 | #family: monospace 112 | 113 | # The `style` can be specified to pick a specific face. 114 | #style: Regular 115 | 116 | # Bold font face 117 | #bold: 118 | # Font family 119 | # 120 | # If the bold family is not specified, it will fall back to the 121 | # value specified for the normal font. 122 | #family: monospace 123 | 124 | # The `style` can be specified to pick a specific face. 125 | #style: Bold 126 | 127 | # Italic font face 128 | #italic: 129 | # Font family 130 | # 131 | # If the italic family is not specified, it will fall back to the 132 | # value specified for the normal font. 133 | #family: monospace 134 | 135 | # The `style` can be specified to pick a specific face. 136 | #style: Italic 137 | 138 | # Point size 139 | size: 11.0 140 | 141 | # Offset is the extra space around each character. `offset.y` can be thought of 142 | # as modifying the line spacing, and `offset.x` as modifying the letter spacing. 143 | offset: 144 | x: 0 145 | y: 0 146 | 147 | # Glyph offset determines the locations of the glyphs within their cells with 148 | # the default being at the bottom. Increasing `x` moves the glyph to the right, 149 | # increasing `y` moves the glyph upwards. 150 | glyph_offset: 151 | x: 0 152 | y: 0 153 | 154 | # Thin stroke font rendering (macOS only) 155 | # 156 | # Thin strokes are suitable for retina displays, but for non-retina screens 157 | # it is recommended to set `use_thin_strokes` to `false` 158 | # 159 | # macOS >= 10.14.x: 160 | # 161 | # If the font quality on non-retina display looks bad then set 162 | # `use_thin_strokes` to `true` and enable font smoothing by running the 163 | # following command: 164 | # `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO` 165 | # 166 | # This is a global setting and will require a log out or restart to take 167 | # effect. 168 | use_thin_strokes: true 169 | 170 | # If `true`, bold text is drawn using the bright color variants. 171 | draw_bold_text_with_bright_colors: true 172 | 173 | # Colors (Tomorrow Night Bright) 174 | colors: 175 | # Default colors 176 | primary: 177 | background: '0x000000' 178 | foreground: '0xeaeaea' 179 | 180 | # Bright and dim foreground colors 181 | # 182 | # The dimmed foreground color is calculated automatically if it is not present. 183 | # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` 184 | # is `false`, the normal foreground color will be used. 185 | #dim_foreground: '0x9a9a9a' 186 | #bright_foreground: '0xffffff' 187 | 188 | # Cursor colors 189 | # 190 | # Colors which should be used to draw the terminal cursor. If these are unset, 191 | # the cursor color will be the inverse of the cell color. 192 | #cursor: 193 | # text: '0x000000' 194 | # cursor: '0xffffff' 195 | 196 | # Selection colors 197 | # 198 | # Colors which should be used to draw the selection area. If selection 199 | # background is unset, selection color will be the inverse of the cell colors. 200 | # If only text is unset the cell text color will remain the same. 201 | #selection: 202 | # text: '0xeaeaea' 203 | # background: '0x404040' 204 | 205 | # Normal colors 206 | normal: 207 | black: '0x000000' 208 | red: '0xd54e53' 209 | green: '0xb9ca4a' 210 | yellow: '0xe6c547' 211 | blue: '0x7aa6da' 212 | magenta: '0xc397d8' 213 | cyan: '0x70c0ba' 214 | white: '0xeaeaea' 215 | 216 | # Bright colors 217 | bright: 218 | black: '0x666666' 219 | red: '0xff3334' 220 | green: '0x9ec400' 221 | yellow: '0xe7c547' 222 | blue: '0x7aa6da' 223 | magenta: '0xb77ee0' 224 | cyan: '0x54ced6' 225 | white: '0xffffff' 226 | 227 | # Dim colors 228 | # 229 | # If the dim colors are not set, they will be calculated automatically based 230 | # on the `normal` colors. 231 | #dim: 232 | # black: '0x000000' 233 | # red: '0x8c3336' 234 | # green: '0x7a8530' 235 | # yellow: '0x97822e' 236 | # blue: '0x506d8f' 237 | # magenta: '0x80638e' 238 | # cyan: '0x497e7a' 239 | # white: '0x9a9a9a' 240 | 241 | # Indexed Colors 242 | # 243 | # The indexed colors include all colors from 16 to 256. 244 | # When these are not set, they're filled with sensible defaults. 245 | # 246 | # Example: 247 | # `- { index: 16, color: '0xff00ff' }` 248 | # 249 | indexed_colors: [] 250 | 251 | # Visual Bell 252 | # 253 | # Any time the BEL code is received, Alacritty "rings" the visual bell. Once 254 | # rung, the terminal background will be set to white and transition back to the 255 | # default background color. You can control the rate of this transition by 256 | # setting the `duration` property (represented in milliseconds). You can also 257 | # configure the transition function by setting the `animation` property. 258 | # 259 | # Values for `animation`: 260 | # - Ease 261 | # - EaseOut 262 | # - EaseOutSine 263 | # - EaseOutQuad 264 | # - EaseOutCubic 265 | # - EaseOutQuart 266 | # - EaseOutQuint 267 | # - EaseOutExpo 268 | # - EaseOutCirc 269 | # - Linear 270 | # 271 | # Specifying a `duration` of `0` will disable the visual bell. 272 | visual_bell: 273 | animation: EaseOutExpo 274 | duration: 0 275 | color: '0xffffff' 276 | 277 | # Background opacity 278 | # 279 | # Window opacity as a floating point number from `0.0` to `1.0`. 280 | # The value `0.0` is completely transparent and `1.0` is opaque. 281 | background_opacity: 1.0 282 | 283 | # Mouse bindings 284 | # 285 | # Available fields: 286 | # - mouse 287 | # - action 288 | # - mods (optional) 289 | # 290 | # Values for `mouse`: 291 | # - Middle 292 | # - Left 293 | # - Right 294 | # - Numeric identifier such as `5` 295 | # 296 | # All available `mods` and `action` values are documented in the key binding 297 | # section. 298 | mouse_bindings: 299 | - { mouse: Middle, action: PasteSelection } 300 | 301 | mouse: 302 | # Click settings 303 | # 304 | # The `double_click` and `triple_click` settings control the time 305 | # alacritty should wait for accepting multiple clicks as one double 306 | # or triple click. 307 | double_click: { threshold: 300 } 308 | triple_click: { threshold: 300 } 309 | 310 | # If this is `true`, the cursor is temporarily hidden when typing. 311 | hide_when_typing: false 312 | 313 | url: 314 | # URL launcher 315 | # 316 | # This program is executed when clicking on a text which is recognized as a URL. 317 | # The URL is always added to the command as the last parameter. 318 | # 319 | # When set to `None`, URL launching will be disabled completely. 320 | # 321 | # Default: 322 | # - (macOS) open 323 | # - (Linux) xdg-open 324 | # - (Windows) explorer 325 | #launcher: 326 | # program: xdg-open 327 | # args: [] 328 | 329 | # URL modifiers 330 | # 331 | # These are the modifiers that need to be held down for opening URLs when clicking 332 | # on them. The available modifiers are documented in the key binding section. 333 | modifiers: None 334 | 335 | selection: 336 | semantic_escape_chars: ",│`|:\"' ()[]{}<>" 337 | 338 | # When set to `true`, selected text will be copied to the primary clipboard. 339 | save_to_clipboard: false 340 | 341 | # Allow terminal applications to change Alacritty's window title. 342 | dynamic_title: true 343 | 344 | cursor: 345 | # Cursor style 346 | # 347 | # Values for `style`: 348 | # - ▇ Block 349 | # - _ Underline 350 | # - | Beam 351 | style: Block 352 | 353 | # If this is `true`, the cursor will be rendered as a hollow box when the 354 | # window is not focused. 355 | unfocused_hollow: true 356 | 357 | # Live config reload (changes require restart) 358 | live_config_reload: true 359 | 360 | # Shell 361 | # 362 | # You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`. 363 | # Entries in `shell.args` are passed unmodified as arguments to the shell. 364 | # 365 | # Default: 366 | # - (macOS) /bin/bash --login 367 | # - (Linux) user login shell 368 | # - (Windows) powershell 369 | #shell: 370 | # program: /bin/bash 371 | # args: 372 | # - --login 373 | 374 | # Startup directory 375 | # 376 | # Directory the shell is started in. If this is unset, or `None`, the working 377 | # directory of the parent process will be used. 378 | working_directory: None 379 | 380 | # Windows 10 ConPTY backend (Windows only) 381 | # 382 | # This will enable better color support and may resolve other issues, 383 | # however this API and its implementation is still young and so is 384 | # disabled by default, as stability may not be as good as the winpty 385 | # backend. 386 | # 387 | # Alacritty will fall back to the WinPTY automatically if the ConPTY 388 | # backend cannot be initialized. 389 | enable_experimental_conpty_backend: false 390 | 391 | # Send ESC (\x1b) before characters when alt is pressed. 392 | alt_send_esc: true 393 | 394 | debug: 395 | # Display the time it takes to redraw each frame. 396 | render_timer: false 397 | 398 | # Keep the log file after quitting Alacritty. 399 | persistent_logging: false 400 | 401 | # Log level 402 | # 403 | # Values for `log_level`: 404 | # - None 405 | # - Error 406 | # - Warn 407 | # - Info 408 | # - Debug 409 | # - Trace 410 | log_level: Warn 411 | 412 | # Print all received window events. 413 | print_events: false 414 | 415 | # Record all characters and escape sequences as test data. 416 | ref_test: false 417 | 418 | # Key bindings 419 | # 420 | # Key bindings are specified as a list of objects. Each binding will specify a 421 | # key and modifiers required to trigger it, terminal modes where the binding is 422 | # applicable, and what should be done when the key binding fires. It can either 423 | # send a byte sequence to the running application (`chars`), execute a 424 | # predefined action (`action`) or fork and execute a specified command plus 425 | # arguments (`command`). 426 | # 427 | # Bindings are always filled by default, but will be replaced when a new binding 428 | # with the same triggers is defined. To unset a default binding, it can be 429 | # mapped to the `None` action. 430 | # 431 | # Example: 432 | # `- { key: V, mods: Control|Shift, action: Paste }` 433 | # 434 | # Available fields: 435 | # - key 436 | # - mods (optional) 437 | # - chars | action | command (exactly one required) 438 | # - mode (optional) 439 | # 440 | # Values for `key`: 441 | # - `A` -> `Z` 442 | # - `F1` -> `F12` 443 | # - `Key1` -> `Key0` 444 | # 445 | # A full list with available key codes can be found here: 446 | # https://docs.rs/glutin/*/glutin/enum.VirtualKeyCode.html#variants 447 | # 448 | # Instead of using the name of the keys, the `key` field also supports using 449 | # the scancode of the desired key. Scancodes have to be specified as a 450 | # decimal number. 451 | # This command will allow you to display the hex scancodes for certain keys: 452 | # `showkey --scancodes` 453 | # 454 | # Values for `mods`: 455 | # - Command 456 | # - Control 457 | # - Option 458 | # - Super 459 | # - Shift 460 | # - Alt 461 | # 462 | # Multiple `mods` can be combined using `|` like this: `mods: Control|Shift`. 463 | # Whitespace and capitalization is relevant and must match the example. 464 | # 465 | # Values for `chars`: 466 | # The `chars` field writes the specified string to the terminal. This makes 467 | # it possible to pass escape sequences. 468 | # To find escape codes for bindings like `PageUp` ("\x1b[5~"), you can run 469 | # the command `showkey -a` outside of tmux. 470 | # Note that applications use terminfo to map escape sequences back to 471 | # keys. It is therefore required to update the terminfo when 472 | # changing an escape sequence. 473 | # 474 | # Values for `action`: 475 | # - Paste 476 | # - PasteSelection 477 | # - Copy 478 | # - IncreaseFontSize 479 | # - DecreaseFontSize 480 | # - ResetFontSize 481 | # - ScrollPageUp 482 | # - ScrollPageDown 483 | # - ScrollLineUp 484 | # - ScrollLineDown 485 | # - ScrollToTop 486 | # - ScrollToBottom 487 | # - ClearHistory 488 | # - Hide 489 | # - Quit 490 | # - ClearLogNotice 491 | # - SpawnNewInstance 492 | # - ToggleFullscreen 493 | # - None 494 | # 495 | # Values for `action` (macOS only): 496 | # - ToggleSimpleFullscreen: Enters fullscreen without occupying another space 497 | # 498 | # Values for `command`: 499 | # The `command` field must be a map containing a `program` string and 500 | # an `args` array of command line parameter strings. 501 | # 502 | # Example: 503 | # `command: { program: "alacritty", args: ["-e", "vttest"] }` 504 | # 505 | # Values for `mode`: 506 | # - ~AppCursor 507 | # - AppCursor 508 | # - ~AppKeypad 509 | # - AppKeypad 510 | key_bindings: 511 | # (Windows/Linux only) 512 | #- { key: V, mods: Control|Shift, action: Paste } 513 | #- { key: C, mods: Control|Shift, action: Copy } 514 | #- { key: Insert, mods: Shift, action: PasteSelection } 515 | #- { key: Key0, mods: Control, action: ResetFontSize } 516 | #- { key: Equals, mods: Control, action: IncreaseFontSize } 517 | #- { key: Add, mods: Control, action: IncreaseFontSize } 518 | #- { key: Subtract, mods: Control, action: DecreaseFontSize } 519 | #- { key: Minus, mods: Control, action: DecreaseFontSize } 520 | #- { key: Return, mods: Alt, action: ToggleFullscreen } 521 | 522 | # (macOS only) 523 | #- { key: Key0, mods: Command, action: ResetFontSize } 524 | #- { key: Equals, mods: Command, action: IncreaseFontSize } 525 | #- { key: Add, mods: Command, action: IncreaseFontSize } 526 | #- { key: Minus, mods: Command, action: DecreaseFontSize } 527 | #- { key: K, mods: Command, action: ClearHistory } 528 | #- { key: K, mods: Command, chars: "\x0c" } 529 | #- { key: V, mods: Command, action: Paste } 530 | #- { key: C, mods: Command, action: Copy } 531 | #- { key: H, mods: Command, action: Hide } 532 | #- { key: Q, mods: Command, action: Quit } 533 | #- { key: W, mods: Command, action: Quit } 534 | #- { key: F, mods: Command|Control, action: ToggleFullscreen } 535 | 536 | - { key: Paste, action: Paste } 537 | - { key: Copy, action: Copy } 538 | - { key: L, mods: Control, action: ClearLogNotice } 539 | - { key: L, mods: Control, chars: "\x0c" } 540 | - { key: Home, mods: Alt, chars: "\x1b[1;3H" } 541 | - { key: Home, chars: "\x1bOH", mode: AppCursor } 542 | - { key: Home, chars: "\x1b[H", mode: ~AppCursor } 543 | - { key: End, mods: Alt, chars: "\x1b[1;3F" } 544 | - { key: End, chars: "\x1bOF", mode: AppCursor } 545 | - { key: End, chars: "\x1b[F", mode: ~AppCursor } 546 | - { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } 547 | - { key: PageUp, mods: Shift, chars: "\x1b[5;2~", mode: Alt } 548 | - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } 549 | - { key: PageUp, mods: Alt, chars: "\x1b[5;3~" } 550 | - { key: PageUp, chars: "\x1b[5~" } 551 | - { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } 552 | - { key: PageDown, mods: Shift, chars: "\x1b[6;2~", mode: Alt } 553 | - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } 554 | - { key: PageDown, mods: Alt, chars: "\x1b[6;3~" } 555 | - { key: PageDown, chars: "\x1b[6~" } 556 | - { key: Tab, mods: Shift, chars: "\x1b[Z" } 557 | - { key: Back, chars: "\x7f" } 558 | - { key: Back, mods: Alt, chars: "\x1b\x7f" } 559 | - { key: Insert, chars: "\x1b[2~" } 560 | - { key: Delete, chars: "\x1b[3~" } 561 | - { key: Left, mods: Shift, chars: "\x1b[1;2D" } 562 | - { key: Left, mods: Control, chars: "\x1b[1;5D" } 563 | - { key: Left, mods: Alt, chars: "\x1b[1;3D" } 564 | - { key: Left, chars: "\x1b[D", mode: ~AppCursor } 565 | - { key: Left, chars: "\x1bOD", mode: AppCursor } 566 | - { key: Right, mods: Shift, chars: "\x1b[1;2C" } 567 | - { key: Right, mods: Control, chars: "\x1b[1;5C" } 568 | - { key: Right, mods: Alt, chars: "\x1b[1;3C" } 569 | - { key: Right, chars: "\x1b[C", mode: ~AppCursor } 570 | - { key: Right, chars: "\x1bOC", mode: AppCursor } 571 | - { key: Up, mods: Shift, chars: "\x1b[1;2A" } 572 | - { key: Up, mods: Control, chars: "\x1b[1;5A" } 573 | - { key: Up, mods: Alt, chars: "\x1b[1;3A" } 574 | - { key: Up, chars: "\x1b[A", mode: ~AppCursor } 575 | - { key: Up, chars: "\x1bOA", mode: AppCursor } 576 | - { key: Down, mods: Shift, chars: "\x1b[1;2B" } 577 | - { key: Down, mods: Control, chars: "\x1b[1;5B" } 578 | - { key: Down, mods: Alt, chars: "\x1b[1;3B" } 579 | - { key: Down, chars: "\x1b[B", mode: ~AppCursor } 580 | - { key: Down, chars: "\x1bOB", mode: AppCursor } 581 | - { key: F1, chars: "\x1bOP" } 582 | - { key: F2, chars: "\x1bOQ" } 583 | - { key: F3, chars: "\x1bOR" } 584 | - { key: F4, chars: "\x1bOS" } 585 | - { key: F5, chars: "\x1b[15~" } 586 | - { key: F6, chars: "\x1b[17~" } 587 | - { key: F7, chars: "\x1b[18~" } 588 | - { key: F8, chars: "\x1b[19~" } 589 | - { key: F9, chars: "\x1b[20~" } 590 | - { key: F10, chars: "\x1b[21~" } 591 | - { key: F11, chars: "\x1b[23~" } 592 | - { key: F12, chars: "\x1b[24~" } 593 | - { key: F1, mods: Shift, chars: "\x1b[1;2P" } 594 | - { key: F2, mods: Shift, chars: "\x1b[1;2Q" } 595 | - { key: F3, mods: Shift, chars: "\x1b[1;2R" } 596 | - { key: F4, mods: Shift, chars: "\x1b[1;2S" } 597 | - { key: F5, mods: Shift, chars: "\x1b[15;2~" } 598 | - { key: F6, mods: Shift, chars: "\x1b[17;2~" } 599 | - { key: F7, mods: Shift, chars: "\x1b[18;2~" } 600 | - { key: F8, mods: Shift, chars: "\x1b[19;2~" } 601 | - { key: F9, mods: Shift, chars: "\x1b[20;2~" } 602 | - { key: F10, mods: Shift, chars: "\x1b[21;2~" } 603 | - { key: F11, mods: Shift, chars: "\x1b[23;2~" } 604 | - { key: F12, mods: Shift, chars: "\x1b[24;2~" } 605 | - { key: F1, mods: Control, chars: "\x1b[1;5P" } 606 | - { key: F2, mods: Control, chars: "\x1b[1;5Q" } 607 | - { key: F3, mods: Control, chars: "\x1b[1;5R" } 608 | - { key: F4, mods: Control, chars: "\x1b[1;5S" } 609 | - { key: F5, mods: Control, chars: "\x1b[15;5~" } 610 | - { key: F6, mods: Control, chars: "\x1b[17;5~" } 611 | - { key: F7, mods: Control, chars: "\x1b[18;5~" } 612 | - { key: F8, mods: Control, chars: "\x1b[19;5~" } 613 | - { key: F9, mods: Control, chars: "\x1b[20;5~" } 614 | - { key: F10, mods: Control, chars: "\x1b[21;5~" } 615 | - { key: F11, mods: Control, chars: "\x1b[23;5~" } 616 | - { key: F12, mods: Control, chars: "\x1b[24;5~" } 617 | - { key: F1, mods: Alt, chars: "\x1b[1;6P" } 618 | - { key: F2, mods: Alt, chars: "\x1b[1;6Q" } 619 | - { key: F3, mods: Alt, chars: "\x1b[1;6R" } 620 | - { key: F4, mods: Alt, chars: "\x1b[1;6S" } 621 | - { key: F5, mods: Alt, chars: "\x1b[15;6~" } 622 | - { key: F6, mods: Alt, chars: "\x1b[17;6~" } 623 | - { key: F7, mods: Alt, chars: "\x1b[18;6~" } 624 | - { key: F8, mods: Alt, chars: "\x1b[19;6~" } 625 | - { key: F9, mods: Alt, chars: "\x1b[20;6~" } 626 | - { key: F10, mods: Alt, chars: "\x1b[21;6~" } 627 | - { key: F11, mods: Alt, chars: "\x1b[23;6~" } 628 | - { key: F12, mods: Alt, chars: "\x1b[24;6~" } 629 | - { key: F1, mods: Super, chars: "\x1b[1;3P" } 630 | - { key: F2, mods: Super, chars: "\x1b[1;3Q" } 631 | - { key: F3, mods: Super, chars: "\x1b[1;3R" } 632 | - { key: F4, mods: Super, chars: "\x1b[1;3S" } 633 | - { key: F5, mods: Super, chars: "\x1b[15;3~" } 634 | - { key: F6, mods: Super, chars: "\x1b[17;3~" } 635 | - { key: F7, mods: Super, chars: "\x1b[18;3~" } 636 | - { key: F8, mods: Super, chars: "\x1b[19;3~" } 637 | - { key: F9, mods: Super, chars: "\x1b[20;3~" } 638 | - { key: F10, mods: Super, chars: "\x1b[21;3~" } 639 | - { key: F11, mods: Super, chars: "\x1b[23;3~" } 640 | - { key: F12, mods: Super, chars: "\x1b[24;3~" } 641 | - { key: NumpadEnter, chars: "\n" } 642 | -------------------------------------------------------------------------------- /config/asdfrc: -------------------------------------------------------------------------------- 1 | legacy_version_file = yes 2 | -------------------------------------------------------------------------------- /config/ctags: -------------------------------------------------------------------------------- 1 | --exclude=.bundle 2 | --exclude=*.min.js 3 | --exclude=*.min.css 4 | --exclude=build 5 | --exclude=vendor 6 | --exclude=.git 7 | --exclude=public 8 | --exclude=elm-stuff 9 | --exclude=tmp 10 | --exclude=*.json 11 | --exclude=node_modules 12 | --exclude=.yarn-cache 13 | -------------------------------------------------------------------------------- /config/gitconfig: -------------------------------------------------------------------------------- 1 | # Set your name and email with the following: 2 | # git config -f ~/.gitconfig.local user.name John Appleseed 3 | # git config -f ~/.gitconfig.local user.email me@example.com 4 | 5 | [include] 6 | path = .gitconfig.local 7 | [color] 8 | ui = auto 9 | [core] 10 | excludesfile = ~/.gitignore 11 | [git-up "bundler"] 12 | check = true 13 | [rebase] 14 | autosquash = true 15 | [color "diff"] 16 | commit = yellow reverse 17 | [push] 18 | default = tracking 19 | [merge] 20 | log = true 21 | conflictstyle = diff3 22 | tool = vimdiff 23 | [mergetool] 24 | prompt = false 25 | [pager] 26 | log = diff-highlight | $PAGER 27 | show = diff-highlight | $PAGER 28 | diff = diff-highlight | $PAGER 29 | [diff] 30 | colorMoved = zebra 31 | [credential] 32 | helper = osxkeychain 33 | [init] 34 | defaultBranch = main 35 | -------------------------------------------------------------------------------- /config/gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # vim-gutentags 4 | /tags 5 | /tags.temp 6 | /tags.lock 7 | /tags.temp.tmp 8 | 9 | # projectionist.vim 10 | /.projections.json 11 | 12 | /.rspec-local 13 | -------------------------------------------------------------------------------- /config/hushlogin: -------------------------------------------------------------------------------- 1 | # The mere presence of this file in the home directory disables the system 2 | # copyright notice, the date and time of the last login, the message of the day 3 | # as well as other information that may otherwise appear on login. 4 | # 5 | # See `man login`. 6 | -------------------------------------------------------------------------------- /config/inputrc: -------------------------------------------------------------------------------- 1 | # https://superuser.com/a/301409/99854 2 | set bind-tty-special-chars off 3 | "\C-u": kill-whole-line 4 | "\C-w": backward-kill-word 5 | -------------------------------------------------------------------------------- /config/khdrc: -------------------------------------------------------------------------------- 1 | # Enable kwm compatibility mode 2 | khd kwm on 3 | 4 | # set color of default mode 5 | khd mode default color 0xFFD5C4A1 6 | 7 | # Enable the prefix mode 8 | khd mode prefix prefix on 9 | khd mode prefix timeout 0.75 10 | khd mode prefix restore default 11 | khd mode prefix color 0xFF458588 12 | 13 | # Activate prefix mode 14 | ctrl - s : khd -e "mode activate prefix" 15 | 16 | # Quit Kwm 17 | cmd + alt + ctrl - q : kwmc quit 18 | 19 | # Set Space Tiling Mode To BSP 20 | cmd + ctrl - a : kwmc space -t bsp 21 | 22 | # Set Space Tiling Mode To Monocle 23 | cmd + ctrl - s : kwmc space -t monocle 24 | 25 | # Set Space Tiling Mode To Floating 26 | cmd + ctrl - d : kwmc space -t float 27 | 28 | # Rotate Window-Tree By 90degrees (Clockwise) 29 | cmd + ctrl - r : kwmc tree rotate 90 30 | 31 | # Modify Container 32 | prefix - s : kwmc window -c split-mode toggle 33 | prefix - 0x32 : kwmc window -c type toggle 34 | 35 | prefix - h : kwmc window -c expand 0.05 west 36 | prefix - j : kwmc window -c expand 0.05 south 37 | prefix - k : kwmc window -c expand 0.05 north 38 | prefix - l : kwmc window -c expand 0.05 east 39 | 40 | prefix + shift - h : kwmc window -c reduce 0.05 west 41 | prefix + shift - j : kwmc window -c reduce 0.05 south 42 | prefix + shift - k : kwmc window -c reduce 0.05 north 43 | prefix + shift - l : kwmc window -c reduce 0.05 east 44 | 45 | # Set Temporary Window Container 46 | prefix - f : kwmc window -z fullscreen 47 | prefix - d : kwmc window -z parent 48 | prefix - w : kwmc window -t focused 49 | 50 | # Mark Window 51 | cmd + alt + ctrl - m : kwmc window -mk focused 52 | cmd + alt + ctrl - h : kwmc window -mk west wrap 53 | cmd + alt + ctrl - l : kwmc window -mk east wrap 54 | cmd + alt + ctrl - j : kwmc window -mk south wrap 55 | cmd + alt + ctrl - k : kwmc window -mk north wrap 56 | 57 | # Give Focus To Window 58 | cmd + alt - h : kwmc window -f west 59 | cmd + alt - l : kwmc window -f east 60 | cmd + alt - j : kwmc window -f south 61 | cmd + alt - k : kwmc window -f north 62 | 63 | cmd + alt - n : kwmc window -fm prev 64 | cmd + alt - m : kwmc window -fm next 65 | 66 | # Give Focus To Screen 67 | cmd + alt - 1 : kwmc display -f 0 68 | cmd + alt - 2 : kwmc display -f 1 69 | cmd + alt - 3 : kwmc display -f 2 70 | 71 | # Swap Focused Window 72 | ctrl + alt - h : kwmc window -s west 73 | ctrl + alt - j : kwmc window -s south 74 | ctrl + alt - k : kwmc window -s north 75 | ctrl + alt - l : kwmc window -s east 76 | ctrl + alt - m : kwmc window -s mark 77 | 78 | # Pseudo containers 79 | cmd + ctrl + alt - p : kwmc tree -pseudo create 80 | cmd + ctrl + alt - o : kwmc tree -pseudo destroy 81 | ctrl + alt - p : kwmc window -s prev 82 | ctrl + alt - n : kwmc window -s next 83 | 84 | # Detach Focused Window And Reinsert In Direction 85 | ctrl + shift - k : kwmc window -m north 86 | ctrl + shift - l : kwmc window -m east 87 | ctrl + shift - j : kwmc window -m south 88 | ctrl + shift - h : kwmc window -m west 89 | 90 | # Detach Marked Window And Reinsert At Focused Window 91 | ctrl + shift - x : kwmc window -m mark 92 | 93 | # Move Focused Window To Space 94 | ctrl + alt - left : kwmc window -m space left 95 | ctrl + alt - right : kwmc window -m space right 96 | 97 | # Move Focused Window To Screen 98 | ctrl + alt - 1 : kwmc window -m display 0 99 | ctrl + alt - 2 : kwmc window -m display 1 100 | ctrl + alt - 3 : kwmc window -m display 2 101 | 102 | # Increase Container Gaps 103 | prefix - x : kwmc space -g increase horizontal 104 | prefix - y : kwmc space -g increase vertical 105 | 106 | # Decrease Container Gaps 107 | prefix + shift - x : kwmc space -g decrease horizontal 108 | prefix + shift - y : kwmc space -g decrease vertical 109 | 110 | # Increase Screen Padding 111 | prefix - left : kwmc space -p increase left 112 | prefix - right : kwmc space -p increase right 113 | prefix - up : kwmc space -p increase top 114 | prefix - down : kwmc space -p increase bottom 115 | prefix - p : kwmc space -p increase all 116 | 117 | # Decrease Screen Padding 118 | prefix + shift - left : kwmc space -p decrease left 119 | prefix + shift - right : kwmc space -p decrease right 120 | prefix + shift - up : kwmc space -p decrease top 121 | prefix + shift - down : kwmc space -p decrease bottom 122 | prefix + shift - p : kwmc space -p decrease all 123 | -------------------------------------------------------------------------------- /config/kwm/kwmrc: -------------------------------------------------------------------------------- 1 | /* 2 | This is a sample config for Kwm 3 | 4 | The following statements can be used to set Kwms internal directory structure. 5 | 6 | This is the root folder for Kwms files, the only thing this actually 7 | specifies is the location of the 'init' script which Kwm runs upon startup. 8 | Defaults to $HOME/.kwm 9 | 10 | kwm_home /path/to/.kwm 11 | 12 | This is the root folder in which all files included using 'include' must reside. 13 | Defaults to $HOME/.kwm 14 | 15 | kwm_include /path/to/.kwm/include 16 | 17 | This is the folder in which all bsp-layouts managed by 'tree load' and 'tree save' 18 | is loaded from / saved to. Defaults to $HOME/.kwm/layouts 19 | 20 | kwm_layouts /path/to/.kwm/layouts 21 | 22 | Commands prefixed with 'kwmc' will call 23 | local functions corresponding to the 24 | kwmc syntax. 25 | 26 | To run an external program or command, 27 | use the prefix 'exec' followed by command. 28 | e.g 'exec mvim' would open macvim 29 | 30 | Read file and execute commands as 31 | if they were written inside kwmrc. 32 | 33 | include filename 34 | 35 | e.g: window-rules in a separate file called 'rules' 36 | include rules 37 | */ 38 | 39 | # Set default values for screen padding 40 | kwmc config padding 40 20 20 20 41 | 42 | # Set default values for container gaps 43 | kwmc config gap 15 15 44 | 45 | # Default tiling mode for Kwm (bsp | monocle | float) 46 | kwmc config tiling bsp 47 | 48 | # Automatically float windows that fail to resize 49 | kwmc config float-non-resizable on 50 | 51 | # Automatically resize the window to its container 52 | kwmc config lock-to-container on 53 | 54 | # Set focus-follows-mouse-mode to autoraise 55 | kwmc config focus-follows-mouse off 56 | 57 | /* 58 | Focus-follows-mouse is temporarily disabled when 59 | a floating window has focus 60 | */ 61 | kwmc config standby-on-float on 62 | 63 | # Center window when made floating 64 | kwmc config center-on-float on 65 | 66 | /* 67 | The mouse will automatically move to the center 68 | of the focused window 69 | */ 70 | kwmc config mouse-follows-focus on 71 | 72 | /* 73 | Allows a window to be moved by dragging, 74 | when a modifier key and left-click is held down. 75 | 76 | Allows a window to be resized by dragging 77 | when a modifier key and right-click is held down. 78 | */ 79 | kwmc config mouse-drag on 80 | 81 | # The modifier keys to be held down to initiate mouse-drag 82 | kwmc config mouse-drag mod shift+ctrl 83 | 84 | # Allow window focus to wrap-around 85 | kwmc config cycle-focus on 86 | 87 | /* 88 | Override default settings for space 1 on screen 0 89 | kwmc config space 0 1 mode monocle 90 | kwmc config space 0 1 padding 100 100 100 100 91 | kwmc config space 0 1 gap 40 40 92 | */ 93 | 94 | /* 95 | Override default settings for screen 1 96 | kwmc config display 1 mode bsp 97 | kwmc config display 1 padding 100 100 100 100 98 | kwmc config display 1 gap 40 40 99 | */ 100 | 101 | # Set default container split-ratio 102 | kwmc config split-ratio 0.5 103 | 104 | # New splits become the left leaf-node 105 | kwmc config spawn left 106 | 107 | /* 108 | Add custom tiling rules for applications that 109 | does not get tiled by Kwm by default. 110 | This is because some applications do not have the 111 | AXWindowRole and AXStandardWindowSubRole 112 | */ 113 | kwmc rule owner="iTerm2" properties={role="AXDialog"} 114 | 115 | /* 116 | The following commands create rules that 117 | blacklists an application from Kwms tiling 118 | 119 | kwmc rule owner="Steam" properties={float="true"} 120 | kwmc rule owner="Photoshop" properties={float="true"} 121 | */ 122 | kwmc rule owner="Tweetbot" properties={float="true"} 123 | 124 | /* 125 | The following command creates a rule that 126 | captures an application to the given screen, 127 | if the screen exists. 128 | 129 | kwmc rule owner="iTunes" properties={display="1"} 130 | */ 131 | 132 | # Enable border for focused window 133 | kwmc config border focused on 134 | kwmc config border focused size 2 135 | kwmc config border focused color 0xFFBDD322 136 | kwmc config border focused radius 6 137 | 138 | # Enable border for marked window 139 | kwmc config border marked on 140 | kwmc config border marked size 2 141 | kwmc config border marked color 0xFFCC5577 142 | kwmc config border marked radius 6 143 | -------------------------------------------------------------------------------- /config/modalmenu.json: -------------------------------------------------------------------------------- 1 | { 2 | "iTerm": { 3 | "path": "/Applications/iTerm.app", 4 | "shortcut": "t" 5 | }, 6 | "Chrome Incognito": { 7 | "path": "~/bin/incognito", 8 | "shortcut": "i" 9 | }, 10 | "Safari": { 11 | "path": "/Applications/Safari.app", 12 | "shortcut": "s" 13 | }, 14 | "Xcode": { 15 | "path": "Xcode", 16 | "shortcut": "x" 17 | }, 18 | "Bounce Wi-Fi": { 19 | "path": "~/bin/airport-bounce", 20 | "shortcut": "b" 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | TODO: 4 | - Bubble lines up/down 5 | - Bubble arguments left/right 6 | - Copy to system clipboard (y) 7 | - Paste from system clipboard (p) 8 | - Copy absolute path of current file 9 | 10 | Kickstart Guide: 11 | 12 | If you don't know anything about Lua, I recommend taking some time to read through 13 | a guide. One possible example which will only take 10-15 minutes: 14 | - https://learnxinyminutes.com/docs/lua/ 15 | 16 | After understanding a bit more about Lua, you can use `:help lua-guide` as a 17 | reference for how Neovim integrates Lua. 18 | - :help lua-guide 19 | - (or HTML version): https://neovim.io/doc/user/lua-guide.html 20 | 21 | TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. 22 | 23 | If you don't know what this means, type the following: 24 | - 25 | - : 26 | - Tutor 27 | - 28 | 29 | (If you already know the Neovim basics, you can skip this step.) 30 | 31 | Once you've completed that, you can continue working through **AND READING** the rest 32 | of the kickstart init.lua. 33 | 34 | Next, run AND READ `:help`. 35 | This will open up a help window with some basic information 36 | about reading, navigating and searching the builtin help documentation. 37 | 38 | This should be the first place you go to look when you're stuck or confused 39 | with something. It's one of my favorite Neovim features. 40 | 41 | MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, 42 | which is very useful when you're not exactly sure of what you're looking for. 43 | 44 | I have left several `:help X` comments throughout the init.lua 45 | These are hints about where to find more information about the relevant settings, 46 | plugins or Neovim features used in Kickstart. 47 | 48 | NOTE: Look for lines like this 49 | 50 | Throughout the file. These are for you, the reader, to help you understand what is happening. 51 | Feel free to delete them once you know what you're doing, but they should serve as a guide 52 | for when you are first encountering a few different constructs in your Neovim config. 53 | 54 | If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. 55 | --]] 56 | 57 | -- Set as the leader key 58 | -- See `:help mapleader` 59 | -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) 60 | vim.g.mapleader = "," 61 | vim.g.maplocalleader = "," 62 | 63 | -- [[ Setting options ]] 64 | -- See `:help vim.opt` 65 | -- NOTE: You can change these options as you wish! 66 | -- For more options, you can see `:help option-list` 67 | 68 | -- Make line numbers default 69 | vim.opt.number = true 70 | -- You can also add relative line numbers, to help with jumping. 71 | -- Experiment for yourself to see if you like it! 72 | -- vim.opt.relativenumber = true 73 | 74 | -- Disable mouse mode 75 | vim.opt.mouse = "" 76 | 77 | -- Don't show the mode, since it's already in the status line 78 | vim.opt.showmode = false 79 | 80 | -- Sync clipboard between OS and Neovim. 81 | -- Schedule the setting after `UiEnter` because it can increase startup-time. 82 | -- Remove this option if you want your OS clipboard to remain independent. 83 | -- See `:help 'clipboard'` 84 | -- vim.schedule(function() 85 | -- vim.opt.clipboard = "unnamedplus" 86 | -- end) 87 | 88 | -- Enable break indent 89 | vim.opt.breakindent = true 90 | 91 | -- Save undo history 92 | vim.opt.undofile = true 93 | 94 | -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term 95 | vim.opt.ignorecase = true 96 | vim.opt.smartcase = true 97 | 98 | -- Keep signcolumn on by default 99 | vim.opt.signcolumn = "yes" 100 | 101 | -- Decrease update time 102 | vim.opt.updatetime = 250 103 | 104 | -- Decrease mapped sequence wait time 105 | vim.opt.timeoutlen = 300 106 | 107 | -- Configure how new splits should be opened 108 | vim.opt.splitright = true 109 | vim.opt.splitbelow = true 110 | 111 | -- Sets how neovim will display certain whitespace characters in the editor. 112 | -- See `:help 'list'` 113 | -- and `:help 'listchars'` 114 | vim.opt.listchars = { tab = "▸ ", trail = "·", nbsp = "␣", eol = "¬", extends = "❯", precedes = "❮" } 115 | 116 | -- Preview substitutions live, as you type! 117 | vim.opt.inccommand = "split" 118 | 119 | -- Show which line your cursor is on 120 | vim.opt.cursorline = false 121 | 122 | -- Minimal number of screen lines to keep above and below the cursor. 123 | vim.opt.scrolloff = 10 124 | 125 | -- [[ Basic Keymaps ]] 126 | -- See `:help vim.keymap.set()` 127 | 128 | -- Clear highlights on search when pressing / in normal mode 129 | -- See `:help hlsearch` 130 | vim.keymap.set("n", "/", "nohlsearch", { desc = "Clear search" }) 131 | 132 | -- Diagnostic keymaps 133 | vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) 134 | 135 | -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier 136 | -- for people to discover. Otherwise, you normally need to press , which 137 | -- is not what someone will guess without a bit more experience. 138 | -- 139 | -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping 140 | -- or just use to exit terminal mode 141 | vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) 142 | 143 | -- TIP: Disable arrow keys in normal mode 144 | -- vim.keymap.set('n', '', 'echo "Use h to move!!"') 145 | -- vim.keymap.set('n', '', 'echo "Use l to move!!"') 146 | -- vim.keymap.set('n', '', 'echo "Use k to move!!"') 147 | -- vim.keymap.set('n', '', 'echo "Use j to move!!"') 148 | 149 | -- Keybinds to make split navigation easier. 150 | -- Use CTRL+ to switch between windows 151 | -- 152 | -- See `:help wincmd` for a list of all window commands 153 | vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) 154 | vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) 155 | vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) 156 | vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) 157 | 158 | -- Jump to start and end of line using the home row keys 159 | vim.keymap.set("n", "H", "^") 160 | vim.keymap.set("n", "L", "$") 161 | 162 | -- Read/write all 163 | vim.keymap.set("n", "r", "", { 164 | desc = "Read/write all buffers", 165 | noremap = true, 166 | silent = true, 167 | callback = function() 168 | vim.cmd("checktime") 169 | vim.cmd("silent! wall") 170 | vim.cmd("up") 171 | vim.cmd("redraw!") 172 | end, 173 | }) 174 | 175 | -- Reselect visual block after indent 176 | vim.keymap.set("v", "<", "", ">gv", { noremap = true }) 178 | 179 | -- Alternate buffer 180 | vim.api.nvim_set_keymap("n", ",", "", { noremap = true, silent = true }) 181 | 182 | vim.api.nvim_set_keymap( 183 | "n", 184 | "cf", 185 | [[:lua vim.fn.setreg('*', vim.fn.expand('%'))]], 186 | { noremap = true, silent = true, desc = "Copy relative path to the system clipboard" } 187 | ) 188 | vim.api.nvim_set_keymap( 189 | "n", 190 | "cl", 191 | [[:lua vim.fn.setreg('*', vim.fn.expand('%') .. ':' .. vim.fn.line('.'))]], 192 | { noremap = true, silent = true, desc = "Copy relative path and line number to the system clipboard" } 193 | ) 194 | 195 | -- [[ Basic Autocommands ]] 196 | -- See `:help lua-guide-autocommands` 197 | 198 | -- Highlight when yanking (copying) text 199 | -- Try it with `yap` in normal mode 200 | -- See `:help vim.highlight.on_yank()` 201 | vim.api.nvim_create_autocmd("TextYankPost", { 202 | desc = "Highlight when yanking (copying) text", 203 | group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), 204 | callback = function() 205 | vim.highlight.on_yank() 206 | end, 207 | }) 208 | 209 | -- Enable shada (session) for remembering cursor position and other state 210 | vim.opt.shada = "'1000" -- Save the last 1000 entries 211 | vim.opt.shadafile = vim.fn.stdpath("config") .. "/shada" -- Store the shada file in your config directory 212 | 213 | -- Restore cursor position when opening a file 214 | vim.api.nvim_create_autocmd("BufReadPost", { 215 | pattern = "*", 216 | callback = function() 217 | -- Check if the cursor position is valid and restore it 218 | if vim.fn.line("'\"") > 0 and vim.fn.line("'\"") <= vim.fn.line("$") then 219 | vim.cmd('normal! g`"') -- Restore the cursor to the last position 220 | end 221 | end, 222 | }) 223 | 224 | -- [[ Install `lazy.nvim` plugin manager ]] 225 | -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info 226 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 227 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 228 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 229 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 230 | if vim.v.shell_error ~= 0 then 231 | error("Error cloning lazy.nvim:\n" .. out) 232 | end 233 | end ---@diagnostic disable-next-line: undefined-field 234 | vim.opt.rtp:prepend(lazypath) 235 | 236 | -- [[ Configure and install plugins ]] 237 | -- 238 | -- To check the current status of your plugins, run 239 | -- :Lazy 240 | -- 241 | -- You can press `?` in this menu for help. Use `:q` to close the window 242 | -- 243 | -- To update plugins you can run 244 | -- :Lazy update 245 | -- 246 | -- NOTE: Here is where you install your plugins. 247 | require("lazy").setup( 248 | { 249 | -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 250 | "tpope/vim-sleuth", -- Detect tabstop and shiftwidth automatically 251 | 252 | -- NOTE: Plugins can also be added by using a table, 253 | -- with the first argument being the link and the following 254 | -- keys can be used to configure plugin behavior/loading/etc. 255 | -- 256 | -- Use `opts = {}` to force a plugin to be loaded. 257 | -- 258 | 259 | -- Here is a more advanced example where we pass configuration 260 | -- options to `gitsigns.nvim`. This is equivalent to the following Lua: 261 | -- require('gitsigns').setup({ ... }) 262 | -- 263 | -- See `:help gitsigns` to understand what the configuration keys do 264 | { -- Adds git related signs to the gutter, as well as utilities for managing changes 265 | "lewis6991/gitsigns.nvim", 266 | opts = { 267 | signs = { 268 | add = { text = "+" }, 269 | change = { text = "~" }, 270 | delete = { text = "_" }, 271 | topdelete = { text = "‾" }, 272 | changedelete = { text = "~" }, 273 | }, 274 | }, 275 | }, 276 | 277 | -- NOTE: Plugins can also be configured to run Lua code when they are loaded. 278 | -- 279 | -- This is often very useful to both group configuration, as well as handle 280 | -- lazy loading plugins that don't need to be loaded immediately at startup. 281 | -- 282 | -- For example, in the following configuration, we use: 283 | -- event = 'VimEnter' 284 | -- 285 | -- which loads which-key before all the UI elements are loaded. Events can be 286 | -- normal autocommands events (`:help autocmd-events`). 287 | -- 288 | -- Then, because we use the `opts` key (recommended), the configuration runs 289 | -- after the plugin has been loaded as `require(MODULE).setup(opts)`. 290 | 291 | { -- Useful plugin to show you pending keybinds. 292 | "folke/which-key.nvim", 293 | event = "VimEnter", -- Sets the loading event to 'VimEnter' 294 | opts = { 295 | -- delay between pressing a key and opening which-key (milliseconds) 296 | -- this setting is independent of vim.opt.timeoutlen 297 | delay = 200, 298 | icons = { 299 | -- disable all mapping icons 300 | mappings = false, 301 | -- We're not using a Nerd Font so we need to override the defaults 302 | keys = { 303 | Up = " ", 304 | Down = " ", 305 | Left = " ", 306 | Right = " ", 307 | C = " ", 308 | M = " ", 309 | D = " ", 310 | S = " ", 311 | CR = " ", 312 | Esc = " ", 313 | ScrollWheelDown = " ", 314 | ScrollWheelUp = " ", 315 | NL = " ", 316 | BS = " ", 317 | Space = " ", 318 | Tab = " ", 319 | F1 = "", 320 | F2 = "", 321 | F3 = "", 322 | F4 = "", 323 | F5 = "", 324 | F6 = "", 325 | F7 = "", 326 | F8 = "", 327 | F9 = "", 328 | F10 = "", 329 | F11 = "", 330 | F12 = "", 331 | }, 332 | }, 333 | 334 | -- Document existing key chains 335 | spec = { 336 | { "c", group = "[C]ode", mode = { "n", "x" } }, 337 | { "d", group = "[D]ocument" }, 338 | -- { "r", group = "[R]ename" }, 339 | { "s", group = "[S]earch" }, 340 | { "w", group = "[W]orkspace" }, 341 | { "t", group = "[T]oggle" }, 342 | { "h", group = "Git [H]unk", mode = { "n", "v" } }, 343 | }, 344 | }, 345 | }, 346 | 347 | -- NOTE: Plugins can specify dependencies. 348 | -- 349 | -- The dependencies are proper plugin specifications as well - anything 350 | -- you do for a plugin at the top level, you can do for a dependency. 351 | -- 352 | -- Use the `dependencies` key to specify the dependencies of a particular plugin 353 | 354 | { -- Fuzzy Finder (files, lsp, etc) 355 | "nvim-telescope/telescope.nvim", 356 | event = "VimEnter", 357 | branch = "0.1.x", 358 | dependencies = { 359 | "nvim-lua/plenary.nvim", 360 | { -- If encountering errors, see telescope-fzf-native README for installation instructions 361 | "nvim-telescope/telescope-fzf-native.nvim", 362 | 363 | -- `build` is used to run some command when the plugin is installed/updated. 364 | -- This is only run then, not every time Neovim starts up. 365 | build = "make", 366 | 367 | -- `cond` is a condition used to determine whether this plugin should be 368 | -- installed and loaded. 369 | cond = function() 370 | return vim.fn.executable("make") == 1 371 | end, 372 | }, 373 | { "nvim-telescope/telescope-ui-select.nvim" }, 374 | 375 | -- Create custom pickers easily 376 | { "axkirillov/easypick.nvim" }, 377 | }, 378 | config = function() 379 | -- Telescope is a fuzzy finder that comes with a lot of different things that 380 | -- it can fuzzy find! It's more than just a "file finder", it can search 381 | -- many different aspects of Neovim, your workspace, LSP, and more! 382 | -- 383 | -- The easiest way to use Telescope, is to start by doing something like: 384 | -- :Telescope help_tags 385 | -- 386 | -- After running this command, a window will open up and you're able to 387 | -- type in the prompt window. You'll see a list of `help_tags` options and 388 | -- a corresponding preview of the help. 389 | -- 390 | -- Two important keymaps to use while in Telescope are: 391 | -- - Insert mode: 392 | -- - Normal mode: ? 393 | -- 394 | -- This opens a window that shows you all of the keymaps for the current 395 | -- Telescope picker. This is really useful to discover what Telescope can 396 | -- do as well as how to actually do it! 397 | 398 | -- [[ Configure Telescope ]] 399 | -- See `:help telescope` and `:help telescope.setup()` 400 | require("telescope").setup({ 401 | -- You can put your default mappings / updates / etc. in here 402 | -- All the info you're looking for is in `:help telescope.setup()` 403 | -- 404 | -- defaults = { 405 | -- mappings = { 406 | -- i = { [''] = 'to_fuzzy_refine' }, 407 | -- }, 408 | -- }, 409 | -- pickers = {} 410 | extensions = { 411 | ["ui-select"] = { 412 | require("telescope.themes").get_dropdown(), 413 | }, 414 | }, 415 | }) 416 | 417 | -- Enable Telescope extensions if they are installed 418 | pcall(require("telescope").load_extension, "fzf") 419 | pcall(require("telescope").load_extension, "ui-select") 420 | 421 | -- See `:help telescope.builtin` 422 | local builtin = require("telescope.builtin") 423 | vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) 424 | vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) 425 | vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) 426 | vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) 427 | vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) 428 | vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) 429 | vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) 430 | vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) 431 | 432 | vim.keymap.set("n", "f", builtin.find_files, { desc = "Search [F]iles" }) 433 | vim.keymap.set("n", "l", builtin.buffers, { desc = "[l] Find existing buffers" }) 434 | vim.keymap.set("n", "m", builtin.git_status, { desc = "Modifed in Git" }) 435 | vim.keymap.set("n", "M", ":Easypick changed_files", { desc = "Modifed in Git branch" }) 436 | 437 | vim.keymap.set("n", ",d", function() 438 | builtin.find_files({ cwd = require("telescope.utils").buffer_dir() }) 439 | end, { desc = "List files in the directory relative to the current buffer" }) 440 | 441 | -- Slightly advanced example of overriding default behavior and theme 442 | vim.keymap.set("n", "sb/", function() 443 | -- You can pass additional configuration to Telescope to change the theme, layout, etc. 444 | builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ 445 | winblend = 10, 446 | previewer = false, 447 | })) 448 | end, { desc = "[/] Fuzzily search in current buffer" }) 449 | 450 | -- It's also possible to pass additional configuration options. 451 | -- See `:help telescope.builtin.live_grep()` for information about particular keys 452 | vim.keymap.set("n", "s/", function() 453 | builtin.live_grep({ 454 | grep_open_files = true, 455 | prompt_title = "Live Grep in Open Files", 456 | }) 457 | end, { desc = "[S]earch [/] in Open Files" }) 458 | 459 | -- Easypick 460 | local easypick = require("easypick") 461 | 462 | local get_default_branch = "git remote show origin | grep 'HEAD branch' | cut -d' ' -f5" 463 | local base_branch = vim.fn.system(get_default_branch) or "main" 464 | 465 | local command_palette_list = [[ 466 | << EOF 467 | :Mason " LSP package manager 468 | :Git blame " Git blame 469 | EOF 470 | ]] 471 | 472 | easypick.setup({ 473 | pickers = { 474 | -- add your custom pickers here 475 | -- below you can find some examples of what those can look like 476 | 477 | -- list files inside current folder with default previewer 478 | { 479 | -- name for your custom picker, that can be invoked using :Easypick (supports tab completion) 480 | name = "ls", 481 | -- the command to execute, output has to be a list of plain text entries 482 | command = "ls", 483 | -- specify your custom previwer, or use one of the easypick.previewers 484 | previewer = easypick.previewers.default(), 485 | }, 486 | 487 | -- diff current branch with base_branch and show files that changed with respective diffs in preview 488 | { 489 | name = "changed_files", 490 | command = "git diff --name-only $(git merge-base HEAD " .. base_branch .. " )", 491 | previewer = easypick.previewers.branch_diff({ base_branch = base_branch }), 492 | }, 493 | 494 | -- list files that have conflicts with diffs in preview 495 | { 496 | name = "conflicts", 497 | command = "git diff --name-only --diff-filter=U --relative", 498 | previewer = easypick.previewers.file_diff(), 499 | }, 500 | 501 | { 502 | name = "command_palette", 503 | command = "cat " .. command_palette_list, 504 | -- pass a pre-configured action that runs the command 505 | action = easypick.actions.nvim_command(), 506 | -- you can specify any theme you want, but the dropdown looks good for this example =) 507 | opts = require("telescope.themes").get_dropdown({}), 508 | }, 509 | }, 510 | }) 511 | end, 512 | }, 513 | 514 | -- LSP Plugins 515 | { 516 | -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins 517 | -- used for completion, annotations and signatures of Neovim apis 518 | "folke/lazydev.nvim", 519 | ft = "lua", 520 | opts = { 521 | library = { 522 | -- Load luvit types when the `vim.uv` word is found 523 | { path = "luvit-meta/library", words = { "vim%.uv" } }, 524 | }, 525 | }, 526 | }, 527 | { "Bilal2453/luvit-meta", lazy = true }, 528 | { 529 | -- Main LSP Configuration 530 | "neovim/nvim-lspconfig", 531 | dependencies = { 532 | -- Automatically install LSPs and related tools to stdpath for Neovim 533 | -- Mason must be loaded before its dependents so we need to set it up here. 534 | -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` 535 | { "williamboman/mason.nvim", opts = {} }, 536 | "williamboman/mason-lspconfig.nvim", 537 | "WhoIsSethDaniel/mason-tool-installer.nvim", 538 | 539 | -- Useful status updates for LSP. 540 | -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` 541 | { "j-hui/fidget.nvim", opts = {} }, 542 | 543 | -- Allows extra capabilities provided by nvim-cmp 544 | "hrsh7th/cmp-nvim-lsp", 545 | }, 546 | config = function() 547 | -- Brief aside: **What is LSP?** 548 | -- 549 | -- LSP is an initialism you've probably heard, but might not understand what it is. 550 | -- 551 | -- LSP stands for Language Server Protocol. It's a protocol that helps editors 552 | -- and language tooling communicate in a standardized fashion. 553 | -- 554 | -- In general, you have a "server" which is some tool built to understand a particular 555 | -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers 556 | -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone 557 | -- processes that communicate with some "client" - in this case, Neovim! 558 | -- 559 | -- LSP provides Neovim with features like: 560 | -- - Go to definition 561 | -- - Find references 562 | -- - Autocompletion 563 | -- - Symbol Search 564 | -- - and more! 565 | -- 566 | -- Thus, Language Servers are external tools that must be installed separately from 567 | -- Neovim. This is where `mason` and related plugins come into play. 568 | -- 569 | -- If you're wondering about lsp vs treesitter, you can check out the wonderfully 570 | -- and elegantly composed help section, `:help lsp-vs-treesitter` 571 | 572 | -- This function gets run when an LSP attaches to a particular buffer. 573 | -- That is to say, every time a new file is opened that is associated with 574 | -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this 575 | -- function will be executed to configure the current buffer 576 | vim.api.nvim_create_autocmd("LspAttach", { 577 | group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), 578 | callback = function(event) 579 | -- NOTE: Remember that Lua is a real programming language, and as such it is possible 580 | -- to define small helper and utility functions so you don't have to repeat yourself. 581 | -- 582 | -- In this case, we create a function that lets us more easily define mappings specific 583 | -- for LSP related items. It sets the mode, buffer and description for us each time. 584 | local map = function(keys, func, desc, mode) 585 | mode = mode or "n" 586 | vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) 587 | end 588 | 589 | -- Jump to the definition of the word under your cursor. 590 | -- This is where a variable was first declared, or where a function is defined, etc. 591 | -- To jump back, press . 592 | map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") 593 | 594 | -- Find references for the word under your cursor. 595 | map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") 596 | 597 | -- Jump to the implementation of the word under your cursor. 598 | -- Useful when your language has ways of declaring types without an actual implementation. 599 | map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") 600 | 601 | -- Jump to the type of the word under your cursor. 602 | -- Useful when you're not sure what type a variable is and you want to see 603 | -- the definition of its *type*, not where it was *defined*. 604 | map("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") 605 | 606 | -- Fuzzy find all the symbols in your current document. 607 | -- Symbols are things like variables, functions, types, etc. 608 | map("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") 609 | 610 | -- Fuzzy find all the symbols in your current workspace. 611 | -- Similar to document symbols, except searches over your entire project. 612 | map( 613 | "ws", 614 | require("telescope.builtin").lsp_dynamic_workspace_symbols, 615 | "[W]orkspace [S]ymbols" 616 | ) 617 | 618 | -- Rename the variable under your cursor. 619 | -- Most Language Servers support renaming across files, etc. 620 | -- TODO: Conflicts with `r` 621 | -- map("rn", vim.lsp.buf.rename, "[R]e[n]ame") 622 | 623 | -- Execute a code action, usually your cursor needs to be on top of an error 624 | -- or a suggestion from your LSP for this to activate. 625 | map("ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" }) 626 | 627 | -- WARN: This is not Goto Definition, this is Goto Declaration. 628 | -- For example, in C this would take you to the header. 629 | map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") 630 | 631 | -- The following two autocommands are used to highlight references of the 632 | -- word under your cursor when your cursor rests there for a little while. 633 | -- See `:help CursorHold` for information about when this is executed 634 | -- 635 | -- When you move your cursor, the highlights will be cleared (the second autocommand). 636 | local client = vim.lsp.get_client_by_id(event.data.client_id) 637 | if 638 | client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) 639 | then 640 | local highlight_augroup = 641 | vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) 642 | vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { 643 | buffer = event.buf, 644 | group = highlight_augroup, 645 | callback = vim.lsp.buf.document_highlight, 646 | }) 647 | 648 | vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { 649 | buffer = event.buf, 650 | group = highlight_augroup, 651 | callback = vim.lsp.buf.clear_references, 652 | }) 653 | 654 | vim.api.nvim_create_autocmd("LspDetach", { 655 | group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), 656 | callback = function(event2) 657 | vim.lsp.buf.clear_references() 658 | vim.api.nvim_clear_autocmds({ 659 | group = "kickstart-lsp-highlight", 660 | buffer = event2.buf, 661 | }) 662 | end, 663 | }) 664 | end 665 | 666 | -- The following code creates a keymap to toggle inlay hints in your 667 | -- code, if the language server you are using supports them 668 | -- 669 | -- This may be unwanted, since they displace some of your code 670 | if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then 671 | map("th", function() 672 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) 673 | end, "[T]oggle Inlay [H]ints") 674 | end 675 | end, 676 | }) 677 | 678 | -- LSP servers and clients are able to communicate to each other what features they support. 679 | -- By default, Neovim doesn't support everything that is in the LSP specification. 680 | -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. 681 | -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. 682 | local capabilities = vim.lsp.protocol.make_client_capabilities() 683 | capabilities = 684 | vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) 685 | 686 | -- Enable the following language servers 687 | -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. 688 | -- 689 | -- Add any additional override configuration in the following tables. Available keys are: 690 | -- - cmd (table): Override the default command used to start the server 691 | -- - filetypes (table): Override the default list of associated filetypes for the server 692 | -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. 693 | -- - settings (table): Override the default settings passed when initializing the server. 694 | -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ 695 | local servers = { 696 | -- clangd = {}, 697 | -- gopls = {}, 698 | -- pyright = {}, 699 | -- rust_analyzer = {}, 700 | -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs 701 | -- 702 | -- Some languages (like typescript) have entire language plugins that can be useful: 703 | -- https://github.com/pmizio/typescript-tools.nvim 704 | -- 705 | -- But for many setups, the LSP (`ts_ls`) will work just fine 706 | -- ts_ls = {}, 707 | -- 708 | 709 | lua_ls = { 710 | -- cmd = { ... }, 711 | -- filetypes = { ... }, 712 | -- capabilities = {}, 713 | settings = { 714 | Lua = { 715 | completion = { 716 | callSnippet = "Replace", 717 | }, 718 | -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings 719 | -- diagnostics = { disable = { 'missing-fields' } }, 720 | }, 721 | }, 722 | }, 723 | } 724 | 725 | -- Ensure the servers and tools above are installed 726 | -- 727 | -- To check the current status of installed tools and/or manually install 728 | -- other tools, you can run 729 | -- :Mason 730 | -- 731 | -- You can press `g?` for help in this menu. 732 | -- 733 | -- `mason` had to be setup earlier: to configure its options see the 734 | -- `dependencies` table for `nvim-lspconfig` above. 735 | -- 736 | -- You can add other tools here that you want Mason to install 737 | -- for you, so that they are available from within Neovim. 738 | local ensure_installed = vim.tbl_keys(servers or {}) 739 | vim.list_extend(ensure_installed, { 740 | "stylua", -- Used to format Lua code 741 | }) 742 | require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) 743 | 744 | ---@diagnostic disable-next-line: missing-fields 745 | require("mason-lspconfig").setup({ 746 | handlers = { 747 | function(server_name) 748 | local server = servers[server_name] or {} 749 | -- This handles overriding only values explicitly passed 750 | -- by the server configuration above. Useful when disabling 751 | -- certain features of an LSP (for example, turning off formatting for ts_ls) 752 | server.capabilities = 753 | vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) 754 | require("lspconfig")[server_name].setup(server) 755 | end, 756 | }, 757 | }) 758 | end, 759 | }, 760 | 761 | { -- Autoformat 762 | "stevearc/conform.nvim", 763 | event = { "BufWritePre" }, 764 | cmd = { "ConformInfo" }, 765 | keys = { 766 | { 767 | "f", 768 | function() 769 | require("conform").format({ async = true, lsp_format = "fallback" }) 770 | end, 771 | mode = "", 772 | desc = "[F]ormat buffer", 773 | }, 774 | }, 775 | opts = { 776 | notify_on_error = false, 777 | format_on_save = function(bufnr) 778 | -- Disable "format_on_save lsp_fallback" for languages that don't 779 | -- have a well standardized coding style. You can add additional 780 | -- languages here or re-enable it for the disabled ones. 781 | local disable_filetypes = { c = true, cpp = true } 782 | local lsp_format_opt 783 | if disable_filetypes[vim.bo[bufnr].filetype] then 784 | lsp_format_opt = "never" 785 | else 786 | lsp_format_opt = "fallback" 787 | end 788 | return { 789 | timeout_ms = 500, 790 | lsp_format = lsp_format_opt, 791 | } 792 | end, 793 | formatters_by_ft = { 794 | lua = { "stylua" }, 795 | -- Conform can also run multiple formatters sequentially 796 | -- python = { "isort", "black" }, 797 | -- 798 | -- You can use 'stop_after_first' to run the first available formatter from the list 799 | -- javascript = { "prettierd", "prettier", stop_after_first = true }, 800 | }, 801 | }, 802 | }, 803 | 804 | { -- Autocompletion 805 | "hrsh7th/nvim-cmp", 806 | event = "InsertEnter", 807 | dependencies = { 808 | -- Snippet Engine & its associated nvim-cmp source 809 | { 810 | "L3MON4D3/LuaSnip", 811 | build = (function() 812 | -- Build Step is needed for regex support in snippets. 813 | -- This step is not supported in many windows environments. 814 | -- Remove the below condition to re-enable on windows. 815 | if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then 816 | return 817 | end 818 | return "make install_jsregexp" 819 | end)(), 820 | dependencies = { 821 | -- `friendly-snippets` contains a variety of premade snippets. 822 | -- See the README about individual language/framework/plugin snippets: 823 | -- https://github.com/rafamadriz/friendly-snippets 824 | -- { 825 | -- 'rafamadriz/friendly-snippets', 826 | -- config = function() 827 | -- require('luasnip.loaders.from_vscode').lazy_load() 828 | -- end, 829 | -- }, 830 | }, 831 | }, 832 | "saadparwaiz1/cmp_luasnip", 833 | 834 | -- Adds other completion capabilities. 835 | -- nvim-cmp does not ship with all sources by default. They are split 836 | -- into multiple repos for maintenance purposes. 837 | "hrsh7th/cmp-nvim-lsp", 838 | "hrsh7th/cmp-path", 839 | }, 840 | config = function() 841 | -- See `:help cmp` 842 | local cmp = require("cmp") 843 | local luasnip = require("luasnip") 844 | luasnip.config.setup({}) 845 | 846 | cmp.setup({ 847 | snippet = { 848 | expand = function(args) 849 | luasnip.lsp_expand(args.body) 850 | end, 851 | }, 852 | completion = { completeopt = "menu,menuone,noinsert" }, 853 | 854 | -- For an understanding of why these mappings were 855 | -- chosen, you will need to read `:help ins-completion` 856 | -- 857 | -- No, but seriously. Please read `:help ins-completion`, it is really good! 858 | mapping = cmp.mapping.preset.insert({ 859 | -- Select the [n]ext item 860 | [""] = cmp.mapping.select_next_item(), 861 | -- Select the [p]revious item 862 | [""] = cmp.mapping.select_prev_item(), 863 | 864 | -- Scroll the documentation window [b]ack / [f]orward 865 | [""] = cmp.mapping.scroll_docs(-4), 866 | [""] = cmp.mapping.scroll_docs(4), 867 | 868 | -- Accept ([y]es) the completion. 869 | -- This will auto-import if your LSP supports it. 870 | -- This will expand snippets if the LSP sent a snippet. 871 | [""] = cmp.mapping.confirm({ select = true }), 872 | 873 | -- If you prefer more traditional completion keymaps, 874 | -- you can uncomment the following lines 875 | --[''] = cmp.mapping.confirm { select = true }, 876 | --[''] = cmp.mapping.select_next_item(), 877 | --[''] = cmp.mapping.select_prev_item(), 878 | 879 | -- Manually trigger a completion from nvim-cmp. 880 | -- Generally you don't need this, because nvim-cmp will display 881 | -- completions whenever it has completion options available. 882 | [""] = cmp.mapping.complete({}), 883 | 884 | -- Think of as moving to the right of your snippet expansion. 885 | -- So if you have a snippet that's like: 886 | -- function $name($args) 887 | -- $body 888 | -- end 889 | -- 890 | -- will move you to the right of each of the expansion locations. 891 | -- is similar, except moving you backwards. 892 | [""] = cmp.mapping(function() 893 | if luasnip.expand_or_locally_jumpable() then 894 | luasnip.expand_or_jump() 895 | end 896 | end, { "i", "s" }), 897 | [""] = cmp.mapping(function() 898 | if luasnip.locally_jumpable(-1) then 899 | luasnip.jump(-1) 900 | end 901 | end, { "i", "s" }), 902 | 903 | -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: 904 | -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps 905 | }), 906 | sources = { 907 | { 908 | name = "lazydev", 909 | -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it 910 | group_index = 0, 911 | }, 912 | { name = "nvim_lsp" }, 913 | { name = "luasnip" }, 914 | { name = "path" }, 915 | }, 916 | }) 917 | end, 918 | }, 919 | 920 | { -- You can easily change to a different colorscheme. 921 | -- Change the name of the colorscheme plugin below, and then 922 | -- change the command in the config to whatever the name of that colorscheme is. 923 | -- 924 | -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. 925 | "nanotech/jellybeans.vim", 926 | priority = 1000, -- Make sure to load this before all the other start plugins. 927 | init = function() 928 | -- Load the colorscheme here. 929 | -- Like many other themes, this one has different styles, and you could load 930 | -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. 931 | vim.cmd.colorscheme("jellybeans") 932 | 933 | -- You can configure highlights by doing something like: 934 | vim.cmd.hi("Comment gui=none") 935 | end, 936 | }, 937 | 938 | -- Highlight todo, notes, etc in comments 939 | { 940 | "folke/todo-comments.nvim", 941 | event = "VimEnter", 942 | dependencies = { "nvim-lua/plenary.nvim" }, 943 | opts = { signs = false }, 944 | }, 945 | 946 | { -- Collection of various small independent plugins/modules 947 | "echasnovski/mini.nvim", 948 | config = function() 949 | -- Better Around/Inside textobjects 950 | -- 951 | -- Examples: 952 | -- - va) - [V]isually select [A]round [)]paren 953 | -- - yinq - [Y]ank [I]nside [N]ext [Q]uote 954 | -- - ci' - [C]hange [I]nside [']quote 955 | require("mini.ai").setup({ n_lines = 500 }) 956 | 957 | -- Add/delete/replace surroundings (brackets, quotes, etc.) 958 | -- 959 | -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren 960 | -- - sd' - [S]urround [D]elete [']quotes 961 | -- - sr)' - [S]urround [R]eplace [)] ['] 962 | require("mini.surround").setup() 963 | 964 | -- ... and there is more! 965 | -- Check out: https://github.com/echasnovski/mini.nvim 966 | end, 967 | }, 968 | { -- Highlight, edit, and navigate code 969 | "nvim-treesitter/nvim-treesitter", 970 | build = ":TSUpdate", 971 | main = "nvim-treesitter.configs", -- Sets main module to use for opts 972 | -- [[ Configure Treesitter ]] See `:help nvim-treesitter` 973 | opts = { 974 | ensure_installed = { 975 | "bash", 976 | "c", 977 | "diff", 978 | "html", 979 | "lua", 980 | "luadoc", 981 | "markdown", 982 | "markdown_inline", 983 | "query", 984 | "vim", 985 | "vimdoc", 986 | }, 987 | -- Autoinstall languages that are not installed 988 | auto_install = true, 989 | highlight = { 990 | enable = true, 991 | -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. 992 | -- If you are experiencing weird indenting issues, add the language to 993 | -- the list of additional_vim_regex_highlighting and disabled languages for indent. 994 | additional_vim_regex_highlighting = { "ruby" }, 995 | }, 996 | indent = { enable = true, disable = { "ruby" } }, 997 | }, 998 | -- There are additional nvim-treesitter modules that you can use to interact 999 | -- with nvim-treesitter. You should go explore a few and see what interests you: 1000 | -- 1001 | -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` 1002 | -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context 1003 | -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects 1004 | }, 1005 | 1006 | -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the 1007 | -- init.lua. If you want these files, they are in the repository, so you can just download them and 1008 | -- place them in the correct locations. 1009 | 1010 | -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart 1011 | -- 1012 | -- Here are some example plugins that I've included in the Kickstart repository. 1013 | -- Uncomment any of the lines below to enable them (you will need to restart nvim). 1014 | -- 1015 | -- require 'kickstart.plugins.debug', 1016 | -- require 'kickstart.plugins.indent_line', 1017 | -- require 'kickstart.plugins.lint', 1018 | -- require 'kickstart.plugins.autopairs', 1019 | -- require 'kickstart.plugins.neo-tree', 1020 | require("plugins.gitsigns"), -- adds gitsigns recommend keymaps 1021 | 1022 | -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` 1023 | -- This is the easiest way to modularize your config. 1024 | -- 1025 | -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. 1026 | -- { import = 'custom.plugins' }, 1027 | -- 1028 | -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` 1029 | -- Or use telescope! 1030 | -- In normal mode type `sh` then write `lazy.nvim-plugin` 1031 | -- you can continue same window with `sr` which resumes last telescope search 1032 | 1033 | -- Directory viewer for Vim 1034 | "justinmk/vim-dirvish", 1035 | 1036 | -- A light and configurable statusline/tabline plugin for Vim 1037 | "itchyny/lightline.vim", 1038 | 1039 | -- Helpers for UNIX (:Move, :Unlink, etc.) 1040 | "tpope/vim-eunuch", 1041 | }, 1042 | 1043 | ---@diagnostic disable-next-line: missing-fields 1044 | { 1045 | ui = { 1046 | -- We're not using a Nerd Font so we need to override the defaults 1047 | icons = { 1048 | cmd = "⌘", 1049 | config = "🛠", 1050 | event = "📅", 1051 | ft = "📂", 1052 | init = "⚙", 1053 | keys = "🗝", 1054 | plugin = "🔌", 1055 | runtime = "💻", 1056 | require = "🌙", 1057 | source = "📄", 1058 | start = "🚀", 1059 | task = "📌", 1060 | lazy = "💤 ", 1061 | }, 1062 | }, 1063 | } 1064 | ) 1065 | 1066 | -- The line beneath this is called `modeline`. See `:help modeline` 1067 | -- vim: ts=2 sts=2 sw=2 et 1068 | -------------------------------------------------------------------------------- /config/nvim/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | -- Adds git related signs to the gutter, as well as utilities for managing changes 2 | -- NOTE: gitsigns is already included in init.lua but contains only the base 3 | -- config. This will add also the recommended keymaps. 4 | 5 | return { 6 | { 7 | "lewis6991/gitsigns.nvim", 8 | opts = { 9 | on_attach = function(bufnr) 10 | local gitsigns = require("gitsigns") 11 | 12 | local function map(mode, l, r, opts) 13 | opts = opts or {} 14 | opts.buffer = bufnr 15 | vim.keymap.set(mode, l, r, opts) 16 | end 17 | 18 | -- nmap ]d (GitGutterNextHunk) 19 | -- nmap [d (GitGutterPrevHunk) 20 | 21 | -- Navigation 22 | map("n", "]c", function() 23 | if vim.wo.diff then 24 | vim.cmd.normal({ "]c", bang = true }) 25 | else 26 | gitsigns.nav_hunk("next") 27 | end 28 | end, { desc = "Jump to next git [c]hange" }) 29 | 30 | map("n", "[c", function() 31 | if vim.wo.diff then 32 | vim.cmd.normal({ "[c", bang = true }) 33 | else 34 | gitsigns.nav_hunk("prev") 35 | end 36 | end, { desc = "Jump to previous git [c]hange" }) 37 | 38 | -- Actions 39 | -- visual mode 40 | -- map("v", "hs", function() 41 | -- gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) 42 | -- end, { desc = "git [s]tage hunk" }) 43 | -- map("v", "hr", function() 44 | -- gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) 45 | -- end, { desc = "git [r]eset hunk" }) 46 | -- normal mode 47 | -- map("n", "hs", gitsigns.stage_hunk, { desc = "git [s]tage hunk" }) 48 | -- map("n", "hr", gitsigns.reset_hunk, { desc = "git [r]eset hunk" }) 49 | -- map("n", "hS", gitsigns.stage_buffer, { desc = "git [S]tage buffer" }) 50 | -- map("n", "hu", gitsigns.undo_stage_hunk, { desc = "git [u]ndo stage hunk" }) 51 | -- map("n", "hR", gitsigns.reset_buffer, { desc = "git [R]eset buffer" }) 52 | -- map("n", "hp", gitsigns.preview_hunk, { desc = "git [p]review hunk" }) 53 | -- map("n", "hb", gitsigns.blame_line, { desc = "git [b]lame line" }) 54 | -- map("n", "hd", gitsigns.diffthis, { desc = "git [d]iff against index" }) 55 | -- map("n", "hD", function() 56 | -- gitsigns.diffthis("@") 57 | -- end, { desc = "git [D]iff against last commit" }) 58 | -- -- Toggles 59 | -- map("n", "tb", gitsigns.toggle_current_line_blame, { desc = "[T]oggle git show [b]lame line" }) 60 | -- map("n", "tD", gitsigns.toggle_deleted, { desc = "[T]oggle git show [D]eleted" }) 61 | end, 62 | }, 63 | }, 64 | } 65 | -------------------------------------------------------------------------------- /config/pryrc: -------------------------------------------------------------------------------- 1 | # coding:utf-8 vim:ft=ruby 2 | 3 | Pry.config.pager = true 4 | Pry.config.color = true 5 | 6 | # wrap ANSI codes so Readline knows where the prompt ends 7 | def colour(name, text) 8 | if Pry.color 9 | "\001#{Pry::Helpers::Text.send name, '{text}'}\002".sub '{text}', "\002#{text}\001" 10 | else 11 | text 12 | end 13 | end 14 | 15 | # tell Readline when the window resizes 16 | old_winch = trap 'WINCH' do 17 | if `stty size` =~ /\A(\d+) (\d+)\n\z/ 18 | Readline.set_screen_size $1.to_i, $2.to_i 19 | end 20 | old_winch.call unless old_winch.nil? || old_winch == 'SYSTEM_DEFAULT' 21 | end 22 | 23 | # startup hooks 24 | org_logger_active_record = nil 25 | org_logger_rails = nil 26 | Pry.hooks.add_hook :before_session, :rails do |output, target, pry| 27 | # show ActiveRecord SQL queries in the console 28 | if defined? ActiveRecord 29 | org_logger_active_record = ActiveRecord::Base.logger 30 | ActiveRecord::Base.logger = Logger.new STDOUT 31 | end 32 | 33 | if defined?(Rails) && Rails.env 34 | # output all other log info such as deprecation warnings to the console 35 | if Rails.respond_to? :logger= 36 | org_logger_rails = Rails.logger 37 | Rails.logger = Logger.new STDOUT 38 | end 39 | 40 | # load Rails console commands 41 | if Rails::VERSION::MAJOR >= 3 42 | require 'rails/console/app' 43 | require 'rails/console/helpers' 44 | if Rails.const_defined? :ConsoleMethods 45 | extend Rails::ConsoleMethods 46 | end 47 | else 48 | require 'console_app' 49 | require 'console_with_helpers' 50 | end 51 | end 52 | end 53 | 54 | Pry.hooks.add_hook :after_session, :rails do |output, target, pry| 55 | ActiveRecord::Base.logger = org_logger_active_record if org_logger_active_record 56 | Rails.logger = org_logger_rails if org_logger_rails 57 | end 58 | -------------------------------------------------------------------------------- /config/ranger/rc.conf: -------------------------------------------------------------------------------- 1 | # Find the defaults: 2 | # 3 | # /usr/local/Cellar/ranger/1.6.1/libexec/ranger/config/rc.conf 4 | 5 | # Ask for a confirmation when running the "delete" command? 6 | # Valid values are "always" (default), "never", "multiple" 7 | # With "multiple", ranger will ask only if you delete multiple files at once. 8 | set confirm_on_delete always 9 | 10 | # Be aware of version control systems and display information. 11 | set vcs_aware true 12 | 13 | # The possible states are disabled, local (only show local info), 14 | # enabled (show local and remote information). 15 | set vcs_backend_git enabled 16 | 17 | # Use a unicode "..." character to mark cut-off filenames? 18 | set unicode_ellipsis true 19 | 20 | # Draw borders around columns? 21 | set draw_borders true 22 | 23 | # Set the title to "ranger" in the tmux program? 24 | set update_tmux_title true 25 | 26 | # Abbreviate $HOME with ~ in the titlebar (first line) of ranger? 27 | set tilde_in_titlebar true 28 | -------------------------------------------------------------------------------- /config/ssh/config: -------------------------------------------------------------------------------- 1 | Host * 2 | UseKeychain yes 3 | AddKeysToAgent yes 4 | IdentityFile ~/.ssh/id_rsa 5 | IdentityFile ~/.ssh/id_ed25519 6 | IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" 7 | 8 | # vim: ft=sshconfig:sw=2:ts=2 9 | -------------------------------------------------------------------------------- /config/tmux.conf: -------------------------------------------------------------------------------- 1 | bind y run-shell "reattach-to-user-namespace -l sh -c 'tmux show-buffer | pbcopy'" 2 | bind-key C-l send-keys -R 3 | set -g prefix2 C-g 4 | -------------------------------------------------------------------------------- /freshrc: -------------------------------------------------------------------------------- 1 | # vim: set ft=sh: 2 | 3 | fresh freshshell/fresh bin/fresh --bin 4 | fresh freshshell/fresh contrib/completion/fresh-completion.zsh --file=completion/_fresh 5 | fresh freshshell/fresh-open bin/fresh-open --bin 6 | 7 | # Config 8 | fresh-options --file 9 | fresh config/\* 10 | fresh jasoncodes/dotfiles config/inputrc 11 | # NOTE: --file should not be needed here, this seems to be a fresh (Perl) bug. 12 | fresh jasoncodes/dotfiles config/tmux.conf --marker --file 13 | fresh jasoncodes/dotfiles config/psqlrc 14 | fresh-options 15 | 16 | fresh config/ranger/rc.conf --file=~/.config/ranger/rc.conf 17 | fresh config/kwm/kwmrc --file=~/.kwm/kwmrc 18 | fresh config/alacritty/alacritty.yml --file=~/.config/alacritty/alacritty.yml 19 | fresh jasoncodes/dotfiles hammerspoon/\*.lua --file=~/.hammerspoon/init.lua 20 | fresh EugeneDae/Force-Paste main.scpt --file=~/Library/Scripts/force-paste.scpt 21 | 22 | fresh config/nvim/init.lua --file=~/.config/nvim/init.lua 23 | fresh config/nvim/plugins/gitsigns.lua --file=~/.config/nvim/lua/plugins/gitsigns.lua 24 | 25 | fresh-options --file=~/.ssh/config --marker 26 | fresh config/ssh/config 27 | fresh config/ssh/config.local --ignore-missing 28 | fresh-options 29 | 30 | # Zsh 31 | fresh-options --file=~/.zshrc --marker 32 | fresh shell/zsh/completion.zsh 33 | if [ -x "$(command -v aurora_prompt)" ]; then 34 | fresh shell/zsh/aurora_prompt.zsh 35 | else 36 | fresh shell/zsh/prompt.zsh 37 | fi 38 | fresh shell/zsh/title.zsh 39 | fresh shell/zsh/aliases.zsh 40 | fresh shell/zsh/zshrc 41 | fresh shell/zsh/keybindings.zsh 42 | fresh shell/zsh/selecta.zsh 43 | fresh shell/zsh/tmux-words.zsh 44 | 45 | fresh junegunn/fzf shell/completion.zsh 46 | fresh junegunn/fzf shell/key-bindings.zsh 47 | 48 | # This loads the shell files and needs to be at the bottom of the zshrc for 49 | # compdef be availiable 50 | fresh freshshell/fresh contrib/source-build.sh 51 | 52 | # Needs to be below contrib/source-build.sh for $PATH to be set up 53 | fresh shell/zsh/direnv.zsh 54 | 55 | fresh rupa/z z.sh 56 | fresh shell/functions/z.sh 57 | fresh robbyrussell/oh-my-zsh lib/edit-command-line.zsh --ref=a38774c 58 | fresh robbyrussell/oh-my-zsh plugins/git-flow/git-flow.plugin.zsh --ref=df30eae 59 | fresh bjeanes/dot-files shells/zsh/lib/completion-waiting-dots.zsh 60 | 61 | fresh rimraf/k k.sh 62 | fresh-options 63 | 64 | fresh zsh-users/zsh-completions src/_heroku --file=completion/_heroku --ref=779b602 65 | fresh robbyrussell/oh-my-zsh plugins/brew/_brew --file=completion/_brew --ref=55f09f8 66 | fresh shell/zsh/completions/_gh --file=completion/_gh 67 | fresh thoughtbot/dotfiles zsh/completion/_ag --file=completion/_ag 68 | 69 | fresh zsh-users/zsh-syntax-highlighting zsh-syntax-highlighting.zsh --file=vendor/zsh-syntax-highlighting.zsh 70 | fresh zsh-users/zsh-syntax-highlighting highlighters/main/main-highlighter.zsh --file=vendor/highlighters/main/main-highlighter.zsh 71 | fresh zsh-users/zsh-syntax-highlighting highlighters/brackets/brackets-highlighter.zsh --file=vendor/highlighters/brackets/brackets-highlighter.zsh 72 | fresh zsh-users/zsh-syntax-highlighting .version --file=vendor/.version 73 | fresh zsh-users/zsh-syntax-highlighting .revision-hash --file=vendor/.revision-hash 74 | fresh shell/zsh/zsh-syntax-highlighting.zsh --file=~/.zshrc 75 | 76 | filter_vundle_lines() { 77 | grep -v ^Bundle 78 | } 79 | 80 | # Vim 81 | fresh-options --file=~/.vimrc --marker='"' 82 | fresh vim/leader.vim 83 | fresh vim/plug.vim 84 | fresh vim/config/\* 85 | fresh vim/vimrc 86 | fresh jasoncodes/dotfiles vim/mappings/indent.vim 87 | fresh jasoncodes/dotfiles vim/mappings/pasteboard.vim 88 | fresh jasoncodes/dotfiles vim/mappings/whitespace.vim --filter=filter_vundle_lines 89 | fresh jasoncodes/dotfiles vim/config/undo.vim 90 | fresh jasoncodes/dotfiles vim/config/auto_mkdir.vim 91 | fresh jasoncodes/dotfiles vim/config/search.vim --filter=filter_vundle_lines 92 | fresh jasoncodes/dotfiles vim/config/cursor.vim 93 | fresh jasoncodes/dotfiles vim/config/bubbling.vim --filter=filter_vundle_lines 94 | fresh jasoncodes/dotfiles vim/functions.vim 95 | fresh jasoncodes/dotfiles vim/plugins/markdown.vim --filter=filter_vundle_lines 96 | fresh jasoncodes/dotfiles vim/plugins/ruby.vim --filter=filter_vundle_lines 97 | fresh hackling/dotfiles vim/keybindings/filename-to-clipboard.vim 98 | fresh-options 99 | fresh vim/gvimrc --file 100 | fresh vim/colors --file=~/.vim/colors/ 101 | fresh junegunn/vim-plug plug.vim --file=~/.vim/autoload/plug.vim 102 | fresh vim/coc-settings.json --file=~/.vim/coc-settings.json 103 | 104 | # Shell 105 | fresh jasoncodes/dotfiles shell/aliases/\* 106 | fresh jasoncodes/dotfiles shell/editor.sh 107 | fresh jasoncodes/dotfiles shell/config/filters.sh 108 | fresh jasoncodes/dotfiles shell/config/pager.sh 109 | fresh jasoncodes/dotfiles shell/config/heroku.sh 110 | fresh jasoncodes/dotfiles shell/config/chruby.sh 111 | fresh jasoncodes/dotfiles shell/config/tmux.sh 112 | fresh jasoncodes/dotfiles shell/functions/realpath.sh 113 | 114 | if type nodenv &> /dev/null; then 115 | fresh shell/nodenv.sh 116 | fi 117 | fresh shell/exports.sh 118 | fresh shell/aliases/\* 119 | fresh shell/functions/\* 120 | fresh shell/asdf.sh 121 | 122 | # bin 123 | fresh-options --bin 124 | fresh bin/\* 125 | fresh twe4ked/catacomb bin/catacomb 126 | fresh twe4ked/twitter-whois bin/twitter-whois 127 | fresh jasoncodes/dotfiles bin/\* 128 | fresh jasoncodes/dotfiles bin/wemux/\* 129 | fresh pengwynn/dotfiles bin/git-go 130 | fresh defunkt/repl bin/repl 131 | fresh garybernhardt/selecta selecta 132 | fresh garybernhardt/dotfiles bin/field 133 | fresh garybernhardt/dotfiles bin/run-command-on-git-revisions 134 | fresh pengwynn/dotfiles bin/git-pr 135 | fresh pengwynn/dotfiles bin/mx 136 | fresh sj26/git-buildkite git-buildkite 137 | fresh gnachman/iTerm2 tests/imgcat 138 | if type gawk &> /dev/null; then 139 | fresh numcommand/num bin/num 140 | fi 141 | fresh fidian/ansi ansi 142 | fresh-options 143 | fresh sivel/speedtest-cli speedtest.py --bin=~/bin/speedtest 144 | fresh rauchg/wifi-password wifi-password.sh --bin=~/bin/wifi-password 145 | fresh dokku/dokku contrib/dokku_client.sh --bin=~/bin/dokku 146 | fresh chendo/airchat airchat.rb --bin=~/bin/airchat 147 | 148 | fresh_after_build() { 149 | if which chflags &> /dev/null; then 150 | chflags hidden ~/bin 151 | fi 152 | 153 | if [[ ! -L ~/bin/diff-highlight ]]; then 154 | if [[ -x /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight ]]; then 155 | ln -s /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight ~/bin/diff-highlight 156 | else 157 | echo "WARNING: Cannot find diff-highlight executable from homebrew git installation." 158 | fi 159 | fi 160 | } 161 | -------------------------------------------------------------------------------- /git-hooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copy file to: .git/hooks/prepare-commit-msg 4 | 5 | COMMIT_MSG_FILE=$1 6 | COMMIT_SOURCE=$2 7 | SHA1=$3 8 | 9 | list_recent_commits() { 10 | LOG=$(git --no-pager log --pretty='#\t%Creset%s' --no-merges -10) 11 | echo "\n# Recent Commits:\n#\n$LOG\n#`cat $COMMIT_MSG_FILE`" > "$COMMIT_MSG_FILE" 12 | } 13 | 14 | # You might need to consider squashes 15 | case "$COMMIT_SOURCE,$SHA1" in 16 | # Commits that already have a message 17 | commit,?*) 18 | ;; 19 | 20 | # Messages are one line messages you decide how to handle 21 | message,) 22 | ;; 23 | 24 | # Merge commits 25 | merge,) 26 | ;; 27 | 28 | # Non-merges with no prior messages 29 | *) 30 | list_recent_commits 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /shell/aliases/aliases.sh: -------------------------------------------------------------------------------- 1 | alias ls="ls -F" 2 | alias ll="ls -lGFh" 3 | alias history="fc -l 1" 4 | alias internet\?="ping 8.8.8.8" 5 | alias b="bundle check || bundle install --local || bundle install" 6 | alias dev="cd $HOME/Dev" 7 | alias serve="python -m SimpleHTTPServer" 8 | alias ip='curl curlmyip.com' 9 | alias lockscreen='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend' 10 | alias spotify='open -a Spotify' 11 | alias path='echo "$PATH" | tr ":" "\n"' 12 | alias hex="ruby -e 'puts Integer(ARGV[0]).to_s(16)'" 13 | alias vim="echo nvim" # use `command nvim` if you really need to 14 | 15 | # cat with highlight 16 | alias cah="pygmentize -g" 17 | 18 | # highest rated results first 19 | alias z="_z -r 2>&1" 20 | 21 | # strips formatting from pasteboard 22 | alias scrub='pbpaste | pbcopy' 23 | 24 | # copy with a progress bar. 25 | alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" 26 | 27 | alias inflate='ruby -r zlib -e "STDOUT.write Zlib::Inflate.inflate(STDIN.read)"' 28 | 29 | d() { 30 | if [[ -n "$1" ]]; then 31 | cd "+$1" 32 | else 33 | dirs -v 34 | fi 35 | } 36 | 37 | # source dotfiles 38 | reload() { 39 | source $HOME/.zshrc && 40 | echo "Your dot files are now \033[1;32msourced\033[0m." 41 | } 42 | 43 | format_uuid() { 44 | echo "$1" | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{12})/\1-\2-\3-\4-\5/' | tr '[:upper:]' '[:lower:]' 45 | } 46 | 47 | find_port_in_use() { 48 | # https://stackoverflow.com/a/4421674/826820 49 | lsof -nP "-i4TCP:$1" | grep LISTEN 50 | } 51 | 52 | # Ripgrep word-boundary 53 | rgwb() { 54 | rg "\b$1\b" 55 | } 56 | 57 | alias rgh="rg --hidden" 58 | 59 | http-statuses() { 60 | cat< 0 ]]; then 41 | message="WIP: $*" 42 | else 43 | message="WIP" 44 | fi 45 | 46 | git commit -m "$(printf "$message\n\n[ci skip]\n")" 47 | } 48 | 49 | git-list-files-ordered-by-date() { 50 | git ls-tree -r --name-only HEAD "$@" | while read filename; do 51 | echo "$(git log -1 --format="%ai" -- $filename) $filename" 52 | done | sort 53 | } 54 | 55 | git-branch-delete-merged() { 56 | git branch --merged | grep -vwE 'main|master' 57 | 58 | echo -n "Delete branches [Y/n]? " 59 | read answer 60 | case $answer in 61 | [Yy]*|"") 62 | git branch --merged | grep -vwE 'main|master' | xargs git branch -d 63 | ;; 64 | *) 65 | return 66 | ;; 67 | esac 68 | } 69 | -------------------------------------------------------------------------------- /shell/aliases/ruby.sh: -------------------------------------------------------------------------------- 1 | alias open_saved_page="find tmp/capybara | tail -1 | xargs open" 2 | alias serve-ruby="ruby -run -e httpd . -p 5000" 3 | alias rspec-run-individual="find spec -name '*_spec.rb' -exec bundle exec rspec '{}' \;" 4 | alias rc="bundle exec rails console" 5 | 6 | fs() { 7 | INPUT="${@:-all}" 8 | PROCS="$(echo $INPUT | sed "s/ /=1,/g")=1" 9 | 10 | echo "foreman start -m $PROCS" 11 | 12 | if [[ -x ./bin/foreman ]]; then 13 | ./bin/foreman start -m "$PROCS" 14 | else 15 | foreman start -m "$PROCS" 16 | fi 17 | } 18 | 19 | standardrb_branch() { 20 | git diff $(git merge-base origin/HEAD HEAD).. --name-only --diff-filter=d | 21 | xargs bundle exec standardrb --only-recognized-file-types --format=progress --fix 22 | } 23 | alias standardrb-branch=standardrb_branch 24 | -------------------------------------------------------------------------------- /shell/asdf.sh: -------------------------------------------------------------------------------- 1 | if command -v brew &> /dev/null; then 2 | source "$(brew --prefix)/opt/asdf/libexec/asdf.sh" 3 | else 4 | echo "WARN: Failed to load asdf via brew" 5 | fi 6 | -------------------------------------------------------------------------------- /shell/exports.sh: -------------------------------------------------------------------------------- 1 | # De-duplicate PATH 2 | typeset -U PATH 3 | 4 | export DOTFILES=~/.dotfiles # here 5 | export PROJECTS=~/Dev # projects directory 6 | export ARCHFLAGS='-arch x86_64' # archflags 7 | export GREP_OPTIONS='--color=auto' # double rainbow! 8 | export PATH=$HOME/bin:/usr/local/bin:$PATH # path settings 9 | export GH_LOGIN=twe4ked # used by git-go 10 | export BUN_INSTALL="$HOME/.bun" 11 | export EDITOR=nvim 12 | 13 | export HOMEBREW_NO_AUTO_UPDATE=1 14 | export HOMEBREW_NO_INSTALL_CLEANUP=1 15 | export HOMEBREW_NO_ANALYTICS=1 16 | 17 | export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd 18 | 19 | if type rg >/dev/null 2>&1; then 20 | # ripgrep respects .gitignore 21 | export FZF_DEFAULT_COMMAND="rg --files" 22 | fi 23 | 24 | path_add() { 25 | if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then 26 | export PATH="${PATH:+"$PATH:"}$1" 27 | fi 28 | } 29 | 30 | path_add "/usr/local/sbin" 31 | path_add "/usr/local/share/npm/bin" 32 | path_add "$HOME/.cargo/bin" 33 | path_add "$HOME/Library/Python/2.7/bin" 34 | path_add "$HOME/.gem/ruby/3.3.0/bin" 35 | path_add "$HOME/.asdf/shims" 36 | path_add "$BUN_INSTALL/bin" 37 | 38 | if [[ -x /opt/homebrew/bin/brew ]]; then 39 | eval "$(/opt/homebrew/bin/brew shellenv)" 40 | fi 41 | 42 | path_add "/opt/homebrew/opt/postgresql@16/bin" 43 | # export LDFLAGS="-L/opt/homebrew/opt/postgresql@16/lib" 44 | # export CPPFLAGS="-I/opt/homebrew/opt/postgresql@16/include" 45 | 46 | if type go >/dev/null 2>&1; then 47 | export GOPATH="$(realpath `which go` | sed "s/\/libexec\/bin\/go//")" 48 | path_add "$GOPATH/bin" 49 | fi 50 | -------------------------------------------------------------------------------- /shell/functions/cucumber.sh: -------------------------------------------------------------------------------- 1 | cucumber() { 2 | if [ -S .zeus.sock ] 3 | then 4 | local CMD='zeus cucumber' 5 | elif [ -x bin/cucumber ] 6 | then 7 | local CMD='bin/cucumber' 8 | else 9 | local CMD='bundle exec cucumber' 10 | fi 11 | ( 12 | [ -n "${ZSH_VERSION:-}" ] && setopt shwordsplit 13 | exec $CMD "$@" 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /shell/functions/ghr.sh: -------------------------------------------------------------------------------- 1 | ghr() { 2 | if [[ $# -ne 1 ]]; then 3 | echo "Usage ghr [github url] [github user/repo]" 1>&2 4 | return 1 5 | fi 6 | 7 | cd "$( 8 | setopt KSH_ARRAYS BASH_REMATCH 9 | set -e 10 | set -o nounset 11 | 12 | if [[ $1 =~ "^https:\/\/github.com\/([^\/]*)\/([^\/]*)" ]]; then 13 | GH_PROJECT="${BASH_REMATCH[2]}" 14 | GH_USERNAME="${BASH_REMATCH[1]}" 15 | PROJECT_DIRECTORY="$PROJECTS/github/$GH_USERNAME/$GH_PROJECT" 16 | elif [[ $1 =~ "[^/]*\/[^/]*" ]]; then 17 | PROJECT_DIRECTORY="$PROJECTS/github/$1" 18 | fi 19 | 20 | if [[ ! -d "$PROJECT_DIRECTORY" ]]; then 21 | if [[ $1 =~ "(^https:\/\/github.com\/[^\/]*\/[^\/]*)" ]]; then 22 | GH_URL="${BASH_REMATCH[1]}" 23 | fi 24 | 25 | mkdir -p "$PROJECTS/github/$GH_USERNAME" 26 | git clone "$GH_URL" "$PROJECT_DIRECTORY" 27 | fi 28 | 29 | echo "$PROJECT_DIRECTORY" 30 | )" 31 | } 32 | -------------------------------------------------------------------------------- /shell/functions/h.sh: -------------------------------------------------------------------------------- 1 | function h { 2 | history | grep $1 | tail 3 | } 4 | -------------------------------------------------------------------------------- /shell/functions/hitch.sh: -------------------------------------------------------------------------------- 1 | hitch() { 2 | command hitch "$@" 3 | if [[ -s "$HOME/.hitch_export_authors" ]] ; then source "$HOME/.hitch_export_authors" ; fi 4 | } 5 | alias unhitch='hitch -u' 6 | -------------------------------------------------------------------------------- /shell/functions/o.sh: -------------------------------------------------------------------------------- 1 | # Use 'o' instead of 'open' (o ~/Sites will open the sites folder) 2 | # If no arguments are supplied open the current folder 3 | function o { 4 | open "${1:-.}" 5 | } 6 | -------------------------------------------------------------------------------- /shell/functions/pubkey.sh: -------------------------------------------------------------------------------- 1 | # Copy pub keys to clipboard 2 | function pubkey { 3 | cat "~/.ssh/${1:-id_rsa}.pub" | pbcopy 4 | echo 'Keys copied to clipboard' 5 | } 6 | -------------------------------------------------------------------------------- /shell/functions/simple_prompt.sh: -------------------------------------------------------------------------------- 1 | simple_prompt() { 2 | if test -z "$PROMPT_BAK$RPROMPT_BAK"; then 3 | PROMPT_BAK="$PROMPT" 4 | RPROMPT_BAK="$RPROMPT" 5 | PROMPT='$ ' 6 | unset RPROMPT 7 | else 8 | PROMPT="$PROMPT_BAK" 9 | RPROMPT="$RPROMPT_BAK" 10 | unset PROMPT_BAK 11 | unset RPROMPT_BAK 12 | fi 13 | } 14 | -------------------------------------------------------------------------------- /shell/functions/tmux.sh: -------------------------------------------------------------------------------- 1 | _tmux_automatic_rename_on() { 2 | RETURN_VALUE=$? 3 | if [[ -n "$TMUX" ]]; then 4 | tmux set automatic-rename on &> /dev/null 5 | fi 6 | return $RETURN_VALUE 7 | } 8 | 9 | _tmux_window_dir() { 10 | if [[ -n "$TMUX" ]]; then 11 | if [[ -n "$(tmux list-windows -F "#{window_name}" | grep -i "$1")" ]]; then 12 | local DIR="$(basename "$(pwd)"): " 13 | fi 14 | echo "$DIR$1" 15 | fi 16 | } 17 | 18 | _tmux_rename_window() { 19 | if [[ -n "$TMUX" ]]; then 20 | tmux rename-window "$1" 21 | AUTO_RENAME=1 22 | fi 23 | } 24 | 25 | _tmux_preexec() { 26 | case "$1" in 27 | man\ *) 28 | _tmux_rename_window "${1/ /: }" 29 | ;; 30 | bundle\ open*) 31 | _tmux_rename_window "${1/bundle open/gem:}" 32 | ;; 33 | vim|vim\ *) 34 | _tmux_rename_window "$(_tmux_window_dir vim)" 35 | ;; 36 | rs|rs\ *) 37 | _tmux_rename_window "$(_tmux_window_dir server)" 38 | ;; 39 | fs|fs\ *) 40 | _tmux_rename_window "$(_tmux_window_dir foreman)" 41 | ;; 42 | zs|zs\ *) 43 | if [[ -n "$TMUX" ]]; then 44 | tmux send-keys -R 45 | tmux clear-history 46 | fi 47 | _tmux_rename_window "$(_tmux_window_dir zeus)" 48 | ;; 49 | esac 50 | } 51 | 52 | _tmux_precmd() { 53 | if [[ $AUTO_RENAME == 1 ]]; then 54 | _tmux_automatic_rename_on 55 | fi 56 | unset AUTO_RENAME 57 | } 58 | 59 | autoload -U add-zsh-hook 60 | 61 | add-zsh-hook precmd _tmux_precmd 62 | add-zsh-hook preexec _tmux_preexec 63 | -------------------------------------------------------------------------------- /shell/functions/z.sh: -------------------------------------------------------------------------------- 1 | unalias z 2> /dev/null 2 | 3 | z() { 4 | [ $# -gt 0 ] && _z "$*" && return 5 | cd "$(_z -l 2>&1 | fzf --height 40% --reverse --inline-info +s --tac --query "$*" | sed 's/^[0-9,.]* *//')" 6 | } 7 | -------------------------------------------------------------------------------- /shell/nodenv.sh: -------------------------------------------------------------------------------- 1 | eval "$(nodenv init -)" 2 | -------------------------------------------------------------------------------- /shell/zsh/aliases.zsh: -------------------------------------------------------------------------------- 1 | alias -g G='| grep' 2 | 3 | history-write() { fc -W } 4 | history-read() { fc -R } 5 | -------------------------------------------------------------------------------- /shell/zsh/aurora_prompt.zsh: -------------------------------------------------------------------------------- 1 | eval "$(aurora_prompt init zsh "\ 2 | {green}{cwd style=short underline_repo=true}\ 3 | {yellow} ± {git_branch}{git_status}:{git_commit}\ 4 | {dark_grey} {git_stash}\ 5 | {dark_grey} {jobs}\ 6 | {if last_command_status}{cyan} $ \ 7 | {else}{red} $ \ 8 | {end}{reset}")" 9 | -------------------------------------------------------------------------------- /shell/zsh/completion.zsh: -------------------------------------------------------------------------------- 1 | fpath=(~/.fresh/build/completion $fpath) 2 | fpath=(/usr/local/share/zsh/site-functions $fpath) 3 | 4 | autoload -U compinit; compinit 5 | 6 | # group matches and describe groups 7 | zstyle ':completion:*' special-dirs true 8 | zstyle ':completion:*:matches' group 'yes' 9 | zstyle ':completion:*' group-name '' 10 | zstyle ':completion:*:descriptions' format $'\e[01;33m-- %d --\e[0m' # group group description format 11 | zstyle ':completion:*:warnings' format $'\e[01;31m-- No Matches Found --\e[0m' # message shown when there are no completion matches 12 | zstyle ':completion:*:functions' ignored-patterns '_*' # don't auto-complete internal functions (ones prefixed with _) 13 | zstyle ':completion::complete:cd:' tag-order local-directories path-directories 14 | zstyle ':completion:*' list-colors '' 15 | zstyle ':completion:*:*:*:*:*' menu select 16 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' 17 | zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" 18 | 19 | # generate descriptions with magic. 20 | zstyle ':completion:*' auto-description 'specify: %d' 21 | 22 | # don't prompt for a huge list use a page or menu 23 | zstyle ':completion:*:default' list-prompt '%S%M matches%s' 24 | zstyle ':completion:*:default' menu 'select=0' 25 | 26 | # have the newer files last 27 | zstyle ':completion:*' file-sort modification reverse 28 | 29 | # separate man page sections 30 | zstyle ':completion:*:manuals' separate-sections true 31 | 32 | # disable named-directories autocompletion 33 | zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories 34 | 35 | [ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$( /dev/null; then 2 | eval "$(direnv hook zsh)" 3 | else 4 | echo "WARN: Missing direnv" 5 | fi 6 | -------------------------------------------------------------------------------- /shell/zsh/keybindings.zsh: -------------------------------------------------------------------------------- 1 | # emacs bindings 2 | bindkey -e 3 | 4 | bindkey '^R' history-incremental-search-backward 5 | 6 | # option + right/left 7 | bindkey '\e\e[C' vi-forward-word 8 | bindkey '\e\e[D' vi-backward-word 9 | 10 | # search history using up/down arrows 11 | autoload -U history-search-end 12 | zle -N history-beginning-search-backward-end history-search-end 13 | zle -N history-beginning-search-forward-end history-search-end 14 | bindkey "\e[A" history-beginning-search-backward-end 15 | bindkey "\e[B" history-beginning-search-forward-end 16 | 17 | bindkey '^p' history-search-backward 18 | bindkey '^n' history-search-forward 19 | 20 | # make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ 21 | bindkey '^?' backward-delete-char 22 | bindkey '^[[3~' delete-char 23 | bindkey '^[3;5~' delete-char 24 | bindkey '\e[3~' delete-char 25 | 26 | # unbind ^D. for some reason it's bound to `list-choices` by default 27 | bindkey -r ^d 28 | -------------------------------------------------------------------------------- /shell/zsh/profile_end.zsh: -------------------------------------------------------------------------------- 1 | # https://esham.io/2018/02/zsh-profiling 2 | unsetopt XTRACE 3 | exec 2>&3 3>&- 4 | -------------------------------------------------------------------------------- /shell/zsh/profile_start.zsh: -------------------------------------------------------------------------------- 1 | # https://esham.io/2018/02/zsh-profiling 2 | zmodload zsh/datetime 3 | setopt PROMPT_SUBST 4 | PS4='+$EPOCHREALTIME %N:%i> ' 5 | 6 | logfile=$(mktemp zsh_profile.XXXXXXXX) 7 | echo "Logging to $logfile" 8 | exec 3>&2 2>$logfile 9 | 10 | setopt XTRACE 11 | -------------------------------------------------------------------------------- /shell/zsh/prompt.zsh: -------------------------------------------------------------------------------- 1 | setopt prompt_subst 2 | 3 | autoload colors; colors; 4 | autoload vcs_info 5 | 6 | function user_hostname() { 7 | if [[ "$USER" = "root" || -n "$SSH_TTY" ]]; then 8 | echo "%n@%m " 9 | fi 10 | } 11 | 12 | function prompt_bg_job() { 13 | jobs | grep '+' | awk '{print $4 " "}' 14 | } 15 | 16 | function git_stash() { 17 | git stash list 2> /dev/null | wc -l | sed -e "s/ *\([0-9]*\)/\+\1 /g" | sed -e "s/+0 //" 18 | } 19 | 20 | function prompt_pwd() { 21 | if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then 22 | local homerepo=${$(git rev-parse --show-toplevel)/#${HOME}/\~} 23 | local repopartslen=${#${(s:/:)${homerepo}}} 24 | fi 25 | 26 | parts=(${(s:/:)${${PWD}/#${HOME}/\~}}) 27 | 28 | i=0 29 | while (( i++ < ${#parts} )); do 30 | part="$parts[i]" 31 | if [[ $i == ${repopartslen} ]]; then 32 | parts[i]="%U$part%u" 33 | elif [[ $i != ${#parts} ]]; then 34 | if [[ $part[1,1] == "." ]]; then 35 | parts[i]="$part[1,2]" 36 | else 37 | parts[i]="$part[1,1]" 38 | fi 39 | fi 40 | done 41 | 42 | local prompt_path="${(j:/:)parts}" 43 | if [ "$parts[1]" != "~" ]; then 44 | prompt_path="/$prompt_path" 45 | fi 46 | echo "$prompt_path " 47 | } 48 | 49 | local git_formats="± %b%c%u:%.7i" 50 | 51 | zstyle ':vcs_info:git*' enable git 52 | zstyle ':vcs_info:git*' check-for-changes true 53 | zstyle ':vcs_info:git*' get-revision true 54 | zstyle ':vcs_info:git*' stagedstr "+" 55 | zstyle ':vcs_info:git*' unstagedstr "*" 56 | zstyle ':vcs_info:git*' formats "$git_formats" 57 | zstyle ':vcs_info:git*' actionformats "%a $git_formats" 58 | 59 | function precmd() { 60 | vcs_info 61 | } 62 | 63 | function git_prompt_info() { 64 | local info="${vcs_info_msg_0_}" 65 | if [[ -n "$info" ]]; then 66 | echo "$info " 67 | fi 68 | } 69 | 70 | function aws_vault() { 71 | [[ -n "$AWS_VAULT" ]] && echo "$AWS_VAULT " 72 | } 73 | 74 | function zle-keymap-select() { 75 | zle reset-prompt 76 | } 77 | zle -N zle-keymap-select 78 | 79 | if [[ $(hostname -s) = "caladan" ]]; then 80 | local char="λ " 81 | else 82 | local char="» " 83 | fi 84 | 85 | local cwd='%{${fg_bold[green]}%}$(prompt_pwd)%{${reset_color}%}' 86 | local usr='%{${fg[yellow]}%}$(user_hostname)%{${reset_color}%}' 87 | local colored_char='%(?,%F{cyan}$char,%F{red}$char)%f' 88 | local usr='%{${fg[yellow]}%}$(user_hostname)%{${reset_color}%}' 89 | local git='%{${fg_bold[yellow]}%}$(git_prompt_info)%{${reset_color}%}' 90 | local git_stashes='$(git_stash)' 91 | local bg_job='%{${fg_bold[black]}%}$(prompt_bg_job)%{${reset_color}%}' 92 | local aws='%{${fg_bold[black]}%}$(aws_vault)%{${reset_color}%}' 93 | 94 | PROMPT="$cwd$usr$bg_job$git_author$git$git_stashes$aws$colored_char" 95 | PROMPT2=$colored_char 96 | RPROMPT2='[%_]' 97 | -------------------------------------------------------------------------------- /shell/zsh/selecta.zsh: -------------------------------------------------------------------------------- 1 | # By default, ^S freezes terminal output and ^Q resumes it. Disable that so 2 | # that those keys can be used for other things. 3 | unsetopt flowcontrol 4 | 5 | # Run Selecta in the current working directory, appending the selected path, if 6 | # any, to the current command. 7 | function insert-selecta-path-in-command-line() { 8 | local selected_path 9 | # Print a newline or we'll clobber the old prompt. 10 | echo 11 | # Find the path; abort if the user doesn't select anything. 12 | selected_path=$(find * -type f | selecta) || return 13 | # Append the selection to the current command buffer. 14 | eval 'LBUFFER="$LBUFFER$selected_path"' 15 | # Redraw the prompt since Selecta has drawn several new lines of text. 16 | zle reset-prompt 17 | } 18 | 19 | # Create the zle widget 20 | zle -N insert-selecta-path-in-command-line 21 | 22 | # Bind the key to the newly created widget 23 | bindkey "^S" "insert-selecta-path-in-command-line" 24 | -------------------------------------------------------------------------------- /shell/zsh/title.zsh: -------------------------------------------------------------------------------- 1 | # appears at the beginning of (and during) of command execution 2 | termsupport_preexec() { 3 | emulate -L zsh 4 | setopt extended_glob 5 | local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} # cmd name only, or if this is sudo or ssh, the next cmd 6 | print -Pn "\e]2;%n@%M: %~ $CMD\a" # add the current command to the window title 7 | print -Pn "\e]1;%1~ $CMD\a" # add the current command to the terminal tab 8 | } 9 | 10 | autoload -U add-zsh-hook 11 | add-zsh-hook preexec termsupport_preexec 12 | -------------------------------------------------------------------------------- /shell/zsh/tmux-words.zsh: -------------------------------------------------------------------------------- 1 | _tmux_pane_words() { 2 | tmux capture-pane -p | 3 | xargs echo | # remove all the line breaks 4 | perl -pe 's/[^[:alnum:]\/~.-]|^[\/]/ /g' | # remove special chars 5 | perl -pe 's/\s+/\n/g' | # split words onto newlines 6 | sort -u | # sort 7 | grep -v "^$" # remove blank line 8 | } 9 | 10 | fzf-tmux-widget() { 11 | local selected 12 | if selected=$(_tmux_pane_words | fzf --height="40%" --reverse); then 13 | LBUFFER="$LBUFFER$selected" 14 | fi 15 | zle redisplay 16 | } 17 | zle -N fzf-tmux-widget 18 | bindkey '^X' fzf-tmux-widget 19 | -------------------------------------------------------------------------------- /shell/zsh/zsh-syntax-highlighting.zsh: -------------------------------------------------------------------------------- 1 | source ~/.fresh/build/vendor/zsh-syntax-highlighting.zsh 2 | 3 | ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) 4 | ZSH_HIGHLIGHT_STYLES+=( 5 | default 'fg=black,bold' 6 | unknown-token 'fg=red,bold' 7 | reserved-word 'bold' 8 | alias 'bold' 9 | builtin 'bold' 10 | function 'bold' 11 | command 'bold' 12 | precommand 'underline' 13 | commandseparator 'none' 14 | hashed-command 'fg=green' 15 | path 'underline' 16 | path_prefix 'underline' 17 | path_approx 'fg=black,bold' 18 | globbing 'fg=blue' 19 | history-expansion 'fg=blue' 20 | single-hyphen-option 'fg=black,bold' 21 | double-hyphen-option 'fg=black,bold' 22 | back-quoted-argument 'fg=green,underline' 23 | single-quoted-argument 'fg=green' 24 | double-quoted-argument 'fg=green,bold' 25 | dollar-double-quoted-argument 'fg=cyan' 26 | back-double-quoted-argument 'fg=cyan' 27 | assign 'none' 28 | ) 29 | -------------------------------------------------------------------------------- /shell/zsh/zshrc: -------------------------------------------------------------------------------- 1 | setopt no_beep # i hate beeps 2 | setopt interactive_comments # escape commands so i can use them later (allow comments after commands) 3 | setopt rm_star_wait # if `rm *` wait 10 seconds before performing it! 4 | setopt list_types # show types in completion 5 | setopt cd_able_vars # if the argument to cd is the name of a parameter whose value is a valid directory, it will become the current directory. 6 | setopt no_auto_name_dirs # see: http://www.neactar.com/shell/fix-for-wrong-prompt-dir-when-using-zsh-project-rvmrc-and-oh-my-zsh 7 | setopt hist_ignore_dups # ignore duplication command history list 8 | setopt hist_verify # expand history onto the current line instead of executing it 9 | setopt hist_expire_dups_first # remove oldest duplicate commands from the history first 10 | setopt hist_ignore_space # don't save commands beginning with spaces to history 11 | setopt extended_history # save beginning time and elapsed time before commands in history 12 | setopt append_history # append to the end of the history file 13 | setopt inc_append_history # always be saving history (not just when the shell exits) 14 | setopt magic_equal_subst # all unquoted arguments of the form identifier=expression appearing after the command name have file expansion 15 | setopt auto_menu # show completion menu on succesive tab press 16 | setopt auto_pushd # make cd push the old directory onto the directory stack 17 | setopt glob_complete # complete globs instead of expanding 18 | setopt complete_in_word 19 | setopt always_to_end 20 | 21 | # By default, ^S freezes terminal output and ^Q resumes it. Disable that so 22 | # that those keys can be used for other things. 23 | setopt no_flowcontrol 24 | 25 | WORDCHARS='' 26 | 27 | # history 28 | HISTFILE=$HOME/.zsh_history 29 | HISTSIZE=1000000 30 | SAVEHIST=1000000 31 | 32 | # show time a command took if over 4 sec 33 | export REPORTTIME=4 34 | export TIMEFMT="%*Es total, %U user, %S system, %P cpu" 35 | -------------------------------------------------------------------------------- /vim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "languageserver": { 3 | "go": { 4 | "command": "gopls", 5 | "rootPatterns": [ 6 | "go.mod" 7 | ], 8 | "trace.server": "verbose", 9 | "filetypes": [ 10 | "go" 11 | ] 12 | } 13 | }, 14 | "eslint.autoFixOnSave": true, 15 | "coc.preferences.formatOnSave": true, 16 | "rust-analyzer.diagnostics.disabled": [ 17 | "unresolved-proc-macro" 18 | ], 19 | "rust-analyzer.inlayHints.typeHints.enable": false, 20 | "rust-analyzer.inlayHints.parameterHints.enable": false, 21 | "rust-analyzer.inlayHints.chainingHints.enable": false, 22 | "rust-analyzer.inlayHints.closureReturnTypeHints": false, 23 | "prettier.requireConfig": true, 24 | "suggest.noselect": true 25 | } 26 | -------------------------------------------------------------------------------- /vim/colors/bclear_custom.vim: -------------------------------------------------------------------------------- 1 | set background=light 2 | 3 | runtime colors/bclear.vim 4 | 5 | let colors_name = 'bclear_custom' 6 | 7 | hi Cursor guibg=#AFD700 guifg=black 8 | hi iCursor guibg=#0087af 9 | -------------------------------------------------------------------------------- /vim/colors/jellybeans_custom.vim: -------------------------------------------------------------------------------- 1 | runtime colors/jellybeans.vim 2 | 3 | let colors_name = 'jellybeans_custom' 4 | 5 | hi ColorColumn guibg=#222222 6 | hi VertSplit ctermbg=235 7 | hi Cursor guibg=#AFD700 guifg=black 8 | hi iCursor guibg=#0087af 9 | -------------------------------------------------------------------------------- /vim/colors/solarized_custom.vim: -------------------------------------------------------------------------------- 1 | set background=light 2 | 3 | runtime colors/solarized.vim 4 | 5 | let colors_name = 'solarized_custom' 6 | 7 | hi Cursor guibg=#AFD700 guifg=black 8 | hi iCursor guibg=#0087af 9 | -------------------------------------------------------------------------------- /vim/config/auto_commands.vim: -------------------------------------------------------------------------------- 1 | " turn on spell check in Git commits. 2 | autocmd FileType gitcommit set spell 3 | 4 | " return to normal mode on FocustLost 5 | autocmd FocusLost * call feedkeys("\\") 6 | 7 | " treat dasherised words as whole words in stylesheets 8 | autocmd Filetype css,scss,sass setlocal iskeyword+=- 9 | 10 | function! WhatTheSize() 11 | execute ":!identify % | cut -d' ' -f 3" 12 | endfunction 13 | autocmd BufEnter *.jpg,*.png call WhatTheSize() 14 | 15 | " Set colorcolumn to the current textwidth or fallback to the specified column. 16 | function! ColorColumnAtTextWidth(column) 17 | if &textwidth > 0 18 | execute ':set cc=' . &textwidth 19 | else 20 | execute ':set cc=' . a:column 21 | endif 22 | endfunction 23 | 24 | " Set colorcolumn to the current textwidth or fallback to 80 25 | autocmd BufWinEnter * call ColorColumnAtTextWidth(80) 26 | -------------------------------------------------------------------------------- /vim/config/coc.vim: -------------------------------------------------------------------------------- 1 | let g:coc_global_extensions = ['coc-json', 'coc-prettier', 'coc-eslint', 'coc-tsserver', 'coc-rust-analyzer'] 2 | 3 | " https://github.com/neoclide/coc.nvim/issues/888#issuecomment-830806261 4 | autocmd BufWritePre *.tsx :silent call CocAction('runCommand', 'editor.action.organizeImport') 5 | command! -nargs=0 OR :silent call CocAction('runCommand', 'editor.action.organizeImport') 6 | -------------------------------------------------------------------------------- /vim/config/dirvish.vim: -------------------------------------------------------------------------------- 1 | let g:dirvish_mode = ':sort ,^.*[\/],' 2 | -------------------------------------------------------------------------------- /vim/config/fast_escape.vim: -------------------------------------------------------------------------------- 1 | " Speed up responsiveness of in Vim 2 | " This is reportedly caused by powerline (and apparently lightline) 3 | " http://usevim.com/2013/07/24/powerline-escape-fix/ 4 | if ! has('gui_running') 5 | set ttimeoutlen=10 6 | augroup FastEscape 7 | autocmd! 8 | au InsertEnter * set timeoutlen=0 9 | au InsertLeave * set timeoutlen=1000 10 | augroup END 11 | endif 12 | -------------------------------------------------------------------------------- /vim/config/fzf.vim: -------------------------------------------------------------------------------- 1 | command! FzfBranch call fzf#run({ 2 | \ 'source': 'git-files-modified-on-branch', 3 | \ 'sink': 'edit', 4 | \ 'options': '-m +s --prompt="GitBranch> " --preview ''(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500''', 5 | \ 'down': '40%' 6 | \ }) 7 | 8 | map t :Files 9 | map l :Buffers 10 | map m :GFiles? 11 | map M :FzfBranch 12 | map d :Files %:h 13 | -------------------------------------------------------------------------------- /vim/config/gitgutter.vim: -------------------------------------------------------------------------------- 1 | let g:gitgutter_map_keys = 0 2 | 3 | nmap ]d (GitGutterNextHunk) 4 | nmap [d (GitGutterPrevHunk) 5 | 6 | " always display the sign column 7 | autocmd BufEnter * sign define dummy 8 | autocmd BufEnter * execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('') 9 | -------------------------------------------------------------------------------- /vim/config/github-open.vim: -------------------------------------------------------------------------------- 1 | " open current file/line on GitHub 2 | command! GitHubOpen execute "silent !git github-url % ".line('.')."| xargs open" | redraw! 3 | -------------------------------------------------------------------------------- /vim/config/go.vim: -------------------------------------------------------------------------------- 1 | let g:go_imports_autosave = 1 2 | let g:go_fmt_autosave = 1 3 | let g:go_fmt_command = "goimports" 4 | let g:go_imports_mode = "goimports" 5 | -------------------------------------------------------------------------------- /vim/config/keybindings.vim: -------------------------------------------------------------------------------- 1 | map r :checktime:silent! wall:up:redraw!:GitGutterAll 2 | 3 | " Buffer navigation 4 | map , 5 | map q :Bclose 6 | 7 | noremap i :set list! 8 | nmap ss :source $HOME/.vimrc 9 | 10 | " Clear search 11 | map / :nohls 12 | 13 | " Use ,d (or ,dd or ,dj or 20,dd) to delete a line without yanking 14 | nmap gd "_d 15 | vmap gd "_d 16 | 17 | " Yank from the cursor to the end of the line, to be consistent with C and D 18 | nnoremap Y y$ 19 | 20 | " I never intentionally lookup keywords (with `man`) 21 | nmap K 22 | 23 | " Jump to start and end of line using the home row keys 24 | noremap H ^ 25 | noremap L $ 26 | 27 | " Search for selected text, forwards or backwards. 28 | " http://vim.wikia.com/wiki/Search_for_visually_selected_text 29 | vnoremap * : 30 | \let old_reg=getreg('"')let old_regtype=getregtype('"') 31 | \gvy/=substitute( 32 | \escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g') 33 | \gV:call setreg('"', old_reg, old_regtype) 34 | vnoremap # : 35 | \let old_reg=getreg('"')let old_regtype=getregtype('"') 36 | \gvy?=substitute( 37 | \escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g') 38 | \gV:call setreg('"', old_reg, old_regtype) 39 | 40 | " select all 41 | map a ggVG 42 | 43 | " Toggle word wrap 44 | map W :set wrap! 45 | 46 | " Toggle spell checking 47 | map S :set spell! 48 | 49 | " Movement & wrapped long lines 50 | " This solves the problem that pressing down jumps your cursor 'over' the 51 | " current line to the next line 52 | nnoremap j gj 53 | nnoremap k gk 54 | 55 | nnoremap = v= 56 | 57 | " Q normally enters Ex mode 58 | " I want to use it to run the q macro 59 | map Q @q 60 | 61 | " Command line history 62 | cnoremap 63 | cnoremap 64 | -------------------------------------------------------------------------------- /vim/config/marked.vim: -------------------------------------------------------------------------------- 1 | command! Marked execute "silent !open -a Marked\\ 2 '%:p'" | redraw! 2 | -------------------------------------------------------------------------------- /vim/config/ruby_refactoring.vim: -------------------------------------------------------------------------------- 1 | let g:ruby_refactoring_map_keys = 0 2 | 3 | map L :RExtractLet 4 | -------------------------------------------------------------------------------- /vim/config/rust.vim: -------------------------------------------------------------------------------- 1 | let g:rustfmt_autosave = 1 2 | -------------------------------------------------------------------------------- /vim/config/statusline.vim: -------------------------------------------------------------------------------- 1 | let g:lightline = { 2 | \ 'component_function': { 3 | \ 'filename': 'LightLineFilename' 4 | \ } 5 | \ } 6 | 7 | function! LightLineFilename() 8 | return expand('%') 9 | endfunction 10 | -------------------------------------------------------------------------------- /vim/config/tabularize.vim: -------------------------------------------------------------------------------- 1 | " Align selected table with 2 | nmap :Tabularize /\|/ 3 | -------------------------------------------------------------------------------- /vim/config/winresizer.vim: -------------------------------------------------------------------------------- 1 | let g:winresizer_start_key = 'w' 2 | -------------------------------------------------------------------------------- /vim/gvimrc: -------------------------------------------------------------------------------- 1 | if has('gui_macvim') 2 | set guifont=Monaco:h14 3 | 4 | " Allow colour to be set on insert cursor 5 | set guicursor+=i:ver25-iCursor 6 | 7 | " Hide the tool bar 8 | set guioptions-=T 9 | 10 | " Use simple dialogs rather than pop-ups 11 | set guioptions=c 12 | endif 13 | -------------------------------------------------------------------------------- /vim/leader.vim: -------------------------------------------------------------------------------- 1 | let mapleader = "," 2 | -------------------------------------------------------------------------------- /vim/plug.vim: -------------------------------------------------------------------------------- 1 | call plug#begin('~/.vim/plugged') 2 | 3 | Plug 'AndrewRadev/sideways.vim' 4 | Plug 'Soares/butane.vim' 5 | Plug 'airblade/vim-gitgutter' 6 | Plug 'bronson/vim-trailing-whitespace' 7 | Plug 'godlygeek/tabular' 8 | Plug 'itchyny/lightline.vim' 9 | Plug 'junegunn/fzf' | Plug 'junegunn/fzf.vim' 10 | Plug 'junegunn/vim-peekaboo' 11 | Plug 'kana/vim-textobj-user' 12 | Plug 'vim-scripts/argtextobj.vim' 13 | Plug 'ludovicchabant/vim-gutentags' 14 | Plug 'matze/vim-move' 15 | Plug 'sickill/vim-pasta' 16 | Plug 'tomtom/tcomment_vim' 17 | Plug 'tpope/vim-dispatch' 18 | Plug 'tpope/vim-eunuch' 19 | Plug 'tpope/vim-fugitive' 20 | Plug 'tpope/vim-repeat' 21 | Plug 'tpope/vim-rhubarb' 22 | Plug 'tpope/vim-surround' 23 | Plug 'tpope/vim-unimpaired' 24 | Plug 'justinmk/vim-dirvish' 25 | Plug 'twe4ked/vim-diff-toggle' 26 | Plug 'tpope/vim-projectionist' 27 | Plug 'simeji/winresizer' 28 | 29 | " language 30 | Plug 'cakebaker/scss-syntax.vim' 31 | Plug 'elixir-lang/vim-elixir' 32 | Plug 'kchmck/vim-coffee-script' 33 | Plug 'nelstrom/vim-textobj-rubyblock' | Plug 'rking/vim-ruby-refactoring' 34 | Plug 'slim-template/vim-slim' 35 | Plug 'tpope/vim-cucumber' 36 | Plug 'tpope/vim-haml' 37 | Plug 'tpope/vim-markdown' 38 | Plug 'rhysd/vim-crystal' 39 | Plug 'rust-lang/rust.vim' 40 | Plug 'cespare/vim-toml' 41 | Plug 'fatih/vim-go' 42 | Plug 'DingDean/wgsl.vim' 43 | Plug 'neoclide/coc.nvim', {'branch': 'release'} 44 | Plug 'fannheyward/coc-biome' 45 | Plug 'ron-rs/ron.vim' 46 | 47 | " colorschemes 48 | Plug 'AlxHnr/clear_colors' 49 | Plug 'altercation/vim-colors-solarized' 50 | Plug 'vim-scripts/bclear' 51 | Plug 'nanotech/jellybeans.vim' 52 | Plug 'noahfrederick/Hemisu' 53 | Plug 'sonph/onehalf', {'rtp': 'vim/'} 54 | 55 | call plug#end() 56 | -------------------------------------------------------------------------------- /vim/vimrc: -------------------------------------------------------------------------------- 1 | " Misc 2 | set nowrap " I don't always wrap lines... 3 | set linebreak " ...but when I do, I wrap whole words. 4 | set t_Co=256 " Support for xterm with 256 colors 5 | set number " Show line numbers 6 | set ruler " Show ruler 7 | set noswapfile " Don't create annoying *.swp files 8 | set scrolloff=5 " Start scrolling the file 5 lines before the end of the window 9 | set spelllang=en_au " Set default spelling language to English (Australia) 10 | set hidden " Allow hiding buffers with unsaved changes 11 | set wildmenu " Make tab completion act more like bash 12 | set wildmode=list:longest " Tab complete to longest common string, like bash 13 | set showcmd " Display an incomplete command in the lower right corner 14 | set showmode " Show current mode down the bottom 15 | set laststatus=2 " Always show the status line 16 | set history=1000 17 | set autoread 18 | set cursorline 19 | set backspace=indent,eol,start " Make backspace behave rationally 20 | set lazyredraw 21 | set updatetime=100 22 | set complete=.,w,b,u,i " Same as the default but without tag completion 23 | 24 | " Never insert multiple spaces when joining lines with . 25 | " 26 | " > If the 'joinspaces' option is on, these commands insert two spaces after a 27 | " > '.', '!' or '?'. 28 | set nojoinspaces 29 | 30 | " Change the invisible characters 31 | set listchars=trail:.,tab:▸\ ,eol:¬,extends:❯,precedes:❮ 32 | 33 | " Indentation 34 | set shiftwidth=2 " Number of spaces to use in each autoindent step 35 | set tabstop=2 " Two tab spaces 36 | set softtabstop=2 " Number of spaces to skip or insert when ing or ing 37 | set expandtab " Spaces instead of tabs for better cross-editor compatibility 38 | set autoindent " Keep the indent when creating a new line 39 | set smarttab " Use shiftwidth and softtabstop to insert or delete (on ) blanks 40 | set cindent " Recommended setting for automatic C-style indentation 41 | set autoindent " Automatic indentation in non-C files 42 | 43 | " Ignore case 44 | set ignorecase 45 | " Override 'ignorecase' option if the search contains upper case characters. 46 | set smartcase 47 | " https://vi.stackexchange.com/a/11413 48 | au InsertEnter * set noignorecase 49 | au InsertLeave * set ignorecase 50 | 51 | let g:is_posix = 1 " Better highlighting of shell files 52 | 53 | filetype plugin indent on " Enable automatic filetype detection, filetype-specific plugins/indentation 54 | 55 | " Colorscheme 56 | syntax enable 57 | set background=dark 58 | colorscheme jellybeans_custom 59 | 60 | " Use % to jump to matching begin/end of blocks as well as brackets/parens 61 | runtime macros/matchit.vim 62 | 63 | " http://tim.theenchanter.com/2008/07/crontab-temp-file-must-be-edited-in.html 64 | set backupskip=/tmp/*,/private/tmp/*" 65 | --------------------------------------------------------------------------------