├── .bundle └── config ├── .gitignore ├── .gitmodules ├── Gemfile ├── LICENSE ├── README.md ├── bin ├── colortest └── install ├── doc ├── useful_commands.md └── useful_vim.md └── lib ├── bin ├── adobe-kill ├── curltime ├── extract ├── filter ├── git-branch-cleanup ├── git-changed-files ├── git-identity ├── git-merge-point ├── git-unite ├── install-basic-gems.sh ├── launch ├── mkdiff ├── nam ├── speedtest ├── sway ├── terminal-truecolor ├── tzc ├── urldecode ├── urlencode ├── virsh-send-keys ├── webserver └── wl-screenshot ├── config ├── colordiff │ └── colordiffrc ├── containers │ └── containers.conf ├── flake8 ├── fontconfig │ └── fonts.conf ├── git │ ├── attributes │ ├── config │ └── ignore ├── gtk-3.0 │ └── gtk.css ├── ideavim │ └── ideavimrc ├── imv │ └── config ├── kitty │ └── kitty.conf ├── mako │ └── config ├── mpv │ └── mpv.conf ├── nvim │ └── init.vim ├── pry │ └── pryrc ├── ripgrep │ └── config ├── rubocop │ └── config.yml ├── sway │ └── config ├── tig │ └── config ├── tmux │ └── tmux.conf ├── waybar │ ├── config │ ├── mediaplayer │ └── style.css └── wofi │ ├── config │ └── style.css ├── firefox ├── user.js ├── userChrome.css └── userContent.css ├── gnupg ├── gpg-agent.conf └── gpg.conf ├── linux └── configure ├── macos ├── DefaultKeyBinding.dict └── configure ├── root ├── Renviron ├── Rprofile ├── bash_logout ├── bash_profile ├── bashrc ├── colormakerc ├── editrc ├── eslintrc.js ├── gemrc ├── ghci ├── gvimrc ├── inputrc ├── irbrc ├── lein │ └── profiles.clj ├── psqlrc ├── spacemacs.d │ └── init.el ├── sqliterc ├── vimrc ├── zlogout ├── zprofile ├── zshenv └── zshrc ├── ruby ├── init.rb ├── irb.rb └── pry.rb ├── shell ├── env.zsh ├── interactive.zsh ├── plugins │ ├── _core │ │ ├── env.zsh │ │ ├── interactive.zsh │ │ └── profile.zsh │ ├── ant │ │ └── interactive.zsh │ ├── base16 │ │ └── interactive.zsh │ ├── c │ │ └── interactive.zsh │ ├── dnf │ │ └── interactive.zsh │ ├── fzf │ │ └── env.zsh │ ├── git │ │ └── env.zsh │ ├── haskell-stack │ │ └── env.zsh │ ├── homebrew │ │ └── env.zsh │ ├── node │ │ └── interactive.zsh │ ├── python │ │ ├── env.zsh │ │ ├── interactive.zsh │ │ └── profile.zsh │ ├── ripgrep │ │ └── env.zsh │ ├── ruby │ │ └── interactive.zsh │ ├── rust │ │ └── env.zsh │ └── tex │ │ └── env.zsh ├── profile.zsh ├── util.bash └── vendor │ └── .keep ├── terminfo └── tmux.terminfo.txt ├── vim ├── after │ └── syntax │ │ ├── css.vim │ │ └── html.vim ├── bundle │ └── python-mode │ │ └── syntax │ │ └── python.vim ├── colors │ └── solarized.vim ├── config │ ├── filetypes.vim │ ├── init.vim │ ├── mappings.vim │ ├── packages.vim │ ├── plugins.vim │ └── settings.vim ├── pack │ └── user │ │ ├── opt │ │ ├── .keep │ │ ├── bundler │ │ ├── fireplace │ │ ├── gdb-neovim │ │ ├── intero-neovim │ │ ├── racer │ │ ├── rake │ │ ├── startuptime │ │ └── textobj-rubyblock │ │ └── start │ │ ├── .keep │ │ ├── ZoomWin │ │ ├── abolish │ │ ├── ack │ │ ├── alchemist │ │ ├── ale │ │ ├── applescript │ │ ├── argtextobj │ │ ├── base16 │ │ ├── beancount │ │ ├── bitbake │ │ ├── blockle │ │ ├── bundle │ │ ├── camelcasemotion │ │ ├── coffee-script │ │ ├── cucumber │ │ ├── easymotion │ │ ├── easytags │ │ ├── editorconfig │ │ ├── elixir │ │ ├── elm │ │ ├── endwise │ │ ├── exchange │ │ ├── fennel │ │ ├── fugitive │ │ ├── fzf │ │ ├── glsl │ │ ├── haml │ │ ├── haskell │ │ ├── hcl │ │ ├── hy │ │ ├── idris │ │ ├── indent-guides │ │ ├── indent-object │ │ ├── indentLine │ │ ├── indentwise │ │ ├── indexed-search │ │ ├── janet │ │ ├── javascript │ │ ├── jinja2 │ │ ├── json │ │ ├── jsonnet │ │ ├── jsx │ │ ├── julia │ │ ├── l9 │ │ ├── lkml │ │ ├── matchit │ │ ├── misc │ │ ├── mundo │ │ ├── mustache │ │ ├── nerdcommenter │ │ ├── nerdtree │ │ ├── nftables │ │ ├── nginx │ │ ├── nix │ │ ├── nvim-lspconfig │ │ ├── pandoc │ │ ├── pandoc-syntax │ │ ├── parinfer-rust │ │ ├── pest │ │ ├── projectionist │ │ ├── prolog │ │ ├── ps1 │ │ ├── puppet │ │ ├── python-mode │ │ ├── python-pep8-indent │ │ ├── racket │ │ ├── rails │ │ ├── rainbow_parentheses │ │ ├── regreplop │ │ ├── repeat │ │ ├── ruby │ │ ├── rust │ │ ├── scala │ │ ├── signify │ │ ├── snipMate │ │ ├── speeddating │ │ ├── splitjoin │ │ ├── supertab │ │ ├── surround │ │ ├── swift │ │ ├── tabular │ │ ├── tagbar │ │ ├── terraform │ │ ├── textobj-user │ │ ├── tmux-focus-events │ │ ├── toml │ │ ├── tslime │ │ ├── typescript │ │ ├── unimpaired │ │ ├── vis │ │ ├── which-key │ │ └── yats ├── plugin │ └── fzf.vim └── spell │ ├── en.utf-8.add │ └── en.utf-8.add.spl └── zsh ├── env.zsh ├── functions ├── _c ├── _docker-compose ├── _gem ├── _git-unite ├── _git_unite ├── _h ├── _npm ├── _pip └── _redis-cli ├── interactive.zsh ├── lib ├── aliases.zsh ├── completions.zsh ├── config.zsh └── prompt.zsh ├── plugins ├── _core │ └── interactive.zsh ├── command-not-found │ └── interactive.zsh └── fzf │ └── interactive.zsh └── profile.zsh /.bundle/config: -------------------------------------------------------------------------------- 1 | --- 2 | BUNDLE_PATH: "vendor/ruby" 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Gemfile.lock 2 | /lib/lein/repl-history 3 | /lib/vim/bundle/*/doc/tags* 4 | /vendor/ruby 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/root/emacs.d"] 2 | path = lib/spacemacs 3 | url = https://github.com/syl20bnr/spacemacs 4 | [submodule "lib/shell/vendor/base16-shell"] 5 | path = lib/shell/vendor/base16-shell 6 | url = https://github.com/chriskempson/base16-shell.git 7 | [submodule "lib/vim/bundle/ack.vim"] 8 | path = lib/vim/bundle/ack 9 | url = https://github.com/mileszs/ack.vim.git 10 | [submodule "lib/vim/bundle/alchemist.vim"] 11 | path = lib/vim/bundle/alchemist 12 | url = https://github.com/slashmili/alchemist.vim.git 13 | [submodule "lib/vim/bundle/ale"] 14 | path = lib/vim/bundle/ale 15 | url = https://github.com/dense-analysis/ale 16 | [submodule "lib/vim/bundle/applescript"] 17 | path = lib/vim/bundle/applescript 18 | url = https://github.com/vim-scripts/applescript.vim.git 19 | [submodule "lib/vim/bundle/argtextobj"] 20 | path = lib/vim/bundle/argtextobj 21 | url = https://github.com/vim-scripts/argtextobj.vim.git 22 | [submodule "lib/vim/bundle/base16-vim"] 23 | path = lib/vim/bundle/base16 24 | url = https://github.com/amarshall/base16-vim.git 25 | [submodule "lib/vim/bundle/beancount"] 26 | path = lib/vim/bundle/beancount 27 | url = https://github.com/nathangrigg/vim-beancount.git 28 | [submodule "lib/vim/bundle/bitbake"] 29 | path = lib/vim/bundle/bitbake 30 | url = https://github.com/kergoth/vim-bitbake.git 31 | [submodule "lib/vim/bundle/camelcasemotion"] 32 | path = lib/vim/bundle/camelcasemotion 33 | url = https://github.com/vim-scripts/camelcasemotion.git 34 | [submodule "lib/vim/bundle/editorconfig"] 35 | path = lib/vim/bundle/editorconfig 36 | url = https://github.com/editorconfig/editorconfig-vim.git 37 | [submodule "lib/vim/bundle/elm-vim"] 38 | path = lib/vim/bundle/elm 39 | url = https://github.com/ElmCast/elm-vim.git 40 | [submodule "lib/vim/bundle/fennel"] 41 | path = lib/vim/bundle/fennel 42 | url = https://github.com/bakpakin/fennel.vim 43 | [submodule "lib/vim/bundle/fzf.vim"] 44 | path = lib/vim/bundle/fzf 45 | url = https://github.com/junegunn/fzf.vim.git 46 | [submodule "lib/vim/bundle/gdb-neovim"] 47 | path = lib/vim/bundle/gdb-neovim 48 | url = https://github.com/sakhnik/nvim-gdb.git 49 | [submodule "lib/vim/bundle/glsl"] 50 | path = lib/vim/bundle/glsl 51 | url = https://github.com/tikhomirov/vim-glsl.git 52 | [submodule "lib/vim/bundle/haskell-vim"] 53 | path = lib/vim/bundle/haskell 54 | url = https://github.com/neovimhaskell/haskell-vim.git 55 | [submodule "lib/vim/bundle/hcl"] 56 | path = lib/vim/bundle/hcl 57 | url = https://github.com/b4b4r07/vim-hcl.git 58 | [submodule "lib/vim/bundle/hy"] 59 | path = lib/vim/bundle/hy 60 | url = https://github.com/hylang/vim-hy.git 61 | [submodule "lib/vim/bundle/idris-vim"] 62 | path = lib/vim/bundle/idris 63 | url = https://github.com/idris-hackers/idris-vim.git 64 | [submodule "lib/vim/bundle/indentLine"] 65 | path = lib/vim/bundle/indentLine 66 | url = https://github.com/Yggdroot/indentLine.git 67 | [submodule "lib/vim/bundle/intero-neovim"] 68 | path = lib/vim/bundle/intero-neovim 69 | url = https://github.com/parsonsmatt/intero-neovim.git 70 | [submodule "lib/vim/bundle/janet"] 71 | path = lib/vim/bundle/janet 72 | url = https://github.com/janet-lang/janet.vim.git 73 | [submodule "lib/vim/bundle/jinja2"] 74 | path = lib/vim/bundle/jinja2 75 | url = https://github.com/Glench/Vim-Jinja2-Syntax.git 76 | [submodule "lib/vim/bundle/julia"] 77 | path = lib/vim/bundle/julia 78 | url = https://github.com/JuliaEditorSupport/julia-vim.git 79 | [submodule "lib/vim/bundle/jsonnet"] 80 | path = lib/vim/bundle/jsonnet 81 | url = https://github.com/google/vim-jsonnet.git 82 | [submodule "lib/vim/bundle/l9"] 83 | path = lib/vim/bundle/l9 84 | url = https://github.com/vim-scripts/L9.git 85 | [submodule "lib/vim/bundle/lkml"] 86 | path = lib/vim/bundle/lkml 87 | url = https://github.com/thalesmello/lkml.vim.git 88 | [submodule "lib/vim/bundle/matchit"] 89 | path = lib/vim/bundle/matchit 90 | url = https://github.com/vim-scripts/matchit.zip.git 91 | [submodule "lib/vim/bundle/mustache"] 92 | path = lib/vim/bundle/mustache 93 | url = https://github.com/juvenn/mustache.vim.git 94 | [submodule "lib/vim/bundle/nerdcommenter"] 95 | path = lib/vim/bundle/nerdcommenter 96 | url = https://github.com/scrooloose/nerdcommenter.git 97 | [submodule "lib/vim/bundle/nerdtree"] 98 | path = lib/vim/bundle/nerdtree 99 | url = https://github.com/scrooloose/nerdtree 100 | [submodule "lib/vim/bundle/nftables"] 101 | path = lib/vim/bundle/nftables 102 | url = https://github.com/nfnty/vim-nftables.git 103 | [submodule "lib/vim/bundle/nginx.vim"] 104 | path = lib/vim/bundle/nginx 105 | url = https://github.com/chr4/nginx.vim.git 106 | [submodule "lib/vim/bundle/nix"] 107 | path = lib/vim/bundle/nix 108 | url = https://github.com/LnL7/vim-nix.git 109 | [submodule "lib/vim/bundle/nvim-lspconfig"] 110 | path = lib/vim/bundle/nvim-lspconfig 111 | url = https://github.com/neovim/nvim-lspconfig.git 112 | [submodule "lib/vim/bundle/pandoc"] 113 | path = lib/vim/bundle/pandoc 114 | url = https://github.com/vim-pandoc/vim-pandoc.git 115 | [submodule "lib/vim/bundle/pandoc-syntax"] 116 | path = lib/vim/bundle/pandoc-syntax 117 | url = https://github.com/vim-pandoc/vim-pandoc-syntax.git 118 | [submodule "lib/vim/bundle/parinfer-rust"] 119 | path = lib/vim/bundle/parinfer-rust 120 | url = https://github.com/eraserhd/parinfer-rust.git 121 | [submodule "lib/vim/bundle/pest"] 122 | path = lib/vim/bundle/pest 123 | url = https://github.com/pest-parser/pest.vim 124 | [submodule "lib/vim/bundle/prolog.vim"] 125 | path = lib/vim/bundle/prolog 126 | url = https://github.com/adimit/prolog.vim.git 127 | [submodule "lib/vim/bundle/ps1"] 128 | path = lib/vim/bundle/ps1 129 | url = https://github.com/PProvost/vim-ps1.git 130 | [submodule "lib/vim/bundle/rainbow_parentheses"] 131 | path = lib/vim/bundle/rainbow_parentheses 132 | url = https://github.com/kien/rainbow_parentheses.vim.git 133 | [submodule "lib/vim/bundle/regreplop"] 134 | path = lib/vim/bundle/regreplop 135 | url = https://github.com/vim-scripts/regreplop.vim.git 136 | [submodule "lib/vim/bundle/rust.vim"] 137 | path = lib/vim/bundle/rust 138 | url = https://github.com/rust-lang/rust.vim.git 139 | [submodule "lib/vim/bundle/snipMate"] 140 | path = lib/vim/bundle/snipMate 141 | url = https://github.com/vim-scripts/snipMate.git 142 | [submodule "lib/vim/bundle/splitjoin.vim"] 143 | path = lib/vim/bundle/splitjoin 144 | url = https://github.com/AndrewRadev/splitjoin.vim.git 145 | [submodule "lib/vim/bundle/startuptime"] 146 | path = lib/vim/bundle/startuptime 147 | url = https://github.com/tweekmonster/startuptime.vim.git 148 | [submodule "lib/vim/bundle/supertab"] 149 | path = lib/vim/bundle/supertab 150 | url = https://github.com/vim-scripts/SuperTab.git 151 | [submodule "lib/vim/bundle/swift"] 152 | path = lib/vim/bundle/swift 153 | url = https://github.com/keith/swift.vim.git 154 | [submodule "lib/vim/bundle/tabular"] 155 | path = lib/vim/bundle/tabular 156 | url = https://github.com/godlygeek/tabular.git 157 | [submodule "lib/vim/bundle/tagbar"] 158 | path = lib/vim/bundle/tagbar 159 | url = https://github.com/majutsushi/tagbar.git 160 | [submodule "lib/vim/bundle/textobj-rubyblock"] 161 | path = lib/vim/bundle/textobj-rubyblock 162 | url = https://github.com/nelstrom/vim-textobj-rubyblock 163 | [submodule "lib/vim/bundle/tslime.vim"] 164 | path = lib/vim/bundle/tslime 165 | url = https://github.com/jgdavey/tslime.vim 166 | branch = main 167 | [submodule "lib/vim/bundle/typescript-vim"] 168 | path = lib/vim/bundle/typescript 169 | url = https://github.com/leafgarland/typescript-vim.git 170 | [submodule "lib/vim/bundle/vim-abolish"] 171 | path = lib/vim/bundle/abolish 172 | url = https://github.com/tpope/vim-abolish.git 173 | [submodule "lib/vim/bundle/vim-blockle"] 174 | path = lib/vim/bundle/blockle 175 | url = https://github.com/jgdavey/vim-blockle.git 176 | [submodule "lib/vim/bundle/vim-bundler"] 177 | path = lib/vim/bundle/bundler 178 | url = https://github.com/tpope/vim-bundler.git 179 | [submodule "lib/vim/bundle/vim-coffee-script"] 180 | path = lib/vim/bundle/coffee-script 181 | url = https://github.com/kchmck/vim-coffee-script.git 182 | [submodule "lib/vim/bundle/vim-cucumber"] 183 | path = lib/vim/bundle/cucumber 184 | url = https://github.com/tpope/vim-cucumber 185 | [submodule "lib/vim/bundle/vim-easymotion"] 186 | path = lib/vim/bundle/easymotion 187 | url = https://github.com/Lokaltog/vim-easymotion.git 188 | [submodule "lib/vim/bundle/vim-easytags"] 189 | path = lib/vim/bundle/easytags 190 | url = https://github.com/xolox/vim-easytags.git 191 | [submodule "lib/vim/bundle/vim-elixir"] 192 | path = lib/vim/bundle/elixir 193 | url = https://github.com/elixir-editors/vim-elixir.git 194 | [submodule "lib/vim/bundle/vim-endwise"] 195 | path = lib/vim/bundle/endwise 196 | url = https://github.com/tpope/vim-endwise 197 | [submodule "lib/vim/bundle/vim-exchange"] 198 | path = lib/vim/bundle/exchange 199 | url = https://github.com/tommcdo/vim-exchange.git 200 | [submodule "lib/vim/bundle/vim-fireplace"] 201 | path = lib/vim/bundle/fireplace 202 | url = https://github.com/tpope/vim-fireplace.git 203 | [submodule "lib/vim/bundle/vim-fugitive"] 204 | path = lib/vim/bundle/fugitive 205 | url = https://github.com/tpope/vim-fugitive 206 | [submodule "lib/vim/bundle/vim-haml"] 207 | path = lib/vim/bundle/haml 208 | url = https://github.com/tpope/vim-haml 209 | [submodule "lib/vim/bundle/vim-indent-guides"] 210 | path = lib/vim/bundle/indent-guides 211 | url = https://github.com/nathanaelkane/vim-indent-guides.git 212 | [submodule "lib/vim/bundle/vim-indent-object"] 213 | path = lib/vim/bundle/indent-object 214 | url = https://github.com/michaeljsmith/vim-indent-object.git 215 | [submodule "lib/vim/bundle/vim-indentwise"] 216 | path = lib/vim/bundle/indentwise 217 | url = https://github.com/jeetsukumaran/vim-indentwise.git 218 | [submodule "lib/vim/bundle/vim-indexed-search"] 219 | path = lib/vim/bundle/indexed-search 220 | url = https://github.com/henrik/vim-indexed-search 221 | [submodule "lib/vim/bundle/vim-javascript"] 222 | path = lib/vim/bundle/javascript 223 | url = https://github.com/pangloss/vim-javascript 224 | [submodule "lib/vim/bundle/vim-json"] 225 | path = lib/vim/bundle/json 226 | url = https://github.com/elzr/vim-json.git 227 | [submodule "lib/vim/bundle/vim-jsx"] 228 | path = lib/vim/bundle/jsx 229 | url = https://github.com/mxw/vim-jsx.git 230 | [submodule "lib/vim/bundle/vim-misc"] 231 | path = lib/vim/bundle/misc 232 | url = https://github.com/xolox/vim-misc.git 233 | [submodule "lib/vim/bundle/vim-mundo"] 234 | path = lib/vim/bundle/mundo 235 | url = https://github.com/simnalamburt/vim-mundo.git 236 | [submodule "lib/vim/bundle/vim-projectionist"] 237 | path = lib/vim/bundle/projectionist 238 | url = https://github.com/tpope/vim-projectionist.git 239 | [submodule "lib/vim/bundle/vim-puppet"] 240 | path = lib/vim/bundle/puppet 241 | url = https://github.com/rodjek/vim-puppet.git 242 | [submodule "lib/vim/bundle/vim-python-pep8-indent"] 243 | path = lib/vim/bundle/python-pep8-indent 244 | url = https://github.com/Vimjas/vim-python-pep8-indent 245 | [submodule "lib/vim/bundle/vim-racket"] 246 | path = lib/vim/bundle/racket 247 | url = https://github.com/wlangstroth/vim-racket.git 248 | [submodule "lib/vim/bundle/vim-racer"] 249 | path = lib/vim/bundle/racer 250 | url = https://github.com/racer-rust/vim-racer.git 251 | [submodule "lib/vim/bundle/vim-rails"] 252 | path = lib/vim/bundle/rails 253 | url = https://github.com/tpope/vim-rails.git 254 | [submodule "lib/vim/bundle/vim-rake"] 255 | path = lib/vim/bundle/rake 256 | url = https://github.com/tpope/vim-rake.git 257 | [submodule "lib/vim/bundle/vim-repeat"] 258 | path = lib/vim/bundle/repeat 259 | url = https://github.com/tpope/vim-repeat 260 | [submodule "lib/vim/bundle/vim-ruby"] 261 | path = lib/vim/bundle/ruby 262 | url = https://github.com/vim-ruby/vim-ruby.git 263 | [submodule "lib/vim/bundle/vim-scala"] 264 | path = lib/vim/bundle/scala 265 | url = https://github.com/derekwyatt/vim-scala.git 266 | [submodule "lib/vim/bundle/vim-signify"] 267 | path = lib/vim/bundle/signify 268 | url = https://github.com/mhinz/vim-signify.git 269 | [submodule "lib/vim/bundle/vim-speeddating"] 270 | path = lib/vim/bundle/speeddating 271 | url = https://github.com/tpope/vim-speeddating.git 272 | [submodule "lib/vim/bundle/vim-surround"] 273 | path = lib/vim/bundle/surround 274 | url = https://github.com/tpope/vim-surround 275 | [submodule "lib/vim/bundle/vim-terraform"] 276 | path = lib/vim/bundle/terraform 277 | url = https://github.com/hashivim/vim-terraform.git 278 | [submodule "lib/vim/bundle/vim-textobj-rubyblock"] 279 | path = lib/vim/bundle/textobj-rubyblock 280 | url = https://github.com/nelstrom/vim-textobj-rubyblock.git 281 | [submodule "lib/vim/bundle/vim-textobj-user"] 282 | path = lib/vim/bundle/textobj-user 283 | url = https://github.com/kana/vim-textobj-user.git 284 | [submodule "lib/vim/bundle/vim-tmux-focus-events"] 285 | path = lib/vim/bundle/tmux-focus-events 286 | url = https://github.com/tmux-plugins/vim-tmux-focus-events.git 287 | [submodule "lib/vim/bundle/vim-toml"] 288 | path = lib/vim/bundle/toml 289 | url = https://github.com/cespare/vim-toml.git 290 | [submodule "lib/vim/bundle/vim-unimpaired"] 291 | path = lib/vim/bundle/unimpaired 292 | url = https://github.com/tpope/vim-unimpaired.git 293 | [submodule "lib/vim/bundle/vis"] 294 | path = lib/vim/bundle/vis 295 | url = https://github.com/vim-scripts/vis.git 296 | [submodule "lib/vim/bundle/which-key"] 297 | path = lib/vim/bundle/which-key 298 | url = https://github.com/liuchengxu/vim-which-key.git 299 | [submodule "lib/vim/bundle/yats.vim"] 300 | path = lib/vim/bundle/yats 301 | url = https://github.com/HerringtonDarkholme/yats.vim.git 302 | [submodule "lib/vim/bundle/ZoomWin"] 303 | path = lib/vim/bundle/ZoomWin 304 | url = https://github.com/vim-scripts/ZoomWin.git 305 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | ruby '>= 2.3', '< 4.0' 4 | 5 | gem 'rainbow', '~> 3.0.0' 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-Present J. Andrew Marshall 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | I have a love affair with my terminal. This is my collection of terminal configuration files that (attempt to) make daily use of the terminal easier, faster, and perhaps even more enjoyable. It’s all about strengthening the bond `;)`. 4 | 5 | ## Installation 6 | 7 | Run `./bin/install`. Rerun whenever updating, as configuration files are locked at the last run time. 8 | 9 | ### Git identities 10 | 11 | In order to facilitate using multiple identities for Git, identity-specific configuration is omitted from the default global Git config. Instead, create a file alongside the config file (in `$XDG_CONFIG_HOME/git/`) named `identities` akin to: 12 | 13 | ```gitconfig 14 | [identity "personal"] 15 | name = John Doe 16 | email = john@home.example 17 | [identity "work"] 18 | name = John Doe 19 | email = john@work.example 20 | sshIdentity = ~/.ssh/work/id_rsa 21 | ``` 22 | 23 | Then use `git identity` passing the identity name to set in the local, per-repository configuration. 24 | 25 | ## Recommended CLI software 26 | 27 | ### Battle-tested 28 | 29 | - [csvkit](https://csvkit.readthedocs.io) (utilities for working with CSV files) 30 | - [fd](https://github.com/sharkdp/fd) (replacement for `find`) 31 | - [fzf](https://github.com/junegunn/fzf) (fuzzy finder) 32 | - [neovim](https://neovim.io/) (replacement for vim) 33 | - [ripgrep](https://github.com/BurntSushi/ripgrep) (replacement for `ag`, `ack`, `grep`) 34 | - [tig](https://jonas.github.io/tig/) (GUI front-end for Git) 35 | 36 | ### Incubating 37 | 38 | - [entr](http://www.entrproject.org/) (file watcher) 39 | - [exa](https://the.exa.website/) (replacement for `ls`) 40 | - [fzz](https://github.com/mrnugget/fzz) (interactively rerun commands) 41 | - [noti](https://github.com/variadico/noti) (cross-platform notifications) 42 | - [rat](https://github.com/ericfreese/rat) (build GUIs from command pipelines) 43 | 44 | ## License & Credits 45 | 46 | Copyright © 2011–Present J. Andrew Marshall. License is available in the LICENSE file. 47 | 48 | Original inspiration from [Ryan Bates](https://github.com/ryanb/dotfiles). 49 | 50 | Various parts inspired by or adapted from 51 | [Brian Racer](https://github.com/anveo/dotfiles), 52 | [Todd Werth](https://github.com/twerth/dotfiles), 53 | [Gary Bernhardt](https://github.com/garybernhardt/dotfiles), & 54 | [Pivotal Labs](https://github.com/pivotal/vim-config)/[Case Commons](https://github.com/Casecommons/vim-config). 55 | Other credits not listed here may be noted in comments. 56 | -------------------------------------------------------------------------------- /bin/colortest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | ROOT="$(dirname "${BASH_SOURCE[0]}")/.." 6 | 7 | # https://unix.stackexchange.com/a/404415/9811 8 | truecolor_test() { 9 | awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{ 10 | s="/\\"; 11 | for (colnum = 0; colnum255) g = 510-g; 16 | printf "\033[48;2;%d;%d;%dm", r,g,b; 17 | printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; 18 | printf "%s\033[0m", substr(s,colnum%2+1,1); 19 | } 20 | printf "\n"; 21 | }' 22 | } 23 | 24 | base16_theme_test() { 25 | "$ROOT"/lib/shell/vendor/base16-shell/colortest ' ' 26 | } 27 | 28 | printable_colours=256 29 | 30 | # https://gist.github.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263 31 | # Return a colour that contrasts with the given colour 32 | # Bash only does integer division, so keep it integral 33 | contrast_colour() { 34 | local r g b luminance 35 | colour="$1" 36 | 37 | if (( colour < 16 )); then # Initial 16 ANSI colours 38 | (( colour == 0 )) && printf "15" || printf "0" 39 | return 40 | fi 41 | 42 | # Greyscale # rgb_R = rgb_G = rgb_B = (number - 232) * 10 + 8 43 | if (( colour > 231 )); then # Greyscale ramp 44 | (( colour < 244 )) && printf "15" || printf "0" 45 | return 46 | fi 47 | 48 | # All other colours: 49 | # 6x6x6 colour cube = 16 + 36*R + 6*G + B # Where RGB are [0..5] 50 | # See http://stackoverflow.com/a/27165165/5353461 51 | 52 | # r=$(( (colour-16) / 36 )) 53 | g=$(( ((colour-16) % 36) / 6 )) 54 | # b=$(( (colour-16) % 6 )) 55 | 56 | # If luminance is bright, print number in black, white otherwise. 57 | # Green contributes 587/1000 to human perceived luminance - ITU R-REC-BT.601 58 | (( g > 2)) && printf "0" || printf "15" 59 | return 60 | 61 | # Uncomment the below for more precise luminance calculations 62 | 63 | # # Calculate percieved brightness 64 | # # See https://www.w3.org/TR/AERT#color-contrast 65 | # # and http://www.itu.int/rec/R-REC-BT.601 66 | # # Luminance is in range 0..5000 as each value is 0..5 67 | # luminance=$(( (r * 299) + (g * 587) + (b * 114) )) 68 | # (( $luminance > 2500 )) && printf "0" || printf "15" 69 | } 70 | 71 | # https://gist.github.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263 72 | # Print a coloured block with the number of that colour 73 | function print_colour { 74 | local colour="$1" contrast 75 | contrast=$(contrast_colour "$1") 76 | printf "\e[48;5;%sm" "$colour" # Start block of colour 77 | printf "\e[38;5;%sm%3d" "$contrast" "$colour" # In contrast, print number 78 | printf "\e[0m " # Reset colour 79 | } 80 | 81 | # https://gist.github.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263 82 | # Starting at $1, print a run of $2 colours 83 | function print_run { 84 | local i 85 | for (( i = "$1"; i < "$1" + "$2" && i < printable_colours; i++ )) do 86 | print_colour "$i" 87 | done 88 | printf " " 89 | } 90 | 91 | # https://gist.github.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263 92 | # Print blocks of colours 93 | function print_blocks { 94 | local start="$1" i 95 | local end="$2" # inclusive 96 | local block_cols="$3" 97 | local block_rows="$4" 98 | local blocks_per_line="$5" 99 | local block_length=$((block_cols * block_rows)) 100 | 101 | # Print sets of blocks 102 | for (( i = start; i <= end; i += (blocks_per_line-1) * block_length )) do 103 | printf "\n" # Space before each set of blocks 104 | # For each block row 105 | for (( row = 0; row < block_rows; row++ )) do 106 | # Print block columns for all blocks on the line 107 | for (( block = 0; block < blocks_per_line; block++ )) do 108 | print_run $(( i + (block * block_length) )) "$block_cols" 109 | done 110 | (( i += block_cols )) # Prepare to print the next row 111 | printf "\n" 112 | done 113 | done 114 | } 115 | 116 | cd "$ROOT" 117 | 118 | echo "Truecolor" 119 | truecolor_test 120 | echo 121 | 122 | echo "256 colors" 123 | print_run 0 16 # The first 16 colours are spread over the whole spectrum 124 | echo 125 | print_blocks 16 231 6 6 3 # 6x6x6 colour cube between 16 and 231 inclusive 126 | print_blocks 232 255 12 2 1 # Not 50, but 24 Shades of Grey 127 | echo 128 | 129 | echo "Base16 theme colors" 130 | base16_theme_test 131 | -------------------------------------------------------------------------------- /bin/install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # rubocop:disable Lint/MissingCopEnableDirective,Style/FormatString,Style/GlobalVars,Style/StderrPuts 5 | 6 | require 'bundler' 7 | begin 8 | Bundler.setup 9 | rescue Bundler::RubyVersionMismatch => ex 10 | $stderr.puts ex.message 11 | exit 1 12 | end 13 | 14 | require 'fileutils' 15 | require 'open3' 16 | require 'optparse' 17 | require 'pathname' 18 | require 'rainbow' 19 | require 'set' 20 | require 'shellwords' 21 | 22 | def xdg_home(name) 23 | Pathname.new(ENV.fetch("XDG_#{name}_HOME", XDG_DEFAULT_HOMES.fetch(name))) 24 | end 25 | 26 | HOME = Pathname.new(Dir.home).freeze 27 | XDG_DEFAULT_HOMES = { 28 | 'DATA' => HOME.join('.local', 'share'), 29 | 'CACHE' => HOME.join('.cache'), 30 | 'CONFIG' => HOME.join('.config'), 31 | }.freeze 32 | LNK_ROOT = xdg_home('CONFIG').join('dotfiles').freeze 33 | SRC_ROOT = Pathname.new(__dir__).parent.freeze 34 | 35 | Options = Struct.new(:dry_run, :fast, :force, :verbose) 36 | 37 | def exe_exists?(exe) 38 | _, _, wait_thr = Open3.popen2('command', '-v', exe, out: '/dev/null', err: '/dev/null') 39 | wait_thr.value.success? 40 | end 41 | 42 | def is_child?(child, of:) 43 | parent = of 44 | child.ascend.include?(parent) 45 | end 46 | 47 | def system!(*args, &block) 48 | if $options.verbose 49 | args.delete('--quiet') 50 | end 51 | system(*args, &block) or raise 'command failed' 52 | end 53 | 54 | def copy(src, dest) 55 | run do 56 | if src.exist? && dest.exist? 57 | FileUtils.rm(dest, force: true) 58 | end 59 | FileUtils.cp(src, dest, preserve: false) 60 | FileUtils.chmod('u+w', dest) 61 | end 62 | end 63 | 64 | def link_status(original, link) 65 | if link.exist? || link.symlink? 66 | if link.symlink? && link.readlink == original 67 | :ok 68 | else 69 | :other 70 | end 71 | else 72 | :unlinked 73 | end 74 | end 75 | 76 | def link(original, link, force: $options.force) 77 | link_rel = link.relative_path_from(HOME) 78 | original_rel = original.relative_path_from(HOME) 79 | 80 | case [link_status(original, link), force] 81 | when [:ok, true], [:ok, false] 82 | if $options.verbose 83 | $stdout.puts Rainbow('Already linked: ~/%s' % link_rel) 84 | end 85 | when [:other, false] 86 | $stdout.puts Rainbow('Exists (skipping): ~/%s' % link_rel).yellow 87 | when [:unlinked, true], [:unlinked, false], [:other, true] 88 | run { link.parent.mkpath } 89 | if force && (link.exist? || link.symlink?) 90 | run { link.delete } 91 | end 92 | run { File.symlink(original, link) } 93 | lnk_msg = '~/%s => ~/%s' % [link_rel, original_rel] 94 | if force 95 | $stdout.puts Rainbow("Forced: #{lnk_msg}").green 96 | else 97 | $stdout.puts Rainbow("Linked: #{lnk_msg}").green 98 | end 99 | else raise 100 | end 101 | end 102 | 103 | def move_or_delete(src, dst) 104 | if src.exist? 105 | if dst.exist? 106 | run { src.unlink } 107 | $stdout.puts Rainbow("Deleted: #{src.relative_path_from(HOME)}").green 108 | else 109 | run do 110 | dst.parent.mkpath 111 | src.rename(dst) 112 | end 113 | $stdout.puts Rainbow("Moved: #{src.relative_path_from(HOME)} -> #{dst.relative_path_from(HOME)}").green 114 | end 115 | end 116 | end 117 | 118 | def abort(*lines) 119 | msg = lines.join("\n") 120 | $stderr.puts Rainbow('FATAL: %s' % msg).red 121 | exit(false) 122 | end 123 | 124 | def warn(*lines) 125 | msg = lines.join("\n") 126 | $stderr.puts Rainbow('WARNING: %s' % msg).yellow 127 | end 128 | 129 | def step(msg) 130 | $stderr.puts "#{Rainbow('==>').blue} #{Rainbow(msg).bold}" 131 | yield 132 | end 133 | 134 | def run(dry_run: $options.dry_run) 135 | yield unless dry_run 136 | end 137 | 138 | def parse_options 139 | options = Options.new(false, false, false) 140 | OptionParser.new do |opts| 141 | opts.banner = 'Usage: install [options]' 142 | opts.on('-d', '--dry-run', 'Output what would be done without doing anything') do |val| 143 | options.dry_run = val 144 | end 145 | opts.on('--force', 'Overwrite existing files') do |val| 146 | options.force = val 147 | end 148 | opts.on('-F', '--fast', 'Skips submodule initialization') do 149 | options.fast = true 150 | end 151 | opts.on('--verbose', 'Log verbose messaging') do |val| 152 | options.verbose = val 153 | end 154 | opts.on('-h', '--help', 'Show help') do 155 | puts opts 156 | exit 157 | end 158 | end.parse! 159 | options.freeze 160 | end 161 | 162 | def firefox_profile_root 163 | [ 164 | HOME.join('Library/Application Support/Firefox/Profiles'), 165 | HOME.join('.mozilla/firefox'), 166 | HOME.join('.mozilla/profiles'), 167 | ].detect(&:exist?) 168 | end 169 | 170 | def firefox_profiles 171 | firefox_profile_root.children.select(&:directory?) 172 | end 173 | 174 | def default_firefox_profile 175 | return unless firefox_profile_root 176 | default_profile_name = 177 | Dir.glob(firefox_profile_root.join('*.default-release')).first || 178 | Dir.glob(firefox_profile_root.join('*.default')).first 179 | return unless default_profile_name 180 | default_profile = firefox_profile_root.join(default_profile_name) 181 | default_profile.exist? && default_profile 182 | end 183 | 184 | def install! 185 | FileUtils.cd(SRC_ROOT) 186 | 187 | unless $options.fast 188 | step 'Syncing submodules' do 189 | run { system!(*%w[git submodule sync --quiet --recursive]) } 190 | end 191 | 192 | step 'Installing submodules' do 193 | run { system!(*%w[git submodule update --quiet --init --jobs 2 --recursive]) } 194 | end 195 | 196 | step 'Pruning (some) submodules' do 197 | run { system!(*%w[git clean -d -f -f lib/vim/bundle]) } 198 | end 199 | end 200 | 201 | step 'Auditing Vim packages' do 202 | bundle_plugins = SRC_ROOT.join('lib/vim/bundle').children.to_set 203 | start_packages = SRC_ROOT.join('lib/vim/pack/user/start').children 204 | opt_packages = SRC_ROOT.join('lib/vim/pack/user/opt').children 205 | packages = start_packages + opt_packages 206 | packaged_plugins = packages.map(&:realdirpath).to_set 207 | 208 | dead_packages = packages.reject(&:exist?) 209 | missing_packages = bundle_plugins - packaged_plugins 210 | duplicated_packages = packages 211 | .group_by(&:realdirpath) 212 | .select { |_real_path, package_paths| package_paths.size > 1 } 213 | 214 | if dead_packages.any? 215 | warn( 216 | 'The following Vim package links are dead:', 217 | *dead_packages.map { |path| format(' - %s', path.to_s) }, 218 | ) 219 | end 220 | if missing_packages.any? 221 | warn( 222 | 'The following Vim plugins are not linked into packages:', 223 | *missing_packages.map { |path| format(' - %s', path.to_s) }, 224 | ) 225 | end 226 | if duplicated_packages.any? 227 | abort( 228 | 'The following Vim plugins are linked to multiple packages:', 229 | *duplicated_packages.map do |plugin_path, package_paths| 230 | format(' - %s: %s', plugin_path, package_paths.join(', ')) 231 | end, 232 | ) 233 | end 234 | end 235 | 236 | step 'Cloning into config' do 237 | run { LNK_ROOT.mkpath } 238 | run do 239 | system!( 240 | *%w[rsync --quiet --archive --delete --chmod=F-w --exclude=.git --safe-links], 241 | SRC_ROOT.join('lib').realpath.to_s.concat('/'), 242 | LNK_ROOT.realpath.to_s, 243 | ) 244 | end 245 | end 246 | 247 | step 'Linking root files' do 248 | LNK_ROOT.join('root').children.each do |path| 249 | link(path, HOME.join(".#{path.basename}")) 250 | end 251 | end 252 | 253 | step 'Linking bin files' do 254 | LNK_ROOT.join('bin').children.each do |path| 255 | link(path, HOME.join('bin', path.basename)) 256 | end 257 | end 258 | 259 | step 'Linking XDG config files' do 260 | config_src_root = LNK_ROOT.join('config') 261 | Pathname.glob(config_src_root.join('**/*'), File::FNM_DOTMATCH).select(&:file?).each do |path| 262 | link(path, xdg_home('CONFIG').join(path.relative_path_from(config_src_root))) 263 | end 264 | end 265 | 266 | step 'Linking spacemacs' do 267 | emacs_root = HOME.join('.emacs.d') 268 | emacs_root.mkdir unless emacs_root.exist? 269 | %w[core layers init.el].each do |fname| 270 | link(LNK_ROOT.join('spacemacs', fname), emacs_root.join(fname)) 271 | end 272 | end 273 | 274 | step 'Linking misc. configs' do 275 | LNK_ROOT.join('gnupg').children.each do |path| 276 | link(path, HOME.join('.gnupg', path.basename)) 277 | end 278 | end 279 | 280 | step 'Linking Firefox custom profile' do 281 | default_firefox_profile = default_firefox_profile() 282 | if default_firefox_profile 283 | run { default_firefox_profile.join('chrome').mkpath } 284 | firefox_profiles.each do |firefox_profile| 285 | link(LNK_ROOT.join('firefox/userChrome.css'), firefox_profile.join('chrome/userChrome.css')) 286 | copy(LNK_ROOT.join('firefox/userContent.css'), firefox_profile.join('chrome/userContent.css')) 287 | link(LNK_ROOT.join('firefox/user.js'), firefox_profile.join('user.js')) 288 | end 289 | else 290 | warn 'Skipping because Firefox profile cannot be found' 291 | end 292 | end 293 | 294 | if `uname`.strip =~ /\bdarwin\b/i 295 | step 'Linking macOS-specific configuration' do 296 | key_bindings_path = HOME.join('Library/KeyBindings') 297 | run { key_bindings_path.mkpath } 298 | link(LNK_ROOT.join('macos/DefaultKeyBinding.dict'), key_bindings_path.join('DefaultKeyBinding.dict')) 299 | end 300 | end 301 | 302 | step 'Installing terminfo entries' do 303 | if exe_exists?('toe') 304 | SRC_ROOT.join('lib', 'terminfo').children.each do |entry| 305 | name = entry.basename.to_s.split('.', 2).first 306 | if ! system "toe -a | grep --quiet #{Shellwords.escape(name)}" 307 | run { system!('tic', '-o', HOME.join('.terminfo').to_s, entry.realpath.to_s) } 308 | end 309 | end 310 | else 311 | warn 'Skipping because “toe” cannot be found' 312 | end 313 | end 314 | 315 | # [TODO] Entries here should be removed every so often 316 | step 'Manually migrating some files' do 317 | move_or_delete(HOME.join('.irb_history'), HOME.join(xdg_home('DATA').join('irb', 'history'))) 318 | move_or_delete(HOME.join('.pry_history'), HOME.join(xdg_home('DATA').join('pry', 'history'))) 319 | move_or_delete(HOME.join('.zsh_history'), HOME.join(xdg_home('DATA').join('zsh', 'history'))) 320 | end 321 | 322 | step 'Pruning dead links' do 323 | def prune_dead(src_dir:, dst_dir:) 324 | src_dir.children.select(&:symlink?).each do |file| 325 | dst = file.readlink 326 | if is_child?(dst, of: dst_dir) && !dst.exist? 327 | $stdout.puts Rainbow('Pruned: %s' % file).green 328 | run { file.unlink } 329 | end 330 | end 331 | end 332 | 333 | prune_dead(src_dir: HOME, dst_dir: LNK_ROOT) 334 | prune_dead(src_dir: xdg_home('CONFIG'), dst_dir: LNK_ROOT) 335 | end 336 | end 337 | 338 | begin 339 | $options = parse_options 340 | rescue OptionParser::InvalidOption => ex 341 | abort(ex.message) 342 | end 343 | install! 344 | -------------------------------------------------------------------------------- /doc/useful_commands.md: -------------------------------------------------------------------------------- 1 | # Useful commands 2 | 3 | Here lie some useful commands that are awesome but are usually too rarely used to remember. They are useful for... 4 | 5 | - Validating a macOS binary's code signature 6 | ``` 7 | codesign -v /Applications/Example.app 8 | ``` 9 | 10 | - Determining DNS info 11 | ``` 12 | dig @8.8.8.8 example.com any 13 | ``` 14 | 15 | - Determining the architectures within a universal binary 16 | ``` 17 | file 18 | ``` 19 | 20 | - Finding C/C++ standard libraries 21 | ``` 22 | `clang -print-prog-name=cc1` -v 23 | `clang -print-prog-name=cc1plus` -v 24 | ``` 25 | 26 | - Updating all git submodules 27 | ``` 28 | git submodule update --remote 29 | ``` 30 | 31 | - Finding what package installed a binary (Ubuntu/Debian) 32 | ``` 33 | dpkg -S `which examplebinary` 34 | ``` 35 | 36 | - Searching for a string/regex in git diff history 37 | ``` 38 | git -Sstringtosearchfor --since=2012.2.17 --until=2012.3.14 -- pathname 39 | git --pickaxe-regex "regextosearchfor" --since=2012.2.17 --until=2012.3.14 --pathname 40 | ``` 41 | 42 | - Compiling Ruby with ruby-install and optimizations 43 | ``` 44 | ruby-install --cleanup --jobs --src-dir "$TMPDIR" RUBY_PLATFORM RUBY_VERSION 45 | ``` 46 | 47 | - Getting an SSH key's fingerprint 48 | ``` 49 | ssh-keygen -lf /path/to/keyfile 50 | ``` 51 | 52 | - Removing excessive trailing newlines from files 53 | ``` 54 | find . -type f -print0 | xargs -0 perl -pi -w -e 'BEGIN{$/=undef}; s/(\n)+\Z/\n/' 55 | ``` 56 | 57 | - Removing (more than two) consecutive blank lines from files 58 | ``` 59 | find . -type f -print0 | xargs -0 perl -pi -w -e 'BEGIN{$/=undef}; s/\n\n+/\n\n/' 60 | ``` 61 | 62 | - Removing excess padding in Ruby class/def/end blocks 63 | ``` 64 | find app lib spec config -type f -iname '*.rb' -print0 | xargs -0 perl -pi -w -e 'BEGIN{$/=undef}; s/(\n *end\n)\n+( *end\n)/$1$2/' 65 | find app lib spec config -type f -iname '*.rb' -print0 | xargs -0 perl -pi -w -e 'BEGIN{$/=undef}; s/(\n *(class|def) [^\n]*\n)\n+/$1/' 66 | find app lib spec config -type f -iname '*.rb' -print0 | xargs -0 perl -pi -w -e 'BEGIN{$/=undef}; s/( do(\n|(\|[^|\n]+)?)\n)\n+/$1/' 67 | ``` 68 | 69 | - Finding the MTU used between two machines (test from boths ends) 70 | ``` 71 | route get 72 | ``` 73 | 74 | - Finding hosts on your LAN (best with sudo, change subnet accordingly) 75 | ``` 76 | nmap -sn -oG - 192.168.1.0/24 | egrep '^Host:' | column -t 77 | ``` 78 | -------------------------------------------------------------------------------- /doc/useful_vim.md: -------------------------------------------------------------------------------- 1 | # Useful Vim 2 | 3 | - Convert Ruby hashrocket (`:foo => "bar"`) to Ruby 1.9 style (`foo: "bar"`) 4 | ``` 5 | s@:\([a-zA-Z_]\+\)\s*=>@\=submatch(1) . ": "@gc 6 | ``` 7 | -------------------------------------------------------------------------------- /lib/bin/adobe-kill: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | for path in /Library/LaunchAgents /Library/LaunchDaemons ~/Library/LaunchAgents; do 6 | launchctl unload -w "$path"/com.adobe.* 7 | sudo rm "$path"/com.adobe.* 8 | done 9 | 10 | killall 'Adobe Desktop Service' 11 | sudo killall 'AGMService' 12 | sudo killall 'AGSService' 13 | killall 'AdobeCRDaemon' 14 | pkill -f 'CCLibrary' 15 | pkill -f 'CCXProcess' 16 | killall 'Core Sync' 17 | killall 'ACCFinderSync' 18 | 19 | sudo pkill -f 'com.adobe' 20 | 21 | killall 'AdobeIPCBroker' 22 | -------------------------------------------------------------------------------- /lib/bin/curltime: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl_format() { 4 | cat <<'EOF' 5 | namelookup: %{time_namelookup}s 6 | connect: %{time_connect}s 7 | appconnect: %{time_appconnect}s 8 | pretransfer: %{time_pretransfer}s 9 | redirect: %{time_redirect}s 10 | starttransfer: %{time_starttransfer}s 11 | total: %{time_total}s\n 12 | EOF 13 | } 14 | 15 | exec curl --write-out "$(curl_format)" --output /dev/null --silent "$@" 16 | -------------------------------------------------------------------------------- /lib/bin/extract: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | path="$1" 4 | path_lower="$(echo "$path" | tr '[:upper:]' '[:lower:]')" 5 | 6 | if [ -f "$path" ]; then 7 | case "$path_lower" in 8 | *.tar.bz2) exec tar xjf "$path" ;; 9 | *.tar.gz) exec tar xzf "$path" ;; 10 | *.tar.xz) exec tar xJf "$path" ;; 11 | *.7z) exec 7z x "$path" ;; 12 | *.Z) exec uncompress "$path";; 13 | *.bz2) exec bunzip2 "$path" ;; 14 | *.gz) exec gunzip "$path" ;; 15 | *.rar) exec unrar x "$path" ;; 16 | *.tar) exec tar xf "$path" ;; 17 | *.tbz2) exec tar xjf "$path" ;; 18 | *.tgz) exec tar xzf "$path" ;; 19 | *.txz) exec tar xJf "$path" ;; 20 | *.xz) exec unxz "$path" ;; 21 | *.zip) exec unzip "$path" ;; 22 | *.zst) exec unztd "$path" ;; 23 | *) echo "Don't know how to extract '$path'.";; 24 | esac 25 | else 26 | echo "'$path' is not a valid file." 27 | fi 28 | -------------------------------------------------------------------------------- /lib/bin/filter: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import io 5 | import re 6 | import subprocess 7 | import sys 8 | import typing as T 9 | 10 | parser = argparse.ArgumentParser() 11 | parser.add_argument( 12 | '-d', 13 | '--delimiter', 14 | default="\n", 15 | help='delimiter to separate items in input', 16 | ) 17 | parser.add_argument( 18 | '-r', 19 | '--regex', 20 | action='store_true', 21 | help='interpret delimiter as a regular expression', 22 | ) 23 | parser.add_argument( 24 | '-v', 25 | '--invert', 26 | action='store_true', 27 | help='include when the command fails, rather than succeeds', 28 | ) 29 | parser.add_argument('command', nargs='+') 30 | args = parser.parse_args() 31 | 32 | command = args.command 33 | delimiter_is_regex = args.regex 34 | if delimiter_is_regex: 35 | delimiter = re.compile(args.delimiter) 36 | else: 37 | delimiter = args.delimiter 38 | invert = args.invert 39 | 40 | 41 | def read_split(f: T.IO[str], delimiter: T.Union[str, T.Pattern]) -> T.Iterator[str]: 42 | delimiter_re: T.Optional[T.Pattern] 43 | if isinstance(delimiter, T.Pattern): 44 | delimiter_re = delimiter 45 | delimiter_str = None 46 | else: 47 | delimiter_re = None 48 | delimiter_str = delimiter 49 | 50 | buf = '' 51 | while chunk := f.read(io.DEFAULT_BUFFER_SIZE): 52 | if delimiter_re: 53 | head, *tail = re.split(delimiter_re, chunk) 54 | else: 55 | head, *tail = chunk.split(delimiter_str) 56 | 57 | if tail: 58 | yield buf + head 59 | buf = tail.pop() 60 | for part in tail: 61 | yield part 62 | else: 63 | buf += chunk 64 | if buf: 65 | yield buf 66 | 67 | 68 | for line in map(str.rstrip, read_split(sys.stdin, delimiter=delimiter)): 69 | proc = subprocess.run(command, input=line, stdout=subprocess.DEVNULL, text=True) 70 | is_success = proc.returncode == 0 71 | if invert ^ is_success: 72 | print(line) 73 | -------------------------------------------------------------------------------- /lib/bin/git-branch-cleanup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | runcmd() { 4 | echo + "$@" >&2 5 | if [[ -z "$DRY_RUN" ]]; then 6 | "$@" 7 | else 8 | return 0 9 | fi 10 | } 11 | 12 | git_branches() { 13 | git for-each-ref --format='%(refname)' refs/heads/ "$@" | perl -pe 's@^refs/heads/@@' 14 | } 15 | 16 | orphaned_branches() { 17 | for branch in $(git_branches); do 18 | remote=$(git config --local "branch.$branch.remote" || echo '') 19 | remote_branch=$(git config --local "branch.$branch.merge" | perl -pe 's@^refs/heads/@@' || echo '') 20 | if [[ -n $remote ]] && [[ -n $remote_branch ]]; then 21 | if ! git rev-parse "refs/remotes/$remote/$remote_branch" &> /dev/null; then 22 | echo "$branch" 23 | fi 24 | fi 25 | done 26 | } 27 | 28 | default_branches() { 29 | for remote in $(git remote); do 30 | git remote set-head --auto "$remote" &> /dev/null 31 | git rev-parse --abbrev-ref "$remote/HEAD" | perl -e 'while() { s@\Q$ARGV[0]/@@; print }' "$remote" 32 | done 33 | } 34 | 35 | deletable_branches() { 36 | git_branches --merged "$@" 37 | orphaned_branches 38 | } 39 | 40 | ignorable_branches() { 41 | git rev-parse --abbrev-ref HEAD 42 | default_branches 43 | } 44 | 45 | branches_to_delete() { 46 | comm -23 <(deletable_branches "$@" | sort) <(ignorable_branches | sort) | uniq 47 | } 48 | 49 | for branch in $(branches_to_delete "$@"); do 50 | runcmd git branch --delete --force "$branch" 51 | done 52 | -------------------------------------------------------------------------------- /lib/bin/git-changed-files: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | default_branch() { 6 | git rev-parse --abbrev-ref refs/remotes/origin/HEAD 2>/dev/null \ 7 | | perl -pe 's@^origin/@@' \ 8 | || echo master 9 | } 10 | 11 | compare=${1:-$(default_branch)} 12 | git --no-pager diff --diff-filter=d --name-only "$(git fork-point "$compare" HEAD || git merge-base "$compare" HEAD)" 13 | -------------------------------------------------------------------------------- /lib/bin/git-identity: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | identity="$1" 6 | 7 | if [[ -z "$identity" ]]; then 8 | echo "usage: $0 " 9 | exit 1 10 | fi 11 | 12 | name=$(git config "identity.$identity.name") 13 | email=$(git config "identity.$identity.email") 14 | git config --local user.name "$name" 15 | git config --local user.email "$email" 16 | if git config "identity.$identity.sshIdentity" >/dev/null; then 17 | git config --local core.sshCommand "ssh -i '$(git config "identity.$identity.sshIdentity")'" 18 | fi 19 | -------------------------------------------------------------------------------- /lib/bin/git-merge-point: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Finds the commit which merged `rev` into `head`. 4 | 5 | set -e 6 | 7 | rev=$1 8 | head=${2:-HEAD} 9 | 10 | has_gnu_comm=$(comm --version 2>/dev/null | grep --quiet --fixed-strings GNU; echo $?) 11 | 12 | comm_compat() { 13 | if [[ $has_gnu_comm = 0 ]]; then 14 | comm --nocheck-order "$@" 15 | else 16 | comm "$@" 17 | fi 18 | } 19 | 20 | comm_compat -12 \ 21 | <(git rev-list "$rev".."$head" --ancestry-path --merges) \ 22 | <(git rev-list "$rev".."$head" --first-parent) \ 23 | | tail -1 24 | -------------------------------------------------------------------------------- /lib/bin/git-unite: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # rubocop:disable Lint/MissingCopEnableDirective, Style/StderrPuts 5 | 6 | def abort(msg) 7 | $stderr.puts format('git-unite: %s', msg) 8 | exit(false) 9 | end 10 | 11 | def run(*args) 12 | $stderr.puts format('==> %s', args.join(' ')) 13 | return if ENV.key?('DRY_RUN') 14 | 15 | system(*args) or exit(false) 16 | end 17 | 18 | def read(*args) 19 | IO.popen(args, &:read).strip 20 | end 21 | 22 | def extract_branch_arg(args) 23 | candidates = args.reject do |arg| 24 | arg.start_with?('-') 25 | end 26 | case candidates.size 27 | when 1 28 | return candidates.first 29 | when 0 30 | abort 'found no argument that looked like a branch' 31 | else 32 | abort 'found multiple arguments that looked like a branch' 33 | end 34 | end 35 | 36 | def find_upstream_tracking(local_branch_name) 37 | output = read 'git', 'rev-parse', '--abbrev-ref', '--symbolic-full-name', format('%s@{u}', local_branch_name) 38 | output.split('/', 2) 39 | end 40 | 41 | branch = extract_branch_arg(ARGV) 42 | upstream_tracking_remote, upstream_tracking_branch = find_upstream_tracking(branch) 43 | 44 | run 'git', 'merge', *ARGV 45 | run 'git', 'push' 46 | run 'git', 'branch', '--delete', branch 47 | run 'git', 'push', '--delete', '--force-with-lease', upstream_tracking_remote, upstream_tracking_branch 48 | -------------------------------------------------------------------------------- /lib/bin/install-basic-gems.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | base_gems_with_doc=( 4 | bundler 5 | facets 6 | paint 7 | rspec 8 | ) 9 | 10 | base_gems_without_doc=( 11 | fruity 12 | pry 13 | pry-doc 14 | pry-theme 15 | ) 16 | 17 | extra_gems_with_doc=( 18 | rack 19 | rails 20 | sinatra 21 | ) 22 | 23 | extra_gems_without_doc=( 24 | lunchy 25 | ) 26 | 27 | update_rubygems() { 28 | gem update --system 29 | gem update 30 | } 31 | 32 | cleanup() { 33 | gem cleanup 34 | } 35 | 36 | install_with_doc() { 37 | gem install "$1" 38 | } 39 | 40 | install_without_doc() { 41 | gem install --no-document --no-ri --no-rdoc "$1" 42 | } 43 | 44 | install_base_gems() { 45 | for gem in "${base_gems_with_doc[@]}"; do install_with_doc "$gem"; done 46 | for gem in "${base_gems_without_doc[@]}"; do install_without_doc "$gem"; done 47 | } 48 | 49 | install_extra_gems() { 50 | for gem in "${extra_gems_with_doc[@]}"; do install_with_doc "$gem"; done 51 | for gem in "${extra_gems_without_doc[@]}"; do install_without_doc "$gem"; done 52 | } 53 | 54 | set -e 55 | set -x 56 | 57 | update_rubygems 58 | install_base_gems 59 | [ "$1" = 'full' ] && install_extra_gems 60 | cleanup 61 | -------------------------------------------------------------------------------- /lib/bin/launch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | type "$1" >/dev/null 6 | 7 | args=() 8 | if command -v systemd-cat &>/dev/null; then 9 | args+=('systemd-cat' '--identifier' "$1" '--') 10 | fi 11 | args+=("$@") 12 | 13 | "${args[@]}" /dev/null & 14 | disown %% 15 | -------------------------------------------------------------------------------- /lib/bin/mkdiff: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ -z $DIFF ]] && command -v colordiff &>/dev/null; then 4 | DIFF=colordiff 5 | fi 6 | 7 | a=$(mktemp) 8 | b=$(mktemp) 9 | cat > "$a" 10 | cp "$a" "$b" 11 | "$VISUAL" "$b" 12 | "${DIFF:-diff}" -u "$@" -- "$a" "$b" 13 | rm "$a" "$b" 14 | -------------------------------------------------------------------------------- /lib/bin/nam: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | command=$1 4 | 5 | if [ $# -eq 1 ]; then 6 | if man -w "$command" >/dev/null 2>/dev/null; then 7 | man "$command" 8 | elif command -v "$command" >/dev/null 2> /dev/null; then 9 | if "$command" --help >/dev/null 2> /dev/null; then 10 | "$command" --help | "$PAGER" 11 | elif "$command" -h >/dev/null 2> /dev/null; then 12 | "$command" -h | "$PAGER" 13 | else 14 | printf "Don't know how to get help for %s\\n" "$command" >&2 15 | return 1 16 | fi 17 | else 18 | printf "Command \"%s\" not found\\n" "$command" >&2 19 | return 1 20 | fi 21 | else 22 | if [ $# -eq 0 ]; then 23 | printf "What command do you want help for?\\n" >&2 24 | else 25 | printf "One command at a time, please.\\n" >&2 26 | fi 27 | return 1 28 | fi 29 | -------------------------------------------------------------------------------- /lib/bin/speedtest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | size="$1" 4 | [ -z "$size" ] && size=10 5 | wget --output-document=/dev/null "http://cachefly.cachefly.net/${size}mb.test" 6 | -------------------------------------------------------------------------------- /lib/bin/sway: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # See also lib/shell/plugins/_core/env.zsh 4 | export CLUTTER_BACKEND=wayland 5 | export GDK_DPI_SCALE=1.5 6 | export MOZ_ENABLE_WAYLAND=1 7 | export QT_QPA_PLATFORM=wayland-egl 8 | export QT_SCALE_FACTOR=1.5 9 | export SDL_VIDEODRIVER=wayland 10 | export XDG_CURRENT_DESKTOP=sway 11 | export XDG_SESSION_TYPE=wayland 12 | 13 | exec systemd-cat --identifier sway dbus-run-session -- sway "$@" 14 | -------------------------------------------------------------------------------- /lib/bin/terminal-truecolor: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Based on: https://gist.github.com/XVilka/8346728 4 | 5 | width="$1" 6 | 7 | awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{ 8 | s="/\\"; 9 | for (colnum = 0; colnum255) g = 510-g; 14 | printf "\033[48;2;%d;%d;%dm", r,g,b; 15 | printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; 16 | printf "%s\033[0m", substr(s,colnum%2+1,1); 17 | } 18 | printf "\n"; 19 | }' 20 | -------------------------------------------------------------------------------- /lib/bin/tzc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from argparse import ArgumentParser 4 | import datetime as dt 5 | import subprocess 6 | import sys 7 | import typing as T 8 | 9 | from dateutil.relativedelta import relativedelta 10 | import pytz as tz 11 | 12 | 13 | def fzf(header: str, opts: T.List[str]): 14 | try: 15 | output = subprocess.check_output( 16 | [ 17 | 'fzf', 18 | '--height', '10', 19 | '--layout', 'reverse', 20 | '--header', header, 21 | ], 22 | input='\n'.join(opts), 23 | text=True, 24 | ) 25 | except subprocess.CalledProcessError: 26 | fatal('fzf aborted') 27 | return output.strip() 28 | 29 | 30 | def fatal(msg: str) -> T.NoReturn: 31 | print(msg, file=sys.stderr) 32 | exit(1) 33 | 34 | 35 | argparser = ArgumentParser(description='TimeZoneConverter') 36 | argparser.add_argument('--stz', nargs='?', help='source time zone') 37 | argparser.add_argument('--ttz', nargs='?', help='target time zone') 38 | argparser.add_argument('time', nargs='?', default=None, help='source time') 39 | 40 | args = argparser.parse_args() 41 | if not args.time: 42 | args.time = input('Source time: ') 43 | if not args.stz: 44 | args.stz = fzf('Select source timezone', tz.all_timezones) 45 | print(f'Source timezone: {args.stz}') 46 | if not args.ttz: 47 | args.ttz = fzf('Select target timezone', tz.all_timezones) 48 | print(f'Target timezone: {args.ttz}') 49 | 50 | try: 51 | time = dt.time.fromisoformat(args.time) 52 | except ValueError: 53 | fatal('invalid time') 54 | stz = tz.timezone(args.stz) 55 | ttz = tz.timezone(args.ttz) 56 | 57 | 58 | utc = tz.timezone('UTC') 59 | # Assume source time is today 60 | st = stz.localize(dt.datetime.combine(dt.datetime.now(), time, tzinfo=None)) 61 | tt = st.astimezone(ttz) 62 | print(st.replace(tzinfo=None), tt.replace(tzinfo=None)) 63 | delta = relativedelta(tt.replace(tzinfo=None), st.replace(tzinfo=None)) 64 | print( 65 | 'Target time:', 66 | tt.time().isoformat('minutes'), 67 | delta, 68 | ) 69 | -------------------------------------------------------------------------------- /lib/bin/urldecode: -------------------------------------------------------------------------------- 1 | urlencode -------------------------------------------------------------------------------- /lib/bin/urlencode: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | from pathlib import PurePath 5 | from urllib.parse import unquote as urldecode, quote as urlencode 6 | 7 | command = PurePath(sys.argv[0]).stem 8 | 9 | if command == 'urlencode': 10 | print(urlencode(sys.stdin.read())) 11 | elif command == 'urldecode': 12 | print(urldecode(sys.stdin.read())) 13 | else: 14 | print('unknown command: {!r}'.format(command), file=sys.stderr) 15 | exit(1) 16 | -------------------------------------------------------------------------------- /lib/bin/virsh-send-keys: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import re 4 | import subprocess 5 | import sys 6 | import typing as T 7 | 8 | 9 | def keychord(char: str, mode: str = None) -> T.List[str]: 10 | if re.fullmatch(r'[A-Z]', char): 11 | return ['KEY_LEFTSHIFT', f'KEY_{char}'] 12 | elif re.fullmatch(r'[0-9]', char) and mode == 'func': 13 | if char == '0': 14 | char = '10' 15 | return [f'KEY_F{char}'] 16 | elif re.fullmatch(r'[a-z0-9]', char): 17 | return [f'KEY_{char.upper()}'] 18 | elif char == '\n': 19 | return ['KEY_ENTER'] 20 | elif char == ' ': 21 | return ['KEY_SPACE'] 22 | else: 23 | raise RuntimeError('unknown key: {char}') 24 | 25 | 26 | def virsh_send_key(vm: str, keycodes: T.List[str]) -> None: 27 | print(f'sending {keycodes}') 28 | subprocess.check_call(['sudo', 'virsh', 'send-key', vm, *keycodes]) 29 | 30 | 31 | vm = sys.argv[1] 32 | mode = None 33 | if len(sys.argv) > 2: 34 | mode = sys.argv[2] 35 | assert vm 36 | 37 | string = sys.stdin.read() 38 | for char in string: 39 | chord = keychord(char, mode) 40 | virsh_send_key(vm=vm, keycodes=chord) 41 | -------------------------------------------------------------------------------- /lib/bin/webserver: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec python3 -m http.server "$@" 4 | -------------------------------------------------------------------------------- /lib/bin/wl-screenshot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | dt=$(date '+%Y-%m-%dT%H:%M:%S') 6 | out=$(xdg-user-dir PICTURES)/screenshots 7 | 8 | ss() { 9 | grim "$@" "$out/$dt.png" 10 | } 11 | 12 | mkdir -p "$out" 13 | case "$1" in 14 | full) 15 | ss 16 | ;; 17 | select) 18 | geometry=$(slurp) 19 | ss -g "$geometry" 20 | ;; 21 | *) exit 1 ;; 22 | esac 23 | -------------------------------------------------------------------------------- /lib/config/colordiff/colordiffrc: -------------------------------------------------------------------------------- 1 | banner=no 2 | color_patches=no 3 | plain=off 4 | newtext=darkgreen 5 | oldtext=darkred 6 | diffstuff=darkcyan 7 | cvsstuff=darkblue 8 | -------------------------------------------------------------------------------- /lib/config/containers/containers.conf: -------------------------------------------------------------------------------- 1 | [engine] 2 | cgroup_manager="cgroupfs" 3 | -------------------------------------------------------------------------------- /lib/config/flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = W503,W504,C814 3 | hang-closing = True 4 | max-line-length = 90 5 | -------------------------------------------------------------------------------- /lib/config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | true 7 | false 8 | hintslight 9 | none 10 | lcdnone 11 | 12 | 13 | 14 | 15 | Source Sans Pro 16 | 17 | 18 | Source Sans 4 19 | Source Sans 3 20 | 21 | 22 | 23 | 24 | 25 | Source Serif Pro 26 | 27 | 28 | Source Serif 4 29 | Source Serif 3 30 | 31 | 32 | 33 | 34 | 35 | sans-serif 36 | 37 | 38 | Source Sans Pro 39 | Noto Color Emoji 40 | 41 | 42 | 43 | 44 | 45 | serif 46 | 47 | 48 | Source Serif Pro 49 | Noto Color Emoji 50 | 51 | 52 | 53 | 54 | 55 | monospace 56 | 57 | 58 | PragmataPro Mono Liga 59 | Noto Color Emoji 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /lib/config/git/attributes: -------------------------------------------------------------------------------- 1 | *.bib diff=bibtex 2 | *.c diff=cpp 3 | *.cc diff=cpp 4 | *.cpp diff=cpp 5 | *.cs diff=csharp 6 | *.css diff=css 7 | *.ex diff=elixir 8 | *.exs diff=elixir 9 | *.go diff=golang 10 | *.h diff=cpp 11 | *.hh diff=cpp 12 | *.hpp diff=cpp 13 | *.html diff=html 14 | *.java diff=java 15 | *.latex diff=tex 16 | *.m diff=objc 17 | *.md diff=markdown 18 | *.mm diff=objc 19 | *.php diff=php 20 | *.pl diff=perl 21 | *.py diff=python 22 | *.pyi diff=python 23 | *.rake diff=ruby 24 | *.rb diff=ruby 25 | *.rs diff=rust 26 | *.tex diff=tex 27 | *.xhtml diff=html 28 | -------------------------------------------------------------------------------- /lib/config/git/config: -------------------------------------------------------------------------------- 1 | [submodule] 2 | recurse = true 3 | 4 | [advice] 5 | commitBeforeMerge = false 6 | detachedHead = false 7 | pushNonFastForward = false 8 | resolveConflict = false 9 | statusHints = false 10 | [alias] 11 | amend = commit --amend --no-edit 12 | dc = diff --cached 13 | fixup = commit --fixup 14 | fork-point = merge-base --fork-point 15 | pop = reset --soft HEAD~1 16 | reword = commit --only --amend 17 | rb = rebase 18 | rbc = rebase --continue 19 | rbi = rebase --interactive 20 | rs = restore 21 | root = rev-parse --show-toplevel 22 | st = status 23 | sw = switch 24 | unpulled = !"git fetch && git log HEAD..@{u}" 25 | unpushed = log @{u}..HEAD 26 | [color] 27 | ui = auto 28 | [color "diff-highlight"] 29 | oldHighlight = "reverse" 30 | newHighlight = "reverse" 31 | [core] 32 | autocrlf = input 33 | [fetch] 34 | prune = true 35 | recurseSubmodules = on-demand 36 | [filter "lfs"] 37 | clean = git-lfs clean -- %f 38 | smudge = git-lfs smudge -- %f 39 | process = git-lfs filter-process 40 | required = true 41 | [include] 42 | path = identities 43 | [init] 44 | defaultBranch = main 45 | [interactive] 46 | diffFilter = diffr --colors refine-removed:none:foreground:black:background:red --colors refine-added:none:foreground:black:background:green 47 | [log] 48 | decorate = true 49 | showSignature = true 50 | [pager] 51 | branch = $PAGER --quit-if-one-screen --no-init 52 | diff = diffr --colors refine-removed:none:foreground:black:background:red --colors refine-added:none:foreground:black:background:green | $PAGER 53 | log = diffr --colors refine-removed:none:foreground:black:background:red --colors refine-added:none:foreground:black:background:green | $PAGER 54 | show = diffr --colors refine-removed:none:foreground:black:background:red --colors refine-added:none:foreground:black:background:green | $PAGER 55 | unpulled = false 56 | unpushed = false 57 | [pull] 58 | ff = only 59 | [push] 60 | default = simple 61 | recurseSubmodules = off 62 | [rebase] 63 | autosquash = true 64 | -------------------------------------------------------------------------------- /lib/config/git/ignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.sw[a-z] 3 | .#* 4 | .DS_Store 5 | .Spotlight-V100 6 | .Trashes 7 | .config/languageclient.json 8 | .git 9 | tags 10 | tags-* 11 | -------------------------------------------------------------------------------- /lib/config/gtk-3.0/gtk.css: -------------------------------------------------------------------------------- 1 | tooltip .background { 2 | background-color: black; 3 | } 4 | 5 | tooltip { 6 | border-radius: 0px; 7 | box-shadow: none; 8 | text-shadow: none; 9 | } 10 | 11 | tooltip * { 12 | background-color: transparent; 13 | color: white; 14 | padding: 0px; 15 | margin: 0px; 16 | } 17 | -------------------------------------------------------------------------------- /lib/config/ideavim/ideavimrc: -------------------------------------------------------------------------------- 1 | set surround 2 | 3 | nmap [ O 4 | nmap ] o 5 | map Y y$ 6 | -------------------------------------------------------------------------------- /lib/config/imv/config: -------------------------------------------------------------------------------- 1 | [options] 2 | overlay_font = sans-serif:24 3 | 4 | [binds] 5 | = quit 6 | = exec wl-copy "$imv_current_file" 7 | = prev 8 | = next 9 | -------------------------------------------------------------------------------- /lib/config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # General 2 | linux_display_server Wayland 3 | 4 | # Font 5 | font_family PragmataPro Mono Liga 6 | font_size 15.0 7 | adjust_line_height 1 8 | 9 | # Cursor 10 | cursor_shape block 11 | cursor_blink_interval 0 12 | 13 | # Mouse 14 | mouse_hide_wait 3.0 15 | touch_scroll_multiplier 3.0 16 | wheel_scroll_multiplier 3.0 17 | 18 | # Window 19 | remember_window_size no 20 | initial_window_width 640 21 | initial_window_height 800 22 | window_padding_width 2.0 23 | scrollback_lines 10000 24 | active_border_color blue 25 | 26 | # Tab bar 27 | tab_bar_edge top 28 | tab_bar_style separator 29 | tab_separator " │" 30 | 31 | # Clipboard 32 | clipboard_control read-clipboard read-primary write-clipboard write-primary 33 | 34 | # Layouts 35 | enabled_layouts tall:bias=70,stack 36 | 37 | # Keybindings 38 | open_url_modifiers alt 39 | macos_option_as_alt no 40 | rectangle_select_modifiers cmd+alt 41 | clear_all_shortcuts yes 42 | kitty_mod cmd 43 | map kitty_mod+n new_os_window 44 | map kitty_mod+shift+n new_window_with_cwd 45 | map kitty_mod+o next_layout 46 | map kitty_mod+t new_tab 47 | map kitty_mod+w close_tab 48 | map kitty_mod+shift+w close_window 49 | map kitty_mod+shift+] next_tab 50 | map kitty_mod+shift+[ previous_tab 51 | map ctrl+tab next_tab 52 | map ctrl+shift+tab previous_tab 53 | map kitty_mod+1 goto_tab 1 54 | map kitty_mod+2 goto_tab 2 55 | map kitty_mod+3 goto_tab 3 56 | map kitty_mod+4 goto_tab 4 57 | map kitty_mod+5 goto_tab 5 58 | map kitty_mod+6 goto_tab 6 59 | map kitty_mod+7 goto_tab 7 60 | map kitty_mod+8 goto_tab 8 61 | map kitty_mod+- change_font_size all -2.0 62 | map kitty_mod+= change_font_size all +2.0 63 | map kitty_mod+0 change_font_size all 0 64 | map kitty_mod+u input_unicode_character 65 | map kitty_mod+~ kitty_shell window 66 | map kitty_mod+c copy_to_clipboard 67 | map kitty_mod+v paste_from_clipboard 68 | map kitty_mod+shift+h show_scrollback 69 | -------------------------------------------------------------------------------- /lib/config/mako/config: -------------------------------------------------------------------------------- 1 | background-color=#414141 2 | border-color=#000000 3 | default-timeout=4000 4 | font=sans-serif 18 5 | height=150 6 | width=450 7 | padding=7,14 8 | text-color=#e5e5e5 9 | -------------------------------------------------------------------------------- /lib/config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | autofit-larger=100%x100% 2 | autofit-smaller=480x480 3 | keep-open=yes 4 | -------------------------------------------------------------------------------- /lib/config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | func s:fallback(value, fallback) 2 | if empty(a:value) 3 | return a:fallback 4 | else 5 | return a:value 6 | endif 7 | endfunc 8 | 9 | func s:xdg_config() 10 | return s:fallback($XDG_CONFIG_HOME, $HOME . "/.config") 11 | endfunc 12 | 13 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/init.vim") 14 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/settings.vim") 15 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/mappings.vim") 16 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/filetypes.vim") 17 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/packages.vim") 18 | execute 'source' . fnameescape(s:xdg_config() . "/dotfiles/vim/config/plugins.vim") 19 | -------------------------------------------------------------------------------- /lib/config/pry/pryrc: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | 3 | xdg_config_home = Pathname.new(ENV.fetch( 4 | 'XDG_CONFIG_HOME', 5 | Pathname.new(Dir.home).join('.config'), 6 | )) 7 | require xdg_config_home.join('dotfiles', 'ruby', 'pry.rb') 8 | -------------------------------------------------------------------------------- /lib/config/ripgrep/config: -------------------------------------------------------------------------------- 1 | --smart-case 2 | -------------------------------------------------------------------------------- /lib/config/rubocop/config.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | DisplayCopNames: true 3 | Layout/EmptyLineBetweenDefs: 4 | AllowAdjacentOneLineDefs: true 5 | Layout/FirstArrayElementLineBreak: 6 | Enabled: true 7 | Layout/FirstHashElementLineBreak: 8 | Enabled: true 9 | Layout/FirstMethodArgumentLineBreak: 10 | Enabled: false 11 | Layout/FirstMethodParameterLineBreak: 12 | Enabled: true 13 | Layout/IndentFirstArgument: 14 | EnforcedStyle: consistent 15 | Layout/IndentFirstArrayElement: 16 | EnforcedStyle: consistent 17 | Layout/IndentFirstHashElement: 18 | EnforcedStyle: consistent 19 | Layout/MultilineAssignmentLayout: 20 | Enabled: true 21 | EnforcedStyle: same_line 22 | Layout/MultilineMethodCallIndentation: 23 | EnforcedStyle: indented 24 | Layout/SpaceInsideHashLiteralBraces: 25 | EnforcedStyle: no_space 26 | Layout/EndAlignment: 27 | EnforcedStyleAlignWith: variable 28 | Lint/Loop: 29 | Enabled: false 30 | Lint/UnneededSplatExpansion: 31 | Enabled: false 32 | Metrics/AbcSize: 33 | Enabled: false 34 | Metrics/BlockLength: 35 | Enabled: false 36 | Metrics/ClassLength: 37 | Enabled: false 38 | Metrics/CyclomaticComplexity: 39 | Enabled: false 40 | Metrics/LineLength: 41 | Enabled: false 42 | Metrics/MethodLength: 43 | Enabled: false 44 | Metrics/ModuleLength: 45 | Enabled: false 46 | Metrics/PerceivedComplexity: 47 | Enabled: false 48 | Metrics/ParameterLists: 49 | CountKeywordArgs: false 50 | Naming/AccessorMethodName: 51 | Enabled: false 52 | Style/AndOr: 53 | EnforcedStyle: conditionals 54 | Style/AsciiComments: 55 | Enabled: false 56 | Style/AutoResourceCleanup: 57 | Enabled: true 58 | Style/BracesAroundHashParameters: 59 | Enabled: false 60 | Style/ClassAndModuleChildren: 61 | Enabled: false 62 | Style/CollectionMethods: 63 | Enabled: true 64 | PreferredMethods: 65 | collect: 'map' 66 | collect!: 'map!' 67 | find: 'detect' 68 | find_all: 'select' 69 | inject: 'reduce' 70 | Style/Documentation: 71 | Enabled: false 72 | Style/DocumentationMethod: 73 | Enabled: false 74 | Style/DoubleNegation: 75 | Enabled: false 76 | Style/FormatStringToken: 77 | Enabled: false 78 | Style/GuardClause: 79 | Enabled: false 80 | Style/IfUnlessModifier: 81 | Enabled: false 82 | Style/Lambda: 83 | EnforcedStyle: literal 84 | Style/MultilineBlockChain: 85 | Enabled: false 86 | Style/NumericLiterals: 87 | Strict: true 88 | Style/OptionHash: 89 | Enabled: true 90 | Style/PercentLiteralDelimiters: 91 | PreferredDelimiters: 92 | default: () 93 | '%i': '[]' 94 | '%I': '[]' 95 | '%r': '()' 96 | '%w': '[]' 97 | '%W': '[]' 98 | '%x': '()' 99 | Style/Send: 100 | Enabled: true 101 | Style/StringMethods: 102 | Enabled: true 103 | Style/TernaryParentheses: 104 | EnforcedStyle: require_parentheses_when_complex 105 | Style/TrailingCommaInArguments: 106 | EnforcedStyleForMultiline: comma 107 | Style/TrailingCommaInArrayLiteral: 108 | EnforcedStyleForMultiline: comma 109 | Style/TrailingCommaInHashLiteral: 110 | EnforcedStyleForMultiline: comma 111 | Style/VariableInterpolation: 112 | Enabled: false 113 | -------------------------------------------------------------------------------- /lib/config/sway/config: -------------------------------------------------------------------------------- 1 | set $mod Mod4 2 | set $left h 3 | set $down j 4 | set $up k 5 | set $right l 6 | 7 | # systemd 8 | exec systemctl --user import-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY 9 | exec dbus-update-activation-environment --systemd DISPLAY SWAYSOCK WAYLAND_DISPLAY 10 | 11 | # External daemons 12 | exec /usr/libexec/xfce-polkit 13 | exec mako 14 | exec swayidle -w \ 15 | timeout 305 'swaylock --daemonize --color 000000' \ 16 | timeout 300 'swaymsg "output * dpms off"' \ 17 | resume 'swaymsg "output * dpms on"' \ 18 | before-sleep 'swaylock --daemonize --color 000000' 19 | set $WOBSOCK "$XDG_RUNTIME_DIR/wob.sock" 20 | exec 'mkfifo $WOBSOCK && tail -f "$WOBSOCK" | wob' 21 | 22 | # Custom window config 23 | for_window [app_id="firefox" title="^Firefox - Choose User Profile$"] \ 24 | floating enable 25 | for_window [app_id="firefox" title="^Firefox - Sharing Indicator$"] \ 26 | floating enable, sticky enable 27 | for_window [app_id="firefox" title="^Picture-in-Picture$"] \ 28 | floating enable, sticky enable 29 | for_window [app_id="firefox" title="^Launch Application$"] \ 30 | floating enable, sticky enable 31 | for_window [app_id="pavucontrol"] \ 32 | floating enable 33 | for_window [app_id="qalculate-gtk"] \ 34 | floating enable 35 | for_window [app_id="xfce-polkit"] \ 36 | floating enable, sticky enable 37 | 38 | # Input/output 39 | input * dwt enabled 40 | input * accel_profile flat 41 | input * pointer_accel 1 42 | input * repeat_delay 250 43 | input * scroll_method on_button_down 44 | input * xkb_options ctrl:nocaps,compose:rwin 45 | seat * xcursor_theme default 36 46 | output * disable 47 | output * max_render_time 8 48 | output * background #656565 solid_color 49 | output * enable scale 1 scale_filter linear 50 | 51 | # UI 52 | font pango:Source Sans Pro 18 53 | # border bg text indctr child_border 54 | client.focused #000000 #414141 #e5e5e5 #414141 #000000 55 | client.focused_inactive #000000 #303030 #b0b0b0 #000000 #000000 56 | client.unfocused #000000 #222222 #696969 #000000 #000000 57 | default_border normal 2 58 | default_floating_border normal 2 59 | 60 | # Bar 61 | bar { 62 | swaybar_command waybar 63 | } 64 | 65 | # Bindings 66 | floating_modifier $mod normal 67 | focus_follows_mouse yes 68 | 69 | bindsym $mod+Return exec kitty --single-instance 70 | bindsym $mod+Shift+q kill 71 | bindsym $mod+Space exec wofi --show=drun 72 | bindsym $mod+Alt+Shift+l exec swaylock --daemonize --color 000000 73 | bindsym $mod+Shift+c reload 74 | bindsym $mod+Shift+Escape exit 75 | 76 | bindsym XF86MonBrightnessDown exec "brightnessctl -e set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK" 77 | bindsym XF86MonBrightnessUp exec "brightnessctl -e set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK" 78 | 79 | bindsym XF86AudioMute exec 'pamixer --toggle-mute && (pamixer --get-mute && echo 0 > "$WOBSOCK") || pamixer --get-volume > "$WOBSOCK"' 80 | bindsym XF86AudioLowerVolume exec 'pamixer --unmute --decrease 1 && pamixer --get-volume > "$WOBSOCK"' 81 | bindsym XF86AudioRaiseVolume exec 'pamixer --unmute --increase 1 && pamixer --get-volume > "$WOBSOCK"' 82 | 83 | bindsym XF86AudioPrev exec "playerctl previous" 84 | bindsym XF86AudioPlay exec "playerctl play-pause" 85 | bindsym XF86AudioNext exec "playerctl next" 86 | 87 | bindsym $mod+Alt+Escape mode minimal 88 | mode minimal bindsym $mod+Alt+Escape mode default 89 | 90 | ## Screenshots 91 | bindsym $mod+Alt+4 exec wl-screenshot select 92 | 93 | ## Moving focus 94 | 95 | ### Within workspace 96 | bindsym $mod+$left focus left 97 | bindsym $mod+$down focus down 98 | bindsym $mod+$up focus up 99 | bindsym $mod+$right focus right 100 | bindsym $mod+Left focus left 101 | bindsym $mod+Down focus down 102 | bindsym $mod+Up focus up 103 | bindsym $mod+Right focus right 104 | 105 | ### Between workspaces 106 | bindsym $mod+1 workspace 1 107 | bindsym $mod+2 workspace 2 108 | bindsym $mod+3 workspace 3 109 | bindsym $mod+4 workspace 4 110 | bindsym $mod+5 workspace 5 111 | bindsym $mod+6 workspace 6 112 | bindsym $mod+7 workspace 7 113 | bindsym $mod+8 workspace 8 114 | bindsym $mod+9 workspace 9 115 | bindsym $mod+0 workspace 10 116 | bindsym --border --whole-window $mod+button4 workspace prev 117 | bindsym --border --whole-window $mod+button5 workspace next 118 | 119 | ## Moving container 120 | 121 | ### Within workspace 122 | bindsym $mod+Shift+$left move left 123 | bindsym $mod+Shift+$down move down 124 | bindsym $mod+Shift+$up move up 125 | bindsym $mod+Shift+$right move right 126 | bindsym $mod+Shift+Left move left 127 | bindsym $mod+Shift+Down move down 128 | bindsym $mod+Shift+Up move up 129 | bindsym $mod+Shift+Right move right 130 | 131 | ### Between workspaces 132 | bindsym $mod+Shift+1 move container to workspace 1 133 | bindsym $mod+Shift+2 move container to workspace 2 134 | bindsym $mod+Shift+3 move container to workspace 3 135 | bindsym $mod+Shift+4 move container to workspace 4 136 | bindsym $mod+Shift+5 move container to workspace 5 137 | bindsym $mod+Shift+6 move container to workspace 6 138 | bindsym $mod+Shift+7 move container to workspace 7 139 | bindsym $mod+Shift+8 move container to workspace 8 140 | bindsym $mod+Shift+9 move container to workspace 9 141 | bindsym $mod+Shift+0 move container to workspace 10 142 | 143 | # Modifying container 144 | bindsym $mod+b splith 145 | bindsym $mod+v splitv 146 | bindsym $mod+s layout stacking 147 | bindsym $mod+w layout tabbed 148 | bindsym $mod+e layout toggle split 149 | 150 | # Make the current focus fullscreen 151 | bindsym $mod+f fullscreen 152 | 153 | # Toggle the current focus between tiling and floating mode 154 | bindsym $mod+Shift+space floating toggle 155 | 156 | # Toggle sticky 157 | bindsym $mod+Shift+Alt+space sticky toggle 158 | 159 | # Swap focus between the tiling area and the floating area 160 | #bindsym $mod+space focus mode_toggle 161 | 162 | # move focus to the parent container 163 | bindsym $mod+a focus parent 164 | # 165 | # Scratchpad: 166 | # 167 | # Sway has a "scratchpad", which is a bag of holding for windows. 168 | # You can send windows there and get them back later. 169 | 170 | # Move the currently focused window to the scratchpad 171 | bindsym $mod+Shift+minus move scratchpad 172 | 173 | # Show the next scratchpad window or hide the focused scratchpad window. 174 | # If there are multiple scratchpad windows, this command cycles through them. 175 | bindsym $mod+minus scratchpad show 176 | # 177 | # Resizing containers: 178 | # 179 | mode "resize" { 180 | # left will shrink the containers width 181 | # right will grow the containers width 182 | # up will shrink the containers height 183 | # down will grow the containers height 184 | bindsym $left resize shrink width 10px 185 | bindsym $down resize grow height 10px 186 | bindsym $up resize shrink height 10px 187 | bindsym $right resize grow width 10px 188 | 189 | # ditto, with arrow keys 190 | bindsym Left resize shrink width 10px 191 | bindsym Down resize grow height 10px 192 | bindsym Up resize shrink height 10px 193 | bindsym Right resize grow width 10px 194 | 195 | # return to default mode 196 | bindsym Return mode "default" 197 | bindsym Escape mode "default" 198 | } 199 | bindsym $mod+r mode "resize" 200 | 201 | include /etc/sway/config.d/* 202 | -------------------------------------------------------------------------------- /lib/config/tig/config: -------------------------------------------------------------------------------- 1 | set horizontal-scroll = 33% 2 | set line-graphics = utf-8 3 | set mouse = true 4 | set truncation-delimiter = … 5 | set tab-size = 2 6 | 7 | set main-view = date:relative id:yes author:full,width=16 commit-title:yes,graph=yes,refs=yes 8 | set diff-highlight = diff-highlight 9 | 10 | bind main :set main-view-date-display = default 11 | 12 | color author cyan default 13 | color date green default 14 | color cursor black green 15 | color main-head red default underline 16 | color main-ref red default 17 | color main-remote red default 18 | color main-tag yellow default 19 | color main-local-tag yellow default 20 | color title-blur black blue 21 | color title-focus black blue 22 | -------------------------------------------------------------------------------- /lib/config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | if-shell '[ "$TERM" = "xterm-kitty" ]' { 2 | set -g default-terminal "xterm-kitty" 3 | } { 4 | set -g default-terminal "tmux-256color" 5 | } 6 | if-shell '[ "$COLORTERM" = "truecolor" ]' { 7 | set -ga terminal-overrides ',xterm-256color:Tc' 8 | } 9 | set -ga terminal-overrides ',xterm-kitty:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' 10 | set -ga terminal-overrides ',xterm-kitty:Smulx=\E[4::%p1%dm' 11 | 12 | set -g prefix C-t 13 | unbind C-b 14 | bind C-t send-prefix 15 | 16 | set -sg escape-time 50 17 | 18 | set -g mouse on 19 | bind -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" 20 | bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" 21 | bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" 22 | bind -T copy-mode PPage send -X page-up 23 | bind -T copy-mode NPage send -X page-down 24 | 25 | set -g base-index 1 26 | set -g focus-events on 27 | set -g history-limit 10000 28 | set -g pane-base-index 1 29 | set -g renumber-windows on 30 | set -g status-right '' 31 | set -g window-status-current-style bg=red 32 | 33 | bind h select-pane -L 34 | bind j select-pane -D 35 | bind k select-pane -U 36 | bind l select-pane -R 37 | 38 | bind '"' split-window -c "#{pane_current_path}" 39 | bind % split-window -h -c "#{pane_current_path}" 40 | 41 | bind S-Left swap-window -t -1 42 | bind S-Right swap-window -t +1 43 | 44 | bind o resize-pane -Z 45 | -------------------------------------------------------------------------------- /lib/config/waybar/config: -------------------------------------------------------------------------------- 1 | { 2 | "layer": "top", 3 | "position": "top", 4 | "modules-left": ["sway/workspaces", "sway/mode"], 5 | "modules-center": [], 6 | "modules-right": [ 7 | "tray", 8 | "custom/mediaplayer", 9 | "idle_inhibitor", 10 | "network", 11 | "cpu", 12 | "temperature#cpu", 13 | "memory", 14 | "clock#utc", 15 | "clock#local" 16 | ], 17 | "battery": { 18 | "format": "{icon} {capacity}%", 19 | "format-icons": ["", "", "", "", ""] 20 | }, 21 | "clock#utc": { 22 | "timezone": "Etc/UTC", 23 | "tooltip-format": "{:%Y-%m-%d %H:%M:%S %Z}", 24 | "format": "{:%H:%M %Z}", 25 | "interval": 1 26 | }, 27 | "clock#local": { 28 | "tooltip-format": "{:%Y %B}\n{calendar}", 29 | "format": "{:%Y-%m-%d %H:%M:%S %Z}", 30 | "interval": 1 31 | }, 32 | "cpu": { 33 | "format": "CPU {usage:>3}%", 34 | "interval": 2 35 | }, 36 | "custom/mediaplayer": { 37 | "format": "{}", 38 | "return-type": "json", 39 | "max-length": 40, 40 | "exec": "$HOME/.config/waybar/mediaplayer 2> /dev/null" 41 | }, 42 | "idle_inhibitor": { 43 | "format": "{icon}", 44 | "format-icons": { 45 | "activated": "", 46 | "deactivated": "" 47 | } 48 | }, 49 | "memory": { 50 | "format": "MEM {:>3}%", 51 | "interval": 2 52 | }, 53 | "network": { 54 | "format-wifi": " {essid} ({signalStrength}%)", 55 | "format-ethernet": "{ifname} ↓{bandwidthDownBits:>10} ↑{bandwidthUpBits:>10}", 56 | "format-linked": " {ifname} (No IP)", 57 | "format-disconnected": "⚠ Disconnected", 58 | "format-alt": "{ifname}: {ipaddr}/{cidr}", 59 | "interval": 2 60 | }, 61 | "pulseaudio": { 62 | "format": "{icon} {volume}%", 63 | "format-bluetooth": "{icon} {volume}%", 64 | "format-muted": "", 65 | "format-icons": { 66 | "headphone": "", 67 | "hands-free": "", 68 | "headset": "", 69 | "phone": "", 70 | "portable": "", 71 | "car": "", 72 | "default": ["", ""] 73 | }, 74 | "scroll-step": 1, 75 | "on-click": "pavucontrol" 76 | }, 77 | "sway/mode": { 78 | "format": "{}" 79 | }, 80 | "temperature#cpu": { 81 | "interval": 5, 82 | "hwmon-path": "/sys/class/hwmon/hwmon4/temp1_input", 83 | "critical-threshold": 80, 84 | "format": "{temperatureC}°C" 85 | }, 86 | "tray": { 87 | "spacing": 10 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/config/waybar/mediaplayer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import json 5 | import logging 6 | import signal 7 | import sys 8 | 9 | import gi 10 | 11 | gi.require_version('Playerctl', '2.0') 12 | from gi.repository import Playerctl, GLib 13 | 14 | logger = logging.getLogger(__name__) 15 | 16 | 17 | def write_output(text, player): 18 | logger.info('Writing output') 19 | 20 | output = {'text': text, 21 | 'class': 'custom-' + player.props.player_name, 22 | 'alt': player.props.player_name} 23 | 24 | sys.stdout.write(json.dumps(output) + '\n') 25 | sys.stdout.flush() 26 | 27 | 28 | def on_play(player, status, manager): 29 | logger.info('Received new playback status') 30 | on_metadata(player, player.props.metadata, manager) 31 | 32 | 33 | def on_metadata(player, metadata, manager): 34 | logger.info('Received new metadata') 35 | track_info = '' 36 | 37 | if player.props.player_name == 'spotify' and \ 38 | 'mpris:trackid' in metadata.keys() and \ 39 | ':ad:' in player.props.metadata['mpris:trackid']: 40 | track_info = 'AD PLAYING' 41 | elif player.get_artist() != '' and player.get_title() != '': 42 | track_info = '{artist} - {title}'.format(artist=player.get_artist(), 43 | title=player.get_title()) 44 | else: 45 | track_info = player.get_title() 46 | 47 | icon = '' 48 | if track_info: 49 | if player.props.status == 'Playing': 50 | icon = ' ' 51 | else: 52 | icon = ' ' 53 | write_output(icon + track_info, player) 54 | 55 | 56 | def on_player_appeared(manager, player, selected_player=None): 57 | if player is not None and (selected_player is None or player.name == selected_player): 58 | init_player(manager, player) 59 | else: 60 | logger.debug("New player appeared, but it's not the selected player, skipping") 61 | 62 | 63 | def on_player_vanished(manager, player): 64 | logger.info('Player has vanished') 65 | sys.stdout.write('\n') 66 | sys.stdout.flush() 67 | 68 | 69 | def init_player(manager, name): 70 | logger.debug('Initialize player: {player}'.format(player=name.name)) 71 | player = Playerctl.Player.new_from_name(name) 72 | player.connect('playback-status', on_play, manager) 73 | player.connect('metadata', on_metadata, manager) 74 | manager.manage_player(player) 75 | on_metadata(player, player.props.metadata, manager) 76 | 77 | 78 | def signal_handler(sig, frame): 79 | logger.debug('Received signal to stop, exiting') 80 | sys.stdout.write('\n') 81 | sys.stdout.flush() 82 | # loop.quit() 83 | sys.exit(0) 84 | 85 | 86 | def parse_arguments(): 87 | parser = argparse.ArgumentParser() 88 | 89 | # Increase verbosity with every occurence of -v 90 | parser.add_argument('-v', '--verbose', action='count', default=0) 91 | 92 | # Define for which player we're listening 93 | parser.add_argument('--player') 94 | 95 | return parser.parse_args() 96 | 97 | 98 | def main(): 99 | arguments = parse_arguments() 100 | 101 | # Initialize logging 102 | logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, 103 | format='%(name)s %(levelname)s %(message)s') 104 | 105 | # Logging is set by default to WARN and higher. 106 | # With every occurrence of -v it's lowered by one 107 | logger.setLevel(max((3 - arguments.verbose) * 10, 0)) 108 | 109 | # Log the sent command line arguments 110 | logger.debug('Arguments received {}'.format(vars(arguments))) 111 | 112 | manager = Playerctl.PlayerManager() 113 | loop = GLib.MainLoop() 114 | 115 | manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) 116 | manager.connect('player-vanished', on_player_vanished) 117 | 118 | signal.signal(signal.SIGINT, signal_handler) 119 | signal.signal(signal.SIGTERM, signal_handler) 120 | 121 | for player in manager.props.player_names: 122 | if arguments.player is not None and arguments.player != player.name: 123 | logger.debug('{player} is not the filtered player, skipping it' 124 | .format(player=player.name) 125 | ) 126 | continue 127 | 128 | init_player(manager, player) 129 | 130 | loop.run() 131 | 132 | 133 | if __name__ == '__main__': 134 | main() 135 | -------------------------------------------------------------------------------- /lib/config/waybar/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | border: none; 3 | border-radius: 0; 4 | font-family: sans-serif; 5 | font-size: 24px; 6 | min-height: 40px; 7 | transition: none; 8 | } 9 | 10 | @keyframes blink { 11 | to { 12 | background-color: #ffffff; 13 | color: #000000; 14 | } 15 | } 16 | 17 | window#waybar { 18 | background-color: rgb(34,34,34); 19 | color: rgb(229,229,229); 20 | } 21 | 22 | window#waybar.hidden { 23 | opacity: 0.2; 24 | } 25 | 26 | box:nth-child(3) > widget > label { 27 | margin-right: 15px; 28 | padding-top: 2px; 29 | padding-bottom: 5px; 30 | } 31 | box:nth-child(3) > widget + widget > label { 32 | border-left: 3px solid rgb(0,0,0); 33 | padding-left: 15px; 34 | } 35 | box:nth-child(3) > widget + widget > #temperature.cpu { 36 | border-left: none; 37 | } 38 | 39 | #workspaces button { 40 | padding: 0 10px; 41 | background-color: transparent; 42 | color: rgb(229,229,229); 43 | border-bottom: 5px solid transparent; 44 | } 45 | /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ 46 | #workspaces button:hover { 47 | background: rgb(50,50,50); 48 | box-shadow: inherit; 49 | border-bottom: 5px solid rgb(115,115,115); 50 | text-shadow: none; 51 | } 52 | #workspaces button.focused { 53 | background-color: rgb(80,80,80); 54 | border-bottom: 5px solid rgb(229,229,229); 55 | } 56 | #workspaces button.urgent { 57 | background-color: #eb4d4b; 58 | } 59 | 60 | #mode { 61 | background-color: #727272; 62 | border-bottom: 5px solid #ffffff; 63 | } 64 | #idle_inhibitor.deactivated, 65 | #pulseaudio.muted { 66 | color: rgb(100,100,100); 67 | } 68 | #temperature.critical { 69 | color: rgb(255,180,20); 70 | } 71 | -------------------------------------------------------------------------------- /lib/config/wofi/config: -------------------------------------------------------------------------------- 1 | allow_images=true 2 | insensitive=true 3 | key_expand=Tab 4 | no_actions=false 5 | height=600 6 | width=750 7 | -------------------------------------------------------------------------------- /lib/config/wofi/style.css: -------------------------------------------------------------------------------- 1 | window, #input { 2 | background-color: rgb(34,34,34); 3 | color: rgb(229,229,229); 4 | font-size: 24px; 5 | } 6 | 7 | #entry:selected { 8 | background-color: rgb(65,65,65); 9 | } 10 | 11 | #entry image { 12 | margin-right: 15px; 13 | } 14 | 15 | #input, #entry { 16 | padding: 7px 15px; 17 | } 18 | -------------------------------------------------------------------------------- /lib/firefox/user.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-magic-numbers,no-undef,semi */ 2 | 3 | user_pref('accessibility.force_disabled', 1); 4 | user_pref('app.shield.optoutstudies.enabled', false); 5 | user_pref('browser.cache.cache_isolation', true); 6 | user_pref('browser.discovery.enabled', false); 7 | user_pref('browser.fixup.alternate.enabled', false); 8 | user_pref('browser.formfill.enable', false); 9 | user_pref('browser.link.open_newwindow', 1); 10 | user_pref('browser.newtabpage.activity-stream.showSponsored', false); 11 | user_pref('browser.newtabpage.activity-stream.showSponsoredTopSites', false); 12 | user_pref('browser.newtabpage.enabled', false); 13 | user_pref('browser.safebrowsing.downloads.remote.enabled', false); 14 | user_pref('browser.startup.homepage', 'about:blank'); 15 | user_pref('browser.tabs.loadInBackground', false); 16 | user_pref('browser.urlbar.doubleClickSelectsAll', false); 17 | user_pref('browser.urlbar.openViewOnFocus', false); 18 | user_pref('browser.urlbar.speculativeConnect.enabled', false); 19 | user_pref('browser.urlbar.suggest.quicksuggest', false); 20 | user_pref('devtools.debugger.remote-enabled', false); 21 | user_pref('devtools.inspector.activeSidebar', 'ruleview'); 22 | user_pref('devtools.inspector.color-scheme-simulation.enabled', true); 23 | user_pref('devtools.inspector.showUserAgentStyles', true); 24 | user_pref('devtools.inspector.three-pane-enabled', false); 25 | user_pref('devtools.inspector.three-pane-first-run', false); 26 | user_pref('dom.gamepad.enabled', false); 27 | user_pref('dom.security.https_only_mode', true); 28 | user_pref('dom.security.https_only_mode_ever_enabled', true); 29 | user_pref('dom.targetBlankNoOpener.enabled', true); 30 | user_pref('extensions.activeThemeID', 'firefox-compact-light@mozilla.org'); 31 | user_pref('extensions.fxmonitor.enabled', false); 32 | user_pref('extensions.htmlaboutaddons.recommendations.enabled', false); 33 | user_pref('extensions.pocket.enabled', false); 34 | user_pref('fission.autostart', true); 35 | user_pref('font.default.x-western', 'sans-serif'); 36 | user_pref('font.name.monospace.x-western', 'PragmataPro Mono Liga'); 37 | user_pref('font.name.sans-serif.el', 'Source Sans Pro'); 38 | user_pref('font.name.sans-serif.ja', 'Source Han Sans'); 39 | user_pref('font.name.sans-serif.ko', 'Source Han Sans K'); 40 | user_pref('font.name.sans-serif.x-cyrillic', 'Source Sans Pro'); 41 | user_pref('font.name.sans-serif.x-unicode', 'Source Sans Pro'); 42 | user_pref('font.name.sans-serif.x-western', 'Source Sans Pro'); 43 | user_pref('font.name.sans-serif.zh-CN', 'Source Han Sans SC'); 44 | user_pref('font.name.sans-serif.zh-HK', 'Source Han Sans HC'); 45 | user_pref('font.name.sans-serif.zh-TW', 'Source Han Sans TC'); 46 | user_pref('font.name.sans.x-western', 'Source Sans Pro'); 47 | user_pref('font.name.serif.el', 'Source Serif Pro'); 48 | user_pref('font.name.serif.ja', 'Source Han Serif'); 49 | user_pref('font.name.serif.ko', 'Source Han Serif K'); 50 | user_pref('font.name.serif.x-cyrillic', 'Source Serif Pro'); 51 | user_pref('font.name.serif.x-unicode', 'Source Sans Pro'); 52 | user_pref('font.name.serif.x-western', 'Source Serif Pro'); 53 | user_pref('font.name.serif.zh-CN', 'Source Han Serif SC'); 54 | user_pref('font.name.serif.zh-HK', 'Source Han Serif TC'); 55 | user_pref('font.name.serif.zh-TW', 'Source Han Serif TC'); 56 | user_pref('font.size.monospace.x-western', '16'); 57 | user_pref('gfx.color_management.enablev4', true); 58 | user_pref('gfx.color_management.mode', 1); 59 | user_pref('media.autoplay.default', 5); 60 | user_pref('media.peerconnection.ice.default_address_only', true); 61 | user_pref('media.peerconnection.ice.no_host', true); 62 | user_pref('middlemouse.paste', false); 63 | user_pref('network.IDN_show_punycode', true); 64 | user_pref('network.cookie.cookieBehavior', 1); 65 | user_pref('network.cookie.thirdparty.sessionOnly', true); 66 | user_pref('network.dns.disablePrefetch', true); 67 | user_pref('network.http.referer.XOriginPolicy', 1); 68 | user_pref('network.http.referer.XOriginTrimmingPolicy', 2); 69 | user_pref('network.http.speculative-parallel-limit', 0); 70 | user_pref('network.manage-offline-status', false); 71 | user_pref('network.predictor.enabled', false); 72 | user_pref('network.prefetch-next', false); 73 | user_pref('network.proxy.socks_remote_dns', true); 74 | user_pref('network.trr.mode', 5); 75 | user_pref('permissions.default.desktop-notification', 2); 76 | user_pref('permissions.default.geo', 2); 77 | user_pref('plugin.state.flash', 0); 78 | user_pref('privacy.clearOnShutdown.offlineApps', true); 79 | user_pref('privacy.clearOnShutdown.siteSettings', true); 80 | user_pref('privacy.firstparty.isolate', true); 81 | user_pref('privacy.firstparty.isolate.restrict_opener_access', true); 82 | user_pref('privacy.trackingprotection.cryptomining.enabled', true); 83 | user_pref('privacy.trackingprotection.enabled', false); // Disable only if using uBlock Origin or similar 84 | user_pref('privacy.trackingprotection.fingerprinting.enabled', true); 85 | user_pref('privacy.trackingprotection.pbmode.enabled', false); // Disable only if using uBlock Origin or similar 86 | user_pref('reader.content_width', 4); 87 | user_pref('reader.font_size', 5); 88 | user_pref('reader.font_type', 'sans-serif'); 89 | user_pref('reader.line_height', 3); 90 | user_pref('security.mixed_content.block_display_content', true); 91 | user_pref('security.mixed_content.block_object_subrequest', true); 92 | user_pref('security.mixed_content.upgrade_display_content', true); 93 | user_pref('security.OCSP.enabled', 0); 94 | user_pref('signon.rememberSignons', false); 95 | user_pref('toolkit.legacyUserProfileCustomizations.stylesheets', true); 96 | user_pref('toolkit.telemetry.archive.enabled', false); 97 | user_pref('toolkit.telemetry.enabled', false); 98 | user_pref('toolkit.telemetry.unified', false); 99 | -------------------------------------------------------------------------------- /lib/firefox/userChrome.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --jam-macos-textbox-bg-active: rgb(255, 255, 255); 3 | --jam-macos-textbox-bg-inactive: rgb(255, 255, 255); 4 | --jam-macos-textbox-fg-active: rgb(76, 76, 76); 5 | --jam-macos-textbox-fg-inactive: rgb(76, 76, 76); 6 | --jam-macos-textbox-fg-placeholder-active: rgb(193, 193, 193); 7 | --jam-macos-textbox-fg-placeholder-inactive: rgb(193, 193, 193); 8 | --jam-macos-textbox-border-inactive: rgb(214, 214, 214); 9 | --jam-macos-titlebar-bg-active-bottom: rgb(208, 208, 208); 10 | --jam-macos-titlebar-bg-active-top: rgb(228, 228, 228); 11 | --jam-macos-titlebar-bg-inactive: rgb(246, 246, 246); 12 | --jam-macos-titlebar-button-active: rgb(147, 147, 147); 13 | --jam-macos-titlebar-button-inactive: rgb(221, 221, 221); 14 | --jam-macos-titlebar-fg-active: rgb(76, 76, 76); 15 | --jam-macos-titlebar-fg-inactive: rgb(175, 175, 175); 16 | 17 | --grey-20: #ededed !important; 18 | --grey-30: #d7d7d7 !important; 19 | --grey-40: #b1b1b1 !important; 20 | --grey-60: #4a4a4a !important; 21 | --grey-90: #0c0c0c !important; 22 | --grey-90-a10: rgba(12, 12, 12, 0.1) !important; 23 | --grey-90-a20: rgba(12, 12, 12, 0.2) !important; 24 | --grey-90-a30: rgba(12, 12, 12, 0.3) !important; 25 | --grey-90-a50: rgba(12, 12, 12, 0.5) !important; 26 | --grey-90-a60: rgba(12, 12, 12, 0.6) !important; 27 | } 28 | 29 | :root { 30 | --arrowpanel-border-color: rgb(240, 240, 240) !important; 31 | --arrowpanel-color: rgba(21, 21, 21, 1) !important; 32 | --arrowpanel-field-background: rgba(249, 249, 249, 0.3) !important; 33 | --autocomplete-popup-color: var(--jam-macos-textbox-fg-active) !important; 34 | --autocomplete-popup-highlight-background: rgb(224, 224, 224) !important; 35 | --autocomplete-popup-highlight-color: rgb(21, 21, 21) !important; 36 | --autocomplete-popup-hover-background: rgb(240, 240, 240) !important; 37 | --autocomplete-popup-separator-color: rgb(240, 240, 240) !important; 38 | --button-active-bgcolor: rgb(207, 207, 207) !important; 39 | --button-bgcolor: rgb(240, 240, 240) !important; 40 | --button-hover-bgcolor: rgb(224, 224, 224) !important; 41 | --buttons-primary-button-color: rgb(251, 251, 251) !important; 42 | --checkbox-border-color: rgb(143, 143, 143) !important; 43 | --checkbox-checked-color: rgb(251, 251, 251) !important; 44 | --checkbox-unchecked-active-bgcolor: rgb(207, 207, 207 !important); 45 | --checkbox-unchecked-bgcolor: rgb(240, 240, 240) !important; 46 | --checkbox-unchecked-hover-bgcolor: rgb(224, 224, 224) !important; 47 | --default-arrowpanel-border-color: hsla(210, 0%, 10%, 0.05) !important; 48 | --input-color: rgb(21, 21, 21) !important; 49 | --lwt-accent-color: rgb(228, 228, 228) !important; 50 | --tab-selected-bgcolor: rgb(245, 245, 245) !important; 51 | --lwt-tab-text: rgb(21, 21, 21) !important; 52 | --lwt-text-color: rgba(25, 25, 25) !important; 53 | --toolbar-field-non-lwt-color: var(--jam-macos-textbox-fg-active) !important; 54 | --toolbar-field-non-lwt-bgcolor: var(--jam-macos-textbox-bg-active) !important; 55 | --lwt-toolbar-field-background-color: var(--jam-macos-textbox-bg-active) !important; 56 | --lwt-toolbar-field-color: var(--jam-macos-textbox-fg-active) !important; 57 | --lwt-toolbar-field-focus-color: var(--jam-macos-textbox-fg-active) !important; 58 | --lwt-toolbarbutton-icon-fill: rgba(25, 25, 25, 0.7) !important; 59 | --panel-description-color: rgba(21, 21, 21, 0.7) !important; 60 | --panel-disabled-color: rgba(21, 21, 21, 0.5) !important; 61 | --panel-separator-color: hsla(210, 0%, 10%, 0.14) !important; 62 | --tab-icon-overlay-fill: rgb(91, 91, 91) !important; 63 | --tabpanel-background-color: #f9f9f9 !important; 64 | --toolbar-bgcolor: rgb(246, 246, 246) !important; 65 | --toolbar-color: rgb(21, 21, 21) !important; 66 | --toolbar-field-border-color: hsla(240, 0%, 5%, 0.25) !important; 67 | --toolbar-non-lwt-bgcolor: #f9f9f9 !important; 68 | --toolbar-non-lwt-textcolor: #0c0c0c !important; 69 | --toolbarbutton-icon-fill: rgb(91, 91, 91) !important; 70 | --urlbar-popup-action-color: rgb(91, 91, 91) !important; 71 | } 72 | 73 | @media (prefers-color-scheme: dark) { 74 | :root { 75 | --jam-macos-textbox-bg-active: rgb(108, 108, 108); 76 | --jam-macos-textbox-bg-inactive: rgb(60, 60, 60); 77 | --jam-macos-textbox-fg-active: rgb(255, 255, 255); 78 | --jam-macos-textbox-fg-inactive: rgb(255, 255, 255); 79 | --jam-macos-textbox-fg-placeholder-active: rgb(145, 145, 145); 80 | --jam-macos-textbox-fg-placeholder-inactive: rgb(85, 85, 85); 81 | --jam-macos-titlebar-bg-active-bottom: rgb(54, 54, 54); 82 | --jam-macos-titlebar-bg-active-top: rgb(65, 65, 65); 83 | --jam-macos-titlebar-bg-inactive: rgb(45, 45, 45); 84 | --jam-macos-titlebar-button-active: rgb(162, 162, 162); 85 | --jam-macos-titlebar-button-inactive: rgb(147, 147, 147); 86 | --jam-macos-titlebar-fg-active: rgb(182, 182, 182); 87 | --jam-macos-titlebar-fg-inactive: rgb(110, 110, 110); 88 | } 89 | } 90 | 91 | #main-window { 92 | /* Remove animation when changing window from active <-> inactive */ 93 | transition: none !important; 94 | } 95 | 96 | .titlebar-placeholder[type="pre-tabs"], /* FF <=64 */ 97 | .titlebar-spacer[type="pre-tabs"] { /* FF >=65 */ 98 | /** 99 | * Reduce left padding between traffic-light and tabs, so that left and right 100 | * traffic light padding is equal, and there is more space for tabs. 101 | */ 102 | width: 12px !important; 103 | } 104 | 105 | .tabbrowser-tab:-moz-any([image], [pinned]) > .tab-stack > .tab-content[attention]:not([selected="true"]), 106 | .tabbrowser-tab > .tab-stack > .tab-content[pinned][titlechanged]:not([selected="true"]) { 107 | /* Disable tab indicator */ 108 | background-image: none !important; 109 | } 110 | 111 | /* 112 | * Default background for unloaded content. 113 | * See also userContent.css about:blank. 114 | */ 115 | #tabbrowser-tabs { 116 | --tab-line-color: transparent !important; 117 | } 118 | 119 | #tabbrowser-tabpanels { 120 | @media (prefers-color-scheme: dark) { 121 | background-color: rgb(45, 45, 45); 122 | } 123 | } 124 | 125 | .tab-label { 126 | /* Increase tab title font size */ 127 | font-size: 1.25em !important; 128 | } 129 | 130 | #webrtcIndicator { 131 | display: none; 132 | } 133 | 134 | @media (-moz-proton) { 135 | #TabsToolbar { 136 | appearance: none !important; 137 | color: var(--jam-macos-titlebar-fg-active) !important; 138 | background-color: var(--jam-macos-titlebar-bg-inactive) !important; 139 | background-image: linear-gradient( 140 | var(--jam-macos-titlebar-bg-active-top), 141 | var(--jam-macos-titlebar-bg-active-bottom) 142 | ) !important; 143 | } 144 | 145 | #TabsToolbar:-moz-window-inactive, 146 | #TabsToolbar:-moz-window-inactive .tabbrowser-tab[visuallyselected="true"] { 147 | color: var(--jam-macos-titlebar-fg-inactive) !important; 148 | background-image: none !important; 149 | } 150 | 151 | /** 152 | * Proton tab style tweaks 153 | * Based off https://www.userchrome.org/firefox-89-styling-proton-ui.html 154 | */ 155 | #tabbrowser-tabs { 156 | --user-tab-rounding: 0px; 157 | } 158 | .tab-background { 159 | border-radius: var(--user-tab-rounding) var(--user-tab-rounding) 0px 0px !important; 160 | margin-block: 1px 0 !important; 161 | } 162 | #scrollbutton-up, 163 | #scrollbutton-down { 164 | padding-top: 0 !important; 165 | padding-bottom: 0 !important; 166 | } 167 | .tab-background:not([selected=true]):not([multiselected=true]):not([beforeselected-visible="true"]) { 168 | border-right: 1px solid rgba(0, 0, 0, .20) !important; 169 | } 170 | [brighttext="true"] .tab-background:not([selected=true]):not([multiselected=true]):not([beforeselected-visible="true"]) { 171 | border-right: 1px solid var(--lwt-selected-tab-background-color, rgba(255, 255, 255, .20)) !important; 172 | } 173 | #tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab[first-visible-unpinned-tab] { 174 | margin-inline-start: 1px !important; 175 | } 176 | .tab-background:not([selected=true]):not([multiselected=true]) { 177 | border-radius: 0 !important; 178 | } 179 | .tabbrowser-tab { 180 | padding-left: 0 !important; 181 | padding-right: 0 !important; 182 | } 183 | 184 | /** 185 | * Hamburger menu density 186 | * https://www.userchrome.org/firefox-89-styling-proton-ui.html 187 | */ 188 | menupopup > menuitem, menupopup > menu { 189 | padding-block: 4px !important; 190 | } 191 | :root { 192 | --arrowpanel-menuitem-padding: 4px 8px !important; 193 | } 194 | 195 | #urlbar-background, #searchbar { 196 | border-color: var(--toolbar-field-border-color) !important; 197 | } 198 | } 199 | 200 | @media (not -moz-proton) { 201 | #TabsToolbar { 202 | /* Restore native macOS styling for titlebar */ 203 | -moz-appearance: -moz-window-titlebar !important; 204 | background-color: inherit !important; 205 | color: rgb(47, 47, 47) !important; 206 | } 207 | 208 | #TabsToolbar:-moz-window-inactive, 209 | #TabsToolbar:-moz-window-inactive .tabbrowser-tab[visuallyselected="true"] { 210 | /* Restore native macOS styling for titlebar */ 211 | color: rgb(176, 176, 176) !important; 212 | } 213 | 214 | /*** URL bar enlargement or lack thereof ***/ 215 | :root { 216 | --mbarstyler-popout-pixels: 0px; 217 | } 218 | /* Compute new position, width, and padding */ 219 | #urlbar[breakout][breakout-extend] { 220 | top: calc(5px - var(--mbarstyler-popout-pixels)) !important; 221 | left: calc(0px - var(--mbarstyler-popout-pixels)) !important; 222 | width: calc(100% + (2 * var(--mbarstyler-popout-pixels))) !important; 223 | padding: var(--mbarstyler-popout-pixels) !important; 224 | } 225 | [uidensity="compact"] #urlbar[breakout][breakout-extend] { 226 | top: calc(3px - var(--mbarstyler-popout-pixels)) !important; 227 | } 228 | [uidensity="touch"] #urlbar[breakout][breakout-extend] { 229 | top: calc(4px - var(--mbarstyler-popout-pixels)) !important; 230 | } 231 | /* Prevent shift of URL bar contents */ 232 | #urlbar[breakout][breakout-extend] > #urlbar-input-container { 233 | height: var(--urlbar-height) !important; 234 | padding: 0 !important; 235 | } 236 | /* Do not animate */ 237 | #urlbar[breakout][breakout-extend] > #urlbar-background { 238 | animation: none !important;; 239 | } 240 | /* Remove shadows */ 241 | #urlbar[breakout][breakout-extend] > #urlbar-background { 242 | box-shadow: none !important; 243 | } 244 | #urlbar-results { 245 | overflow-y: auto !important; 246 | } 247 | /* Clean up extra spacing at the top and bottom */ 248 | #urlbar-results { 249 | padding-top: 0 !important; 250 | padding-bottom: 0 !important; 251 | } 252 | } 253 | -------------------------------------------------------------------------------- /lib/firefox/userContent.css: -------------------------------------------------------------------------------- 1 | code, kbd, pre, samp, tt, 2 | code *, kbd *, pre *, samp *, tt * { 3 | font-family: monospace !important; 4 | font-variant-ligatures: normal !important; 5 | } 6 | 7 | .ace_cursor { 8 | animation: none !important; 9 | } 10 | 11 | .ace_editor, .ace_static_highlight { 12 | font-family: monospace !important; 13 | font-size: 15px !important; 14 | font-variant-ligatures: normal !important; 15 | } 16 | 17 | .jsonPanelBox .panelContent .treeTable { 18 | font-family: monospace !important; 19 | font-size: 15px !important; 20 | font-variant-ligatures: normal !important; 21 | } 22 | .jsonPanelBox .panelContent .treeTable .treeIcon { 23 | font-size: 15px !important; 24 | } 25 | 26 | head[prefix~="medium-com:"] + body .metabar { 27 | position: relative !important; 28 | } 29 | 30 | @-moz-document url-prefix("chrome://") { 31 | :root { 32 | /* Change most browser chrome monospace (e.g. dev tools) to user setting */ 33 | --monospace-font-family: monospace !important; 34 | --theme-code-font-size: 14px !important; 35 | 36 | --grey-20: #ededed !important; 37 | --grey-30: #d7d7d7 !important; 38 | --grey-40: #b1b1b1 !important; 39 | --grey-60: #4a4a4a !important; 40 | --grey-90: #0c0c0c !important; 41 | --grey-90-a10: rgba(12, 12, 12, 0.1) !important; 42 | --grey-90-a20: rgba(12, 12, 12, 0.2) !important; 43 | --grey-90-a30: rgba(12, 12, 12, 0.3) !important; 44 | --grey-90-a50: rgba(12, 12, 12, 0.5) !important; 45 | --grey-90-a60: rgba(12, 12, 12, 0.6) !important; 46 | } 47 | 48 | @media (prefers-color-scheme: dark) { 49 | :root { 50 | --in-content-page-background: #2a2a2a !important; 51 | --in-content-page-color: rgb(249, 249, 249) !important; 52 | } 53 | } 54 | } 55 | 56 | @-moz-document url-prefix("about") { 57 | :root { 58 | --grey-20: #ededed !important; 59 | --grey-30: #d7d7d7 !important; 60 | --grey-40: #b1b1b1 !important; 61 | --grey-60: #4a4a4a !important; 62 | --grey-90: #0c0c0c !important; 63 | --grey-90-a10: rgba(12, 12, 12, 0.1) !important; 64 | --grey-90-a20: rgba(12, 12, 12, 0.2) !important; 65 | --grey-90-a30: rgba(12, 12, 12, 0.3) !important; 66 | --grey-90-a50: rgba(12, 12, 12, 0.5) !important; 67 | --grey-90-a60: rgba(12, 12, 12, 0.6) !important; 68 | } 69 | 70 | @media (prefers-color-scheme: dark) { 71 | :root { 72 | --in-content-page-background: #2a2a2a !important; 73 | --in-content-page-color: rgb(249, 249, 249) !important; 74 | } 75 | } 76 | } 77 | 78 | /* 79 | * See also userChrome.css #tabbrowser-tabs. 80 | */ 81 | @-moz-document url-prefix("about:blank") { 82 | @media (prefers-color-scheme: dark) { 83 | html { 84 | background-color: rgb(45, 45, 45); 85 | } 86 | } 87 | } 88 | 89 | @-moz-document url-prefix("about:reader") { 90 | sub, sup { 91 | line-height: 0; 92 | } 93 | 94 | .moz-reader-content a:link { 95 | text-decoration: none !important; 96 | } 97 | 98 | .moz-reader-content a:link:hover, 99 | .moz-reader-content a:link:active { 100 | text-decoration: underline !important; 101 | } 102 | 103 | .dark .moz-reader-content a:link, 104 | .dark .moz-reader-content a:link:hover, 105 | .dark .moz-reader-content a:link:active { 106 | color: #58b1dd !important; 107 | } 108 | 109 | .dark .moz-reader-content a:visited { 110 | color: #db77ef !important; 111 | } 112 | 113 | .moz-reader-content code, 114 | .moz-reader-content pre { 115 | background-color: #eee; 116 | border-radius: 0px !important; 117 | font-size: 0.9em; 118 | } 119 | 120 | .dark .moz-reader-content code, 121 | .dark .moz-reader-content pre { 122 | background-color: #555; 123 | } 124 | 125 | .moz-reader-content pre pre { 126 | margin: 0 !important; 127 | padding: 0 !important; 128 | } 129 | 130 | .moz-reader-content :not(pre) code { 131 | margin: 0 !important; 132 | padding: 0.1em 0.3em !important; 133 | } 134 | 135 | .moz-reader-content p:empty { 136 | display: none; 137 | } 138 | 139 | .moz-reader-content table, 140 | .moz-reader-content th, 141 | .moz-reader-content td { 142 | border-left: none !important; 143 | border-right: none !important; 144 | } 145 | 146 | .moz-reader-content ol, 147 | .moz-reader-content ul { 148 | margin-left: 10px !important; 149 | margin-right: 10px !important; 150 | } 151 | 152 | .sans-serif { 153 | font-family: "Source Sans Pro", sans-serif !important; 154 | } 155 | 156 | .serif { 157 | font-family: "Source Serif Pro", serif !important; 158 | } 159 | } 160 | 161 | @-moz-document domain("docs.looker.com") { 162 | .syntax td, .syntax.new { 163 | font-family: monospace !important; 164 | font-size: inherit !important; 165 | font-variant-ligatures: normal !important; 166 | } 167 | } 168 | 169 | @-moz-document domain("github.com") { 170 | body, .markdown-body { 171 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif !important; 172 | } 173 | 174 | .blob-code-inner, 175 | .blob-num, 176 | .commit-ref, 177 | .commit-tease-sha, 178 | .file-info, 179 | .sha, 180 | .sha-block { 181 | font-family: monospace !important; 182 | font-variant-ligatures: normal !important; 183 | } 184 | 185 | code, pre, tt, 186 | .blob-code-inner, 187 | .blob-num, 188 | .file-info { 189 | font-size: 15px !important; 190 | } 191 | 192 | .comment-body code, 193 | .comment-body kbd, 194 | .comment-body pre, 195 | .comment-body samp { 196 | font-size: inherit !important; 197 | } 198 | } 199 | 200 | @-moz-document domain("gitlab.com") { 201 | .monospace, 202 | .commit-sha, 203 | .gfm-commit, 204 | .gfm-commit_range, 205 | .ref-name, 206 | .git-revision-dropdown .dropdown-content ul li a, 207 | .mr-state-widget .label-branch, 208 | .pipeline-number, 209 | .git-revision-dropdown-toggle, 210 | .commit-sha-group .label-monospace, 211 | .file-editor .file-title, 212 | .file-editor .editor-file-name, 213 | .ci-table .api, 214 | .project-repo-buttons .mobile-git-clone .dropdown-menu-inner-content, 215 | .group-buttons .mobile-git-clone .dropdown-menu-inner-content, 216 | .git-clone-holder .form-control, 217 | .git-clone-holder .search form, 218 | .search .git-clone-holder form { 219 | font-family: monospace !important; 220 | font-variant-ligatures: normal !important; 221 | } 222 | } 223 | 224 | @-moz-document domain("logentries.com") { 225 | .Entry--entry { 226 | font-family: monospace !important; 227 | } 228 | } 229 | 230 | @-moz-document domain("app.slack.com") { 231 | .ql-code-block { 232 | font-family: monospace !important; 233 | font-variant-ligatures: normal !important; 234 | } 235 | } 236 | 237 | @-moz-document domain("wikipedia.org") { 238 | body { 239 | font-family: sans-serif !important; 240 | } 241 | 242 | .mw-body h1, 243 | .mw-body-content h1, 244 | .mw-body-content h2 { 245 | font-family: serif !important; 246 | } 247 | } 248 | 249 | @-moz-document domain("youtube.com") { 250 | .ytp-suggestion-set { 251 | display: none; 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /lib/gnupg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | enable-ssh-support 2 | -------------------------------------------------------------------------------- /lib/gnupg/gpg.conf: -------------------------------------------------------------------------------- 1 | personal-cipher-preferences AES256 AES192 AES 2 | personal-digest-preferences SHA512 SHA384 SHA256 3 | personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed 4 | default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed 5 | cert-digest-algo SHA512 6 | s2k-digest-algo SHA512 7 | s2k-cipher-algo AES256 8 | charset utf-8 9 | fixed-list-mode 10 | no-comments 11 | no-emit-version 12 | no-greeting 13 | keyid-format 0xlong 14 | list-options show-uid-validity 15 | verify-options show-uid-validity 16 | with-fingerprint 17 | require-cross-certification 18 | no-symkey-cache 19 | use-agent 20 | throw-keyids 21 | -------------------------------------------------------------------------------- /lib/linux/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | gsettings set org.gnome.desktop.interface cursor-blink-timeout 10000000 6 | gsettings set org.gnome.desktop.interface cursor-size 36 7 | gsettings set org.gnome.desktop.interface font-name 'Source Sans Pro 12' 8 | gsettings set org.gnome.desktop.interface monospace-font-name 'Pragmata Pro Mono 12' 9 | gsettings set org.gnome.desktop.interface overlay-scrolling false 10 | 11 | gsettings set org.gnome.desktop.privacy remember-recent-files false 12 | -------------------------------------------------------------------------------- /lib/macos/DefaultKeyBinding.dict: -------------------------------------------------------------------------------- 1 | { 2 | "^b" = "moveWordBackward:"; 3 | "^f" = "moveWordForward:"; 4 | "^w" = "deleteWordBackward:"; 5 | } 6 | -------------------------------------------------------------------------------- /lib/macos/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # System Preferences 4 | 5 | ## General 6 | defaults write NSGlobalDomain AppleActionOnDoubleClick -string None 7 | defaults write NSGlobalDomain AppleAquaColorVariant -int 6 8 | defaults write NSGlobalDomain AppleHighlightColor -string '0.847059 0.847059 0.862745' 9 | defaults write NSGlobalDomain AppleInterfaceStyle -string 'Dark' 10 | defaults write NSGlobalDomain AppleShowScrollBars -string 'Always' 11 | defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false 12 | 13 | ## Dock 14 | defaults write com.apple.dock autohide -bool true 15 | defaults write com.apple.dock expose-animation-duration -float 0.1 16 | defaults write com.apple.dock largesize -int 72 17 | defaults write com.apple.dock magnification -bool true 18 | defaults write com.apple.dock minimize-to-application -bool true 19 | defaults write com.apple.dock show-process-indicators -bool true 20 | defaults write com.apple.dock show-recents -bool false 21 | defaults write com.apple.dock size-immutable -bool true 22 | defaults write com.apple.dock tilesize -int 48 23 | 24 | ## Mission Control 25 | ### Hot Corners 26 | ### 0: no-op 27 | ### 2: Mission Control 28 | ### 3: Show application windows 29 | ### 4: Desktop 30 | ### 5: Start screen saver 31 | ### 6: Disable screen saver 32 | ### 7: Dashboard 33 | ### 10: Put display to sleep 34 | ### 11: Launchpad 35 | ### 12: Notification Center 36 | defaults write com.apple.dashboard enabled-state -int 1 # 1=Disabled, 2=AsSpace, 3=Overlay 37 | defaults write com.apple.dock wvous-bl-corner -int 2 38 | defaults write com.apple.dock wvous-bl-modifier -int 0 39 | defaults write com.apple.dock wvous-br-corner -int 10 40 | defaults write com.apple.dock wvous-br-modifier -int 0 41 | defaults write com.apple.dock wvous-tl-corner -int 7 42 | defaults write com.apple.dock wvous-tl-modifier -int 0 43 | defaults write com.apple.dock wvous-tr-corner -int 4 44 | defaults write com.apple.dock wvous-tr-modifier -int 0 45 | 46 | ## Language & Region 47 | defaults write NSGlobalDomain AppleICUForce24HourTime -bool true 48 | 49 | ## Security & Privacy 50 | defaults write com.apple.screensaver askForPassword -bool true 51 | defaults write com.apple.screensaver askForPasswordDelay -int 5 52 | 53 | ## Keyboard 54 | defaults write NSGlobalDomain AppleKeyboardUIMode -int 2 # Tab accesses all controls 55 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 56 | defaults write NSGlobalDomain InitialKeyRepeat -int 25 57 | defaults write NSGlobalDomain KeyRepeat -int 2 58 | defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true 59 | 60 | ## Trackpad 61 | defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true 62 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true 63 | 64 | ## Touch Bar 65 | defaults write com.apple.touchbar.agent PresentationModeGlobal -string fullControlStrip 66 | # "com.apple.controlstrip" = { 67 | # FullCustomized = ( 68 | # "com.apple.system.group.volume", 69 | # "com.apple.system.group.media", 70 | # "com.apple.system.group.brightness", 71 | # "com.apple.system.mission-control", 72 | # "com.apple.system.launchpad", 73 | # "com.apple.system.group.keyboard-brightness", 74 | # "com.apple.system.siri" 75 | # ); 76 | 77 | ## Date & Time 78 | sudo systemsetup -setnetworktimeserver 'us.pool.ntp.org' 79 | defaults write com.apple.menuextra.clock DateFormat -string 'EEE MMM d H:mm:ss' 80 | 81 | ## Accessibility 82 | defaults write com.apple.universalaccess reduceTransparency -bool true 83 | 84 | # System misc. 85 | defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false 86 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 87 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 88 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 89 | defaults write NSGlobalDomain NSWindowResizeTime -float 0.1 90 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 91 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 92 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 93 | sudo tmutil disablelocal 94 | 95 | # Applications 96 | 97 | ## Activity Monitor 98 | defaults write com.apple.ActivityMonitor UpdatePeriod -int 2 99 | 100 | ## Archive Utility 101 | # shellcheck disable=SC2088 102 | default write com.apple.archiveutility dearchive-move-after -string '~/.Trash' 103 | 104 | ## Disk Utility 105 | defaults write com.apple.DiskUtility advanced-image-options -bool true 106 | defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true 107 | 108 | ## Finder 109 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 110 | /usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:arrangeBy grid' ~/Library/Preferences/com.apple.finder.plist 111 | /usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:iconSize 64' ~/Library/Preferences/com.apple.finder.plist 112 | defaults read ~/Library/Preferences/com.apple.finder.plist # Refresh cache from disk 113 | defaults write com.apple.finder AnimateInfoPanes -bool true 114 | defaults write com.apple.finder FXDefaultSearchScope -string 'SCcf' # Current folder 115 | defaults write com.apple.finder FXInfoPanesExpanded -dict \ 116 | General -bool true \ 117 | OpenWith -bool true \ 118 | Privileges -bool true 119 | defaults write com.apple.finder FXPreferredViewStyle -string 'clmv' # Column view 120 | defaults write com.apple.finder NewWindowTarget -string 'PfHm' # Home directory 121 | defaults write com.apple.finder NewWindowTargetPath -string "file://$HOME/" 122 | defaults write com.apple.finder QLEnableTextSelection -bool true 123 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true 124 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true 125 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true 126 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true 127 | defaults write com.apple.finder ShowStatusBar -bool true 128 | defaults write com.apple.finder SidebarTagsSctionDisclosedState -bool true 129 | chflags nohidden ~/Library 130 | 131 | ## Google Chrome 132 | defaults write com.google.Chrome DisablePrintPreview -bool true 133 | 134 | ## Safari 135 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 136 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 137 | 138 | ## Screen capture 139 | defaults write com.apple.screencapture disable-shadow -bool true 140 | 141 | ## TextEdit 142 | defaults write com.apple.TextEdit HeightInChars -int 40 143 | defaults write com.apple.TextEdit IgnoreHTML -bool true 144 | defaults write com.apple.TextEdit NSFixedPitchFont -string 'Menlo-Regular' 145 | defaults write com.apple.TextEdit NSFixedPitchFontSize -int 14 146 | defaults write com.apple.TextEdit NSFont -string 'HelveticaNeue' 147 | defaults write com.apple.TextEdit NSFontSize -int 14 148 | defaults write com.apple.TextEdit RichText -bool false 149 | defaults write com.apple.TextEdit WidthInChars -int 72 150 | 151 | ## Time Machine 152 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 153 | 154 | # Restart things to take effect 155 | killall Dock 156 | killall Finder 157 | killall SystemUIServer 158 | -------------------------------------------------------------------------------- /lib/root/Renviron: -------------------------------------------------------------------------------- 1 | R_HISTFILE="~/.RHistory" 2 | -------------------------------------------------------------------------------- /lib/root/Rprofile: -------------------------------------------------------------------------------- 1 | .First <- function() { 2 | if(interactive()) { 3 | utils::loadhistory(Sys.getenv("R_HISTFILE")) 4 | utils::chooseCRANmirror(ind = 1) 5 | } 6 | } 7 | .Last <- function() if(interactive()) savehistory(Sys.getenv("R_HISTFILE")) 8 | -------------------------------------------------------------------------------- /lib/root/bash_logout: -------------------------------------------------------------------------------- 1 | zlogout -------------------------------------------------------------------------------- /lib/root/bash_profile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ~/.config/dotfiles/shell/env.zsh 4 | source ~/.config/dotfiles/shell/interactive.zsh 5 | -------------------------------------------------------------------------------- /lib/root/bashrc: -------------------------------------------------------------------------------- 1 | bash_profile -------------------------------------------------------------------------------- /lib/root/colormakerc: -------------------------------------------------------------------------------- 1 | $col_default = $col_norm; 2 | -------------------------------------------------------------------------------- /lib/root/editrc: -------------------------------------------------------------------------------- 1 | bind "^b" ed-prev-word 2 | bind "^f" em-next-word 3 | -------------------------------------------------------------------------------- /lib/root/eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true, 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "ecmaFeatures": { 10 | "experimentalObjectRestSpread": true, 11 | "jsx": true, 12 | "modules": true, 13 | }, 14 | "ecmaVersion": '2017', 15 | "sourceType": "module", 16 | }, 17 | "rules": { 18 | "array-bracket-spacing": [2, "never"], 19 | "arrow-body-style": [2, "as-needed"], 20 | "arrow-parens": [2, "always"], 21 | "arrow-spacing": [2], 22 | "block-spacing": [2, "always"], 23 | "brace-style": [2, "1tbs", {"allowSingleLine": true}], 24 | "comma-dangle": [2, "always-multiline"], 25 | "comma-spacing": [2, {"before": false, "after": true}], 26 | "comma-style": [2, "last"], 27 | "computed-property-spacing": [2, "never"], 28 | "consistent-return": [2], 29 | "consistent-this": [2, "self"], 30 | "constructor-super": [2], 31 | "curly": [2, "multi-line"], 32 | "dot-notation": [2], 33 | "eqeqeq": [2], 34 | "func-names": [2], 35 | "func-style": [2, "declaration", {"allowArrowFunctions": true}], 36 | "generator-star-spacing": [2, "after"], 37 | "indent": [2, 2, {"SwitchCase": 1}], 38 | "jsx-quotes": [2, "prefer-single"], 39 | "key-spacing": [2, {"beforeColon": false, "afterColon": true}], 40 | "keyword-spacing": [2], 41 | "linebreak-style": [2, "unix"], 42 | "new-cap": [2, { "capIsNew": false }], 43 | "new-parens": [2], 44 | "no-alert": [2], 45 | "no-array-constructor": [2], 46 | "no-caller": [2], 47 | "no-class-assign": [2], 48 | "no-confusing-arrow": [2, {"allowParens": true}], 49 | "no-console": [1], 50 | "no-const-assign": [2], 51 | "no-constant-condition": [2], 52 | "no-dupe-class-members": [2], 53 | "no-empty-pattern": [2], 54 | "no-eval": [2], 55 | "no-extend-native": [2], 56 | "no-extra-bind": [2], 57 | "no-extra-semi": [2], 58 | "no-fallthrough": [2], 59 | "no-floating-decimal": [2], 60 | "no-implicit-coercion": [2], 61 | "no-implied-eval": [2], 62 | "no-invalid-this": [2], 63 | "no-labels": [2], 64 | "no-lone-blocks": [2], 65 | "no-lonely-if": [2], 66 | "no-loop-func": [2], 67 | "no-magic-numbers": [2, {"enforceConst": true, "ignore": [0, 1]}], 68 | "no-multi-spaces": [2], 69 | "no-multiple-empty-lines": [2, {"max": 1, "maxBOF": 0, "maxEOF": 0}], 70 | "no-native-reassign": [2], 71 | "no-negated-condition": [2], 72 | "no-nested-ternary": [2], 73 | "no-new": [2], 74 | "no-new-func": [2], 75 | "no-new-object": [2], 76 | "no-new-wrappers": [2], 77 | "no-octal": [2], 78 | "no-octal-escape": [2], 79 | "no-proto": [2], 80 | "no-return-assign": [2], 81 | "no-self-compare": [2], 82 | "no-sequences": [2], 83 | "no-shadow-restricted-names": [2], 84 | "no-spaced-func": [2], 85 | "no-this-before-super": [2], 86 | "no-throw-literal": [2], 87 | "no-trailing-spaces": [2], 88 | "no-unexpected-multiline": [2], 89 | "no-unneeded-ternary": [2], 90 | "no-unused-expressions": [2], 91 | "no-unused-vars": [2, {"argsIgnorePattern": '^_'}], 92 | "no-use-before-define": [2], 93 | "no-useless-call": [2], 94 | "no-useless-concat": [2], 95 | "no-useless-constructor": [2], 96 | "no-var": [2], 97 | "no-void": [2], 98 | "no-with": [2], 99 | "object-curly-spacing": [2, "never"], 100 | "one-var": [2, "never"], 101 | "operator-assignment": [2, "always"], 102 | "operator-linebreak": [2, "after"], 103 | "padded-blocks": [2, "never"], 104 | "prefer-arrow-callback": [2], 105 | "prefer-const": [2], 106 | "prefer-spread": [2], 107 | "prefer-template": [2], 108 | "quote-props": [2, "as-needed", {"keywords": true}], 109 | "quotes": [2, "single", {"avoidEscape": true}], 110 | "radix": [2, "as-needed"], 111 | "react/display-name": [2], 112 | "react/jsx-closing-bracket-location": [2, "tag-aligned"], 113 | "react/jsx-curly-spacing": [2, "never"], 114 | "react/jsx-indent-props": [2, 2], 115 | "react/jsx-no-duplicate-props": [2], 116 | "react/jsx-no-undef": [2], 117 | "react/jsx-uses-react": 1, 118 | "react/jsx-uses-vars": 1, 119 | "react/no-danger": [2], 120 | "react/no-did-mount-set-state": [2], 121 | "react/no-did-update-set-state": [2], 122 | "react/no-direct-mutation-state": [2], 123 | "react/no-unknown-property": [2], 124 | "react/prop-types": [2], 125 | "react/react-in-jsx-scope": [2], 126 | "react/self-closing-comp": [2], 127 | "react/sort-comp": [2], 128 | "react/sort-prop-types": [2], 129 | "require-yield": [2], 130 | "semi": [2, "never"], 131 | "space-before-blocks": [2, "always"], 132 | "space-before-function-paren": [2, {"anonymous": "never", "asyncArrow": "always", "named": "never"}], 133 | "space-in-parens": [2, "never"], 134 | "space-infix-ops": [2], 135 | "space-unary-ops": [2, {"words": true, "nonwords": false}], 136 | "wrap-iife": [2], 137 | "yoda": [2, "never"], 138 | }, 139 | } 140 | -------------------------------------------------------------------------------- /lib/root/gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :backtrace: false 3 | :benchmark: false 4 | :bulk_threshold: 1000 5 | :sources: 6 | - https://rubygems.org 7 | :update_sources: true 8 | :verbose: true 9 | install: --env-shebang 10 | update: --env-shebang 11 | -------------------------------------------------------------------------------- /lib/root/ghci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarshall/dotfiles/8609de132f8a4f18e8f5667d8f01917354f94934/lib/root/ghci -------------------------------------------------------------------------------- /lib/root/gvimrc: -------------------------------------------------------------------------------- 1 | set guioptions-=rL " No scrollbar GUI (use text) 2 | set guioptions-=e " No tab bar GUI (use text) 3 | set guioptions-=T " No toolbar 4 | 5 | set guicursor+=a:blinkon0 6 | 7 | if(has("macunix")) 8 | set guifont=Menlo:h14,Monaco:h14 9 | elseif(has("unix")) 10 | set guifont=Deja\ Vu\ Sans\ 14 11 | elseif(has("win32")) 12 | set guifont=Consolas:h14,Courier\ New:h14 13 | endif 14 | 15 | set linespace=2 16 | 17 | if(has("macunix")) 18 | " Paste yanked text in command mode 19 | cnoremap " 20 | 21 | " Copy current file path to system pasteboard. 22 | map :let @* = expand("%"):echo "Copied: ".expand("%") 23 | 24 | " Prev/next in quickfix file listing (e.g. search results) 25 | map :cn 26 | map :cp 27 | 28 | " Opt-cmd-arrows [next & previous open files] 29 | map :bp 30 | map :bn 31 | 32 | " In insert mode, use Cmd- to jump to a new line in insert mode 33 | imap o 34 | 35 | " CtrlP 36 | map :CtrlP 37 | map :CtrlPMRU 38 | 39 | " NERDCommenter 40 | map NERDCommenterToggle 41 | imap NERDCommenterToggle i 42 | else "if(has("gui_gtk") || has("win32")) 43 | " NERDCommenter 44 | map NERDCommenterToggle 45 | imap NERDCommenterToggle i 46 | endif 47 | 48 | if filereadable($HOME . "/.gvimrc_local") 49 | source ~/.gvimrc_local 50 | endif 51 | -------------------------------------------------------------------------------- /lib/root/inputrc: -------------------------------------------------------------------------------- 1 | set enable-bracketed-paste on 2 | 3 | C-b: backward-word 4 | C-f: forward-word 5 | 6 | set completion-ignore-case on 7 | -------------------------------------------------------------------------------- /lib/root/irbrc: -------------------------------------------------------------------------------- 1 | require File.join(Dir.home, '.config/dotfiles/ruby/irb.rb') 2 | -------------------------------------------------------------------------------- /lib/root/lein/profiles.clj: -------------------------------------------------------------------------------- 1 | { 2 | :user { 3 | :plugins [ 4 | [cider/cider-nrepl "0.8.2"] 5 | [lein-ancient "0.5.5"] 6 | ] 7 | } 8 | :dev { 9 | :dependencies [[clj-stacktrace "0.2.8"]] 10 | :injections [(require 'clj-stacktrace.repl)] 11 | :repl-options { 12 | :caught clj-stacktrace.repl/pst+ 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/root/psqlrc: -------------------------------------------------------------------------------- 1 | \pset null '∅' 2 | \set HISTCONTROL ignoredups 3 | \set VERBOSITY verbose 4 | \x auto 5 | -------------------------------------------------------------------------------- /lib/root/sqliterc: -------------------------------------------------------------------------------- 1 | .headers on 2 | .mode column 3 | .nullvalue ∅ 4 | .timer on 5 | -------------------------------------------------------------------------------- /lib/root/vimrc: -------------------------------------------------------------------------------- 1 | func s:fallback(value, fallback) 2 | if empty(a:value) 3 | return a:fallback 4 | else 5 | return a:value 6 | endif 7 | endfunc 8 | 9 | func s:xdg_config() 10 | return s:fallback($XDG_CONFIG_HOME, $HOME . "/.config") 11 | endfunc 12 | 13 | execute 'source' . fnameescape(s:xdg_config() . "/nvim/init.vim") 14 | -------------------------------------------------------------------------------- /lib/root/zlogout: -------------------------------------------------------------------------------- 1 | if [ "$SHLVL" = 1 ] && command -vp clear &>/dev/null; then 2 | clear 3 | fi 4 | -------------------------------------------------------------------------------- /lib/root/zprofile: -------------------------------------------------------------------------------- 1 | source ~/.config/dotfiles/zsh/profile.zsh 2 | -------------------------------------------------------------------------------- /lib/root/zshenv: -------------------------------------------------------------------------------- 1 | source ~/.config/dotfiles/zsh/env.zsh 2 | -------------------------------------------------------------------------------- /lib/root/zshrc: -------------------------------------------------------------------------------- 1 | source ~/.config/dotfiles/zsh/interactive.zsh 2 | 3 | true 4 | -------------------------------------------------------------------------------- /lib/ruby/init.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems/requirement' 2 | require 'rubygems/version' 3 | 4 | module Unbundler 5 | def self.require_external_gem gem_name 6 | require gem_name 7 | rescue LoadError => ex 8 | try_external_require(gem_name) || raise(ex) 9 | end 10 | 11 | def self.try_external_require gem_name 12 | gem_path = path_for_gem(gem_name) 13 | return false unless gem_path 14 | 15 | $LOAD_PATH << "#{gem_path}/lib" 16 | require gem_name 17 | end 18 | 19 | def self.gem_dir 20 | regex = %r((.*?/ruby/(?:gems/)?\d+\.\d+\.\d+/gems/)) 21 | some_gem_dir = $LOAD_PATH.grep(regex).first 22 | return unless some_gem_dir 23 | some_gem_dir.match(regex).captures[0] 24 | end 25 | 26 | def self.path_for_gem gem_name 27 | gem_dir = self.gem_dir 28 | return nil unless gem_dir 29 | 30 | Dir["#{gem_dir}/*"].to_a.detect do |gem_path| 31 | File.basename(gem_path).gsub(/-(\d\.?)+$/, '') == gem_name 32 | end 33 | end 34 | end 35 | 36 | def command_exists? command 37 | system("which #{command} > /dev/null 2> /dev/null") 38 | end 39 | 40 | def current_ruby_version 41 | if Gem::Requirement.new('>= 2.1.0').satisfied_by?(Gem::Version.new(RUBY_VERSION)) 42 | RUBY_VERSION 43 | else 44 | "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" 45 | end 46 | end 47 | 48 | ruby_version_detector = Class.new do 49 | chruby = Module.new do 50 | define_singleton_method(:match?) { command_exists? 'chruby-exec' } 51 | define_singleton_method(:name) { 'chruby' } 52 | define_singleton_method(:version) { current_ruby_version } 53 | end 54 | rbenv = Module.new do 55 | define_singleton_method(:match?) { command_exists? 'rbenv' } 56 | define_singleton_method(:name) { 'rbenv' } 57 | define_singleton_method(:version) { `rbenv version`.strip } 58 | end 59 | rvm = Module.new do 60 | define_singleton_method(:match?) { command_exists? 'rvm' } 61 | define_singleton_method(:name) { 'RVM' } 62 | define_singleton_method(:version) { `rvm current`.split("\n").last } 63 | end 64 | system = Module.new do 65 | define_singleton_method(:match?) { true } 66 | define_singleton_method(:name) { nil } 67 | define_singleton_method(:version) { current_ruby_version } 68 | end 69 | 70 | version_managers = [chruby, rbenv, rvm, system] 71 | define_method(:real_version) { current_ruby_version } 72 | 73 | define_method(:manager) { version_managers.detect(&:match?) } 74 | define_method(:bypassed?) do 75 | manager.version.match(/\d+\.\d+\.\d+(-p\d+)?/).to_s != real_version 76 | end 77 | end 78 | 79 | def print_ruby_version version_detector 80 | begin 81 | Unbundler.require_external_gem 'paint' 82 | rescue LoadError 83 | end 84 | 85 | manager = version_detector.manager.name 86 | engine = RUBY_ENGINE 87 | version = version_detector.manager.version 88 | 89 | if version =~ /system/ 90 | system_raw_version = `$(whereis ruby) --version` 91 | system_major = system_raw_version.match(/ruby (\d\.\d\.\d)/).captures.first 92 | system_patch = system_raw_version.match(/patchlevel (\d+)/).captures.first 93 | version = version.sub(/system/, "system (#{system_major}-p#{system_patch})") 94 | end 95 | 96 | if version_detector.bypassed? 97 | manager ||= 'built-in ruby' 98 | manager = "(#{manager} bypassed)" 99 | version = version_detector.real_version 100 | end 101 | 102 | version_str = [manager, 'using', engine, version].compact.join(' ') 103 | if defined?(Paint) 104 | puts Paint[version_str, :bold, :underline] 105 | else 106 | puts version_str 107 | end 108 | end 109 | 110 | def cli? 111 | is_pry_cli = $PROGRAM_NAME == 'pry' 112 | is_rails_console = defined?(Rails::Console) 113 | is_other_console = $PROGRAM_NAME =~ /console/ 114 | is_irb = $PROGRAM_NAME == 'irb' 115 | 116 | is_pry_cli || is_rails_console || is_other_console || is_irb 117 | end 118 | 119 | print_ruby_version(ruby_version_detector.new) if cli? 120 | 121 | class Array 122 | def self.toy n = 10 123 | Array.new(n) { |i| i }.shuffle 124 | end 125 | end 126 | 127 | class Hash 128 | def self.toy n = 5 129 | keys = ('a'..'z').to_a.take(n).shuffle 130 | values = Array.toy(n) 131 | Hash[keys.zip(values)] 132 | end 133 | end 134 | 135 | module Clipboard 136 | module Pasteboard 137 | def self.match? 138 | command_exists?('pbcopy') && command_exists?('pbpaste') 139 | end 140 | 141 | def copy object 142 | IO.popen('pbcopy', 'w') { |f| f << object.to_s } 143 | $?.exited? 144 | end 145 | 146 | def paste 147 | `pbpaste` 148 | end 149 | end 150 | 151 | module Xclip 152 | def self.match? 153 | command_exists? 'xclip' 154 | end 155 | 156 | def copy object 157 | IO.popen('xclip -selection clipboard', 'w') { |f| f << object.to_s } 158 | $?.exited? 159 | end 160 | 161 | def paste 162 | `xclip -selection clipboard -o` 163 | end 164 | end 165 | 166 | module Xsel 167 | def self.match? 168 | command_exists? 'xsel' 169 | end 170 | 171 | def copy object 172 | IO.popen('xsel --clipboard --input', 'w') { |f| f << object.to_s } 173 | $?.exited? 174 | end 175 | 176 | def paste 177 | `xsel --clipboard --output` 178 | end 179 | end 180 | 181 | STRATEGIES = [Pasteboard, Xclip, Xsel] 182 | 183 | def self.included klass 184 | return unless capable? 185 | klass.send :include, strategy 186 | end 187 | 188 | def self.capable? 189 | !!strategy 190 | end 191 | 192 | def self.strategy 193 | @strategy ||= STRATEGIES.detect(&:match?) 194 | end 195 | end 196 | 197 | singleton_class.send :include, Clipboard if Clipboard.capable? 198 | 199 | # Load if in Rails console 200 | if defined?(Rails) && Rails.env 201 | def change_log(stream) 202 | if defined? ActiveRecord::Base 203 | ActiveRecord::Base.logger = Logger.new stream 204 | ActiveRecord::Base.clear_active_connections! 205 | end 206 | end 207 | 208 | def show_log 209 | change_log STDOUT 210 | end 211 | 212 | def hide_log 213 | change_log nil 214 | end 215 | 216 | change_log STDOUT 217 | end 218 | -------------------------------------------------------------------------------- /lib/ruby/irb.rb: -------------------------------------------------------------------------------- 1 | require 'irb/completion' 2 | require 'irb/ext/save-history' 3 | require 'pathname' 4 | 5 | xdg_data_home = Pathname.new(ENV.fetch( 6 | 'XDG_DATA_HOME', 7 | File.join(Dir.home, '.local', 'share') 8 | )) 9 | irb_data_home = xdg_data_home.join('irb') 10 | irb_data_home.mkpath unless irb_data_home.exist? 11 | 12 | IRB.conf[:AUTO_INDENT] = true 13 | IRB.conf[:HISTORY_FILE] = irb_data_home.join('history').to_s 14 | IRB.conf[:SAVE_HISTORY] = 1000 15 | IRB.conf[:PROMPT][:CUSTOM] = { 16 | :PROMPT_I => "%02n >> ", 17 | :PROMPT_N => "%02n >> ", 18 | :PROMPT_S => nil, 19 | :PROMPT_C => "%02n ?> ", 20 | :RETURN => "=> %s\n" 21 | } 22 | IRB.conf[:PROMPT_MODE] = :CUSTOM 23 | 24 | begin 25 | require 'rubygems' if RUBY_VERSION < '1.9' 26 | rescue LoadError 27 | end 28 | 29 | require_relative './init.rb' 30 | -------------------------------------------------------------------------------- /lib/ruby/pry.rb: -------------------------------------------------------------------------------- 1 | # Load plugins (only those I whitelist) 2 | Pry.config.should_load_plugins = false 3 | Pry.plugins["doc"].activate! 4 | 5 | prompt = proc do |indicator, target_self, nest_level, pry| 6 | input_ring = if pry.respond_to?(:input_ring) 7 | pry.input_ring 8 | else 9 | pry.input_array 10 | end 11 | line = '%02d' % input_ring.size 12 | nesting = ":#{nest_level}" unless nest_level.zero? 13 | "[#{line}] pry(#{Pry.view_clip(target_self)})#{nesting}#{indicator} " 14 | end 15 | 16 | Pry.config.prompt = [prompt.curry['>'], prompt.curry['*']] 17 | 18 | Pry.config.print = proc do |output, value| 19 | indicator = Pry::Helpers::Text.green('→') 20 | output.puts "#{indicator} #{value.inspect}" 21 | end 22 | 23 | Pry.config.exception_handler = proc do |output, exception, _| 24 | display = ->(text) { output.puts Pry::Helpers::Text.yellow(text) } 25 | 26 | backtrace = exception.backtrace.map do |line| 27 | if match = line.match(/.*\/\d\.\d\.\d\/(.+)/) 28 | ".../#{match.captures.first}" 29 | else 30 | line 31 | end 32 | end.reject.with_index do |line, index| 33 | index != 0 && line =~ /gems\/(pry|zeus|rspec)/ 34 | end 35 | 36 | display.(exception.inspect) 37 | backtrace.each do |line| 38 | display.(" #{line}") 39 | end 40 | end 41 | 42 | Pry.config.theme = 'solarized' 43 | 44 | require_relative './init.rb' 45 | -------------------------------------------------------------------------------- /lib/shell/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ "$(uname)" == Darwin ]] && [ -x /usr/libexec/path_helper ]; then 2 | eval "$(/usr/libexec/path_helper -s)" 3 | fi 4 | 5 | for dir in ~/.config/dotfiles/shell/plugins/*; do 6 | if [[ -f "$dir/env.zsh" ]]; then 7 | source "$dir/env.zsh" 8 | fi 9 | done 10 | -------------------------------------------------------------------------------- /lib/shell/interactive.zsh: -------------------------------------------------------------------------------- 1 | for dir in ~/.config/dotfiles/shell/plugins/*; do 2 | if [[ -f "$dir/interactive.zsh" ]]; then 3 | source "$dir/interactive.zsh" 4 | fi 5 | done 6 | -------------------------------------------------------------------------------- /lib/shell/plugins/_core/env.zsh: -------------------------------------------------------------------------------- 1 | export CLICOLOR=1 2 | export LSCOLORS=ExfxcxdxbxagadbHbHEHEH 3 | export LS_COLORS='di=01;34;49:ln=35;49:so=32;49:pi=33;49:ex=31;49:bd=30;46:cd=30;43:su=31;01;47:sg=31;01;47:tw=01;34;01;47:ow=01;34;01;47' 4 | if [ -z "$JAVA_HOME" ] && command -v /usr/libexec/java_home &> /dev/null; then 5 | export JAVA_HOME="$(/usr/libexec/java_home 2>/dev/null)" 6 | fi 7 | command -v lesspipe.sh &> /dev/null && export LESSOPEN="| lesspipe.sh %s" 8 | [[ -z "$LANG" ]] && export LANG=en_US.UTF-8 9 | [[ -z "$LC_ALL" ]] && export LC_ALL=en_US.UTF-8 10 | export LESS="-i -M -S -R" 11 | export PAGER="$(command -vp less)" 12 | 13 | export PATH="$PATH:$HOME/bin" 14 | 15 | if [[ "$(uname)" = 'Linux' && "$XDG_SESSION_TYPE" = 'wayland' ]]; then 16 | # See also lib/bin/sway 17 | export CLUTTER_BACKEND=wayland 18 | export MOZ_ENABLE_WAYLAND=1 19 | export QT_QPA_PLATFORM=wayland-egl 20 | export SDL_VIDEODRIVER=wayland 21 | export XDG_CURRENT_DESKTOP=sway 22 | fi 23 | -------------------------------------------------------------------------------- /lib/shell/plugins/_core/interactive.zsh: -------------------------------------------------------------------------------- 1 | alias be='bundle exec' 2 | alias cmdstatistics="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr" 3 | alias cp='cp -i' 4 | alias git-root='cd $(git root)' 5 | alias gzdir='tar czf ../$(basename "$(pwd)").tar.gz .' 6 | alias gzdirs='find . -mindepth 1 -maxdepth 1 -type d -exec tar czf {}.tar.gz {} \;' 7 | alias httpheaders='curl -I' 8 | alias less='less -R -i' 9 | alias ll='ls -l' 10 | if [[ "$(uname)" = Linux ]]; then 11 | alias ls='ls -aFh --group-directories-first' 12 | else 13 | alias ls='ls -aFh' 14 | fi 15 | alias mv='mv -i' 16 | alias mvimload='mvim -c "so %"' 17 | alias parallel='parallel --will-cite' 18 | alias prd='pwd -P' # "print real directory" (follows symlinks) 19 | alias R='R --no-save --quiet' 20 | alias ri='ri -f ansi' 21 | alias vimload='vim -c "so %"' 22 | 23 | command -v apt-get &> /dev/null && alias aptupgrade='sudo apt-get update && sudo apt-get upgrade' 24 | command -v colordiff &> /dev/null && alias diff=colordiff 25 | command -v colormake &> /dev/null && alias make=colormake 26 | alias grep='grep --color=auto' 27 | alias egrep='egrep --color=auto' 28 | alias fgrep='fgrep --color=auto' 29 | command -v open &> /dev/null && alias o='open' 30 | 31 | if command -v exa &> /dev/null; then 32 | alias lx='exa --all --classify --git --group-directories-first --time-style=long-iso' 33 | alias lxl='exa --all --classify --git --group-directories-first --time-style=long-iso --long' 34 | fi 35 | 36 | if command -v nvim &> /dev/null; then 37 | alias view='nvim -R' 38 | fi 39 | 40 | if command -v qlmanage &> /dev/null; then 41 | alias ql='quicklook' 42 | alias quicklook='qlmanage -p &> /dev/null' 43 | fi 44 | 45 | if type /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine &> /dev/null; then 46 | alias screensaver=/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine 47 | fi 48 | 49 | if command -v dircolors &> /dev/null; then 50 | if alias ls &> /dev/null; then 51 | ls=$(alias ls | awk -F"'" '{print $(NF-1)}') 52 | alias ls="$ls --color=auto" 53 | unset ls 54 | else 55 | alias ls='ls --color=auto' 56 | fi 57 | alias dir='dir --color=auto' 58 | alias vdir='vdir --color=auto' 59 | fi 60 | -------------------------------------------------------------------------------- /lib/shell/plugins/_core/profile.zsh: -------------------------------------------------------------------------------- 1 | export EDITOR="$(command -v nvim || command -v vim)" 2 | export VISUAL="$EDITOR" 3 | -------------------------------------------------------------------------------- /lib/shell/plugins/ant/interactive.zsh: -------------------------------------------------------------------------------- 1 | ant() { 2 | "$(command -vp ant)" -logger org.apache.tools.ant.listener.AnsiColorLogger "$@" | perl -pe 's/(?<=\e\[)2;//g' 3 | } 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/base16/interactive.zsh: -------------------------------------------------------------------------------- 1 | BASE16_SHELL="$HOME/.config/dotfiles/shell/vendor/base16-shell/" 2 | [ -n "$PS1" ] && [ -s "$BASE16_SHELL/profile_helper.sh" ] && eval "$("$BASE16_SHELL"/profile_helper.sh)" 3 | 4 | if [[ "$BASE16_THEME" == base16-* ]]; then 5 | export BASE16_THEME="$(echo "$BASE16_THEME" | perl -pe 's/^(base16-)+//')" 6 | fi 7 | 8 | if [[ -z "$SSH_CONNECTION" && $SHLVL = 1 ]]; then 9 | base16_solarized-dark 10 | fi 11 | -------------------------------------------------------------------------------- /lib/shell/plugins/c/interactive.zsh: -------------------------------------------------------------------------------- 1 | c() { 2 | if [[ "$(find ~/Code/ -mindepth 2 -maxdepth 2 -wholename "$1" | wc -l)" -gt 1 ]]; then 3 | echo 'FATAL: multiple directories match, cannot select' >&2 4 | return 1 5 | fi 6 | cd ~/Code/*/$1 7 | if [[ -n $TMUX ]] && ( \ 8 | [[ $(tmux display-message -p '#W') == $(basename "$SHELL") ]] \ 9 | || (($(tmux list-panes | wc -l) == 1)) \ 10 | ); then 11 | tmux rename-window "$1" 12 | fi 13 | } 14 | -------------------------------------------------------------------------------- /lib/shell/plugins/dnf/interactive.zsh: -------------------------------------------------------------------------------- 1 | if [[ $(id -u) != 0 ]]; then 2 | alias dnf="dnf --cacheonly" 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/fzf/env.zsh: -------------------------------------------------------------------------------- 1 | export FZF_DEFAULT_OPTS='--bind change:top --color=fg+:18,bg+:20,hl:3,hl+:18,border:19,header:15,info:19,prompt:8,spinner:24 --filepath-word' 2 | 3 | if command -v fd &> /dev/null; then 4 | export FZF_DEFAULT_COMMAND='fd --hidden --type f' 5 | fi 6 | -------------------------------------------------------------------------------- /lib/shell/plugins/git/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ -d "/usr/share/git-core/contrib" ]]; then 2 | export PATH="$PATH:/usr/share/git-core/contrib" 3 | elif [[ -d "/usr/local/share/git-core/contrib/diff-highlight" ]]; then 4 | export PATH="$PATH:/usr/local/share/git-core/contrib/diff-highlight" 5 | fi 6 | -------------------------------------------------------------------------------- /lib/shell/plugins/haskell-stack/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ -d "$HOME/.local/bin" ]]; then 2 | export PATH="$PATH:$HOME/.local/bin" 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/homebrew/env.zsh: -------------------------------------------------------------------------------- 1 | if command -v brew &>/dev/null; then 2 | export HOMEBREW_CASK_OPTS='--appdir=/Applications' 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/node/interactive.zsh: -------------------------------------------------------------------------------- 1 | if command -v nodenv &> /dev/null; then 2 | eval "$(nodenv init -)" 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/python/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ -d "$HOME"/Library/Python ]]; then 2 | for dir in "$HOME"/Library/Python/*/bin; do 3 | if [[ -d "$dir" ]]; then 4 | export PATH="$PATH:$dir" 5 | fi 6 | done 2>/dev/null 7 | fi 8 | -------------------------------------------------------------------------------- /lib/shell/plugins/python/interactive.zsh: -------------------------------------------------------------------------------- 1 | if command -v pyenv &> /dev/null; then 2 | eval "$(pyenv init -)" 3 | fi 4 | 5 | pipenv() { 6 | if command -v pipenv &> /dev/null; then 7 | if [[ -e Pipfile ]]; then 8 | command pipenv "$@" 9 | else 10 | echo "No Pipfile present, aborting." >&2 11 | return 1 12 | fi 13 | else 14 | command pipenv 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /lib/shell/plugins/python/profile.zsh: -------------------------------------------------------------------------------- 1 | if command -v pyenv &> /dev/null; then 2 | eval "$(pyenv init --path)" 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/ripgrep/env.zsh: -------------------------------------------------------------------------------- 1 | export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/ripgrep/config" 2 | -------------------------------------------------------------------------------- /lib/shell/plugins/ruby/interactive.zsh: -------------------------------------------------------------------------------- 1 | if [ -s "/usr/local/opt/chruby/share/chruby/chruby.sh" ]; then 2 | source /usr/local/opt/chruby/share/chruby/chruby.sh 3 | source /usr/local/opt/chruby/share/chruby/auto.sh 4 | elif command -v rbenv &> /dev/null; then 5 | eval "$(rbenv init -)" 6 | elif [ -s "$HOME/.rvm/scripts/rvm" ]; then 7 | source "$HOME/.rvm/scripts/rvm" 8 | fi 9 | -------------------------------------------------------------------------------- /lib/shell/plugins/rust/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ -d "$HOME/.cargo/bin" ]]; then 2 | export PATH="$PATH:$HOME/.cargo/bin" 3 | fi 4 | -------------------------------------------------------------------------------- /lib/shell/plugins/tex/env.zsh: -------------------------------------------------------------------------------- 1 | [[ -d /Library/TeX/texbin ]] && export PATH=$PATH:/Library/TeX/texbin 2 | -------------------------------------------------------------------------------- /lib/shell/profile.zsh: -------------------------------------------------------------------------------- 1 | for dir in ~/.config/dotfiles/shell/plugins/*; do 2 | if [[ -f "$dir/profile.zsh" ]]; then 3 | source "$dir/profile.zsh" 4 | fi 5 | done 6 | -------------------------------------------------------------------------------- /lib/shell/util.bash: -------------------------------------------------------------------------------- 1 | # Takes as args either: 2 | # 3 | # none 4 | # bold 5 | # underline 6 | # fg 7 | # bg 8 | term_format() { 9 | case "$1" in 10 | reset) tput sgr0 ;; 11 | bold) tput bold ;; 12 | underline) tput underline ;; 13 | fg) 14 | case "$2" in 15 | red) tput setaf 1 ;; 16 | green) tput setaf 2 ;; 17 | yellow) tput setaf 3 ;; 18 | blue) tput setaf 4 ;; 19 | magenta) tput setaf 5 ;; 20 | cyan) tput setaf 6 ;; 21 | white) tput setaf 7 ;; 22 | *) 23 | printf "unknown color" >&2 24 | return 1 25 | esac 26 | ;; 27 | bg) 28 | case "$2" in 29 | red) tput setab 1 ;; 30 | green) tput setab 2 ;; 31 | yellow) tput setab 3 ;; 32 | blue) tput setab 4 ;; 33 | magenta) tput setab 5 ;; 34 | cyan) tput setab 6 ;; 35 | white) tput setab 7 ;; 36 | *) 37 | printf "unknown color" >&2 38 | return 1 39 | esac 40 | ;; 41 | *) 42 | printf "unknown type" >&2 43 | return 1 44 | esac 45 | } 46 | 47 | # Intended as a controlled version of `set -x`, echos the command, then 48 | # executes it. 49 | runcmd() { 50 | echo + "$@" >&2 51 | if [[ -z "$DRY_RUN" ]]; then 52 | (set +e ; "$@") 53 | return $? 54 | else 55 | return 0 56 | fi 57 | } 58 | 59 | # Like `&&`, but without short-circuiting. Returns 1 if any commands exit with 60 | # non-zero status. Does *not* use `runcmd` for running commands. 61 | runmulti() { 62 | local exit_status=0 63 | for cmd in "$@"; do 64 | if [[ -z "$DRY_RUN" ]]; then 65 | $cmd || exit_status=1 66 | fi 67 | done 68 | return $exit_status 69 | } 70 | 71 | # Like `runcmd`, except exec the command. 72 | execcmd() { 73 | echo + "$@" >&2 74 | if [[ -z "$DRY_RUN" ]]; then 75 | exec "$@" 76 | else 77 | exit 78 | fi 79 | } 80 | 81 | # Returns success if STDOUT is a terminal, failure if not. 82 | output_is_terminal() { 83 | if [ -t 1 ]; then 84 | return 0 85 | else 86 | return 1 87 | fi 88 | } 89 | 90 | # Accepts a prefix, ANSI-control format string, and message. Primarily meant for 91 | # building other output functions. 92 | message() { 93 | local prefix="$1" 94 | local ansi_format="$2" 95 | local message='' 96 | if [[ -z "$3" ]]; then 97 | read -r -d '' message 98 | else 99 | message="$3" 100 | fi 101 | local padding="$(echo "$prefix" | perl -pe 's/./ /g')" 102 | message="$(echo "$message" | perl -pe "s/^/$padding/ unless 1")" 103 | printf "%b%s %s%b\\n" "$ansi_format" "$prefix" "$message" "$FMT_NONE" >&2 104 | } 105 | 106 | # Accepts a message either via stdin or as the first argument. Does not exit. 107 | info() { 108 | message '==>' "$FMT_BOLD" "$@" 109 | } 110 | 111 | # Accepts a message either via stdin or as the first argument. Does not exit. 112 | warn() { 113 | message 'WARNING:' "$FMT_YELLOW" "$@" 114 | } 115 | 116 | # Accepts a message either via stdin or as the first argument. Does not exit. 117 | fatal() { 118 | message 'FATAL:' "$FMT_RED" "$@" 119 | } 120 | 121 | # Like `fatal`, but also exits with non-zero status. 122 | abort() { 123 | fatal "$1" 124 | exit 1 125 | } 126 | 127 | # Indents the given text (via stdin). Defaults to two spaces, takes optional 128 | # argument for number of spaces to indent by. 129 | indent() { 130 | local num=${1:-2} 131 | local str="$(printf "%${num}s" '')" 132 | perl -pe "s/^/$str/" 133 | } 134 | 135 | # Removes all ANSI colors codes, takes input via stdin. 136 | remove_color_codes() { 137 | perl -pe 's/\x1b\[[0-9;]*m//g' 138 | } 139 | 140 | # Changes "light black" colors so they are not hidden with Solarized Dark. 141 | # If stdout is not a terminal, it will remove all color codes. 142 | # 143 | # Note that, as is true with all shell pipelines, this cannot return the exit 144 | # status of the piped-from command. See instead unblacken_cmd(). 145 | # 146 | # See 147 | # See 148 | unblacken() { 149 | if output_is_terminal; then 150 | perl -pe 's/\x1b\[90m/\x1b[92m/g' 151 | else 152 | remove_color_codes 153 | fi 154 | } 155 | 156 | # Like `unblacken`, but takes the command to unblacken as an argument list and 157 | # returns the exit status of the command run. 158 | unblacken_cmd() { 159 | set -o pipefail 160 | "$@" | unblacken 161 | } 162 | -------------------------------------------------------------------------------- /lib/shell/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarshall/dotfiles/8609de132f8a4f18e8f5667d8f01917354f94934/lib/shell/vendor/.keep -------------------------------------------------------------------------------- /lib/terminfo/tmux.terminfo.txt: -------------------------------------------------------------------------------- 1 | tmux|tmux terminal multiplexer, 2 | sitm=\E[3m, ritm=\E[23m, 3 | smso=\E[7m, rmso=\E[27m, 4 | use=screen, 5 | 6 | tmux-256color|tmux with 256 colors, 7 | sitm=\E[3m, ritm=\E[23m, 8 | smso=\E[7m, rmso=\E[27m, 9 | use=screen-256color, 10 | -------------------------------------------------------------------------------- /lib/vim/after/syntax/css.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: CSS 3 3 | " Maintainer: Shiao 4 | " Last Change: 2010 Apr 5 5 | 6 | syn keyword cssTagName article aside audio bb canvas command datagrid 7 | syn keyword cssTagName datalist details dialog embed figure footer 8 | syn keyword cssTagName header hgroup keygen mark meter nav output 9 | syn keyword cssTagName progress time ruby rt rp section time video 10 | syn keyword cssTagName source figcaption 11 | 12 | syn keyword cssColorProp contained opacity 13 | 14 | syn match cssTextProp contained "\" 15 | syn match cssTextProp contained "\" 16 | 17 | syn match cssBoxProp contained "\" 18 | syn match cssBoxProp contained "\" 19 | syn match cssBoxProp contained "\" 20 | " firefox border-radius TODO 21 | syn match cssBoxProp contained "-moz-border-radius\>" 22 | syn match cssBoxProp contained "-moz-border-radius\(-\(bottomleft\|bottomright\|topright\|topleft\)\)\>" 23 | -------------------------------------------------------------------------------- /lib/vim/after/syntax/html.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: HTML (version 5) 3 | " Maintainer: Rodrigo Machado 4 | " URL: http://gist.github.com/256840 5 | " Last Change: 2010 Aug 26 6 | " License: Public domain 7 | " (but let me know if you liked it :) ) 8 | " 9 | " Note: This file just adds the new tags from HTML 5 10 | " and don't replace default html.vim syntax file 11 | 12 | " HTML 5 tags 13 | syn keyword htmlTagName contained article aside audio bb canvas command datagrid 14 | syn keyword htmlTagName contained datalist details dialog embed figure footer 15 | syn keyword htmlTagName contained header hgroup keygen mark meter nav output 16 | syn keyword htmlTagName contained progress time ruby rt rp section time video 17 | syn keyword htmlTagName contained source figcaption 18 | 19 | " HTML 5 arguments 20 | syn keyword htmlArg contained autofocus autocomplete placeholder min max step 21 | syn keyword htmlArg contained contenteditable contextmenu draggable hidden item 22 | syn keyword htmlArg contained itemprop list sandbox subject spellcheck 23 | syn keyword htmlArg contained novalidate seamless pattern formtarget manifest 24 | syn keyword htmlArg contained formaction formenctype formmethod formnovalidate 25 | syn keyword htmlArg contained sizes scoped async reversed sandbox srcdoc 26 | syn keyword htmlArg contained hidden role 27 | syn match htmlArg "\<\(aria-[\-a-zA-Z0-9_]\+\)=" contained 28 | syn match htmlArg contained "\s*data-[-a-zA-Z0-9_]\+" -------------------------------------------------------------------------------- /lib/vim/colors/solarized.vim: -------------------------------------------------------------------------------- 1 | ../bundle/vim-colors-solarized/colors/solarized.vim -------------------------------------------------------------------------------- /lib/vim/config/filetypes.vim: -------------------------------------------------------------------------------- 1 | " Delete trailing whitespace 2 | func! DeleteTrailingWhitespace() 3 | exec "normal mZ" 4 | %s/\s\+$//e 5 | exec "normal `Z" 6 | endfunc 7 | autocmd BufWritePre *.{c,cpp,h,hpp,m,mm} :call DeleteTrailingWhitespace() 8 | autocmd BufWritePre *.{erb,feature,haml,rb,yml} :call DeleteTrailingWhitespace() 9 | autocmd BufWritePre *.{css,html,js,json,less,scss,xml} :call DeleteTrailingWhitespace() 10 | autocmd BufWritePre *.{clj,java,php,rs} :call DeleteTrailingWhitespace() 11 | 12 | " Associate some filetypes with their proper syntax 13 | autocmd BufRead,BufNewFile *.applescript set filetype=applescript 14 | autocmd BufRead,BufNewFile *.avsc set filetype=json 15 | autocmd BufRead,BufNewFile *.dockerignore set filetype=conf 16 | autocmd BufRead,BufNewFile *.prawn set filetype=ruby 17 | autocmd BufRead,BufNewFile *.pyi set filetype=python 18 | autocmd BufRead,BufNewFile *.txt set filetype=text 19 | autocmd BufRead,BufNewFile Containerfile set filetype=dockerfile 20 | autocmd BufRead,BufNewFile gitconfig set filetype=gitconfig 21 | autocmd BufRead,BufNewFile gitignore set filetype=conf 22 | autocmd BufRead * if getline(1) =~# '\v^#!.+[/ ]R(script)?$' | setfiletype r | endif 23 | 24 | autocmd FileType clojure set iskeyword-=. 25 | 26 | autocmd FileType mail setlocal textwidth=0 27 | autocmd FileType mail setlocal wrapmargin=0 28 | 29 | autocmd FileType gitcommit,mail,markdown,text set spell 30 | 31 | autocmd FileType scss setlocal iskeyword=@,48-57,_,-,?,!,192-255 32 | 33 | " Enable soft-wrapping for text files 34 | autocmd FileType eruby,html,markdown,tex,text,xhtml setlocal wrap linebreak nolist 35 | 36 | autocmd FileType bindzone setlocal nolist 37 | autocmd FileType bindzone setlocal noexpandtab 38 | autocmd FileType bindzone setlocal shiftwidth=8 39 | autocmd FileType bindzone setlocal tabstop=8 40 | 41 | " When editing a file, always jump to the last known cursor position. 42 | " Don't do it when the position is invalid, when inside an event handler 43 | " (happens when dropping a file on gvim), or when inside a git commit 44 | autocmd BufReadPost * 45 | \ if &filetype != "gitcommit" && &filetype != "gitrebase" && line("'\"") > 0 && line("'\"") <= line("$") | 46 | \ exe "normal g`\"" | 47 | \ endif 48 | -------------------------------------------------------------------------------- /lib/vim/config/init.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | set runtimepath^=~/.config/dotfiles/vim 3 | set packpath^=~/.config/dotfiles/vim 4 | autocmd! 5 | -------------------------------------------------------------------------------- /lib/vim/config/mappings.vim: -------------------------------------------------------------------------------- 1 | " Mapping for writing all files in a tab 2 | cabbrev wt silent windo w 3 | 4 | " Gracefully handle holding shift too long after : for common commands 5 | cabbrev Q q 6 | cabbrev Qa qa 7 | cabbrev Tabe tabe 8 | cabbrev Tabn tabn 9 | cabbrev W w 10 | cabbrev Wa wa 11 | cabbrev Wq wq 12 | cabbrev Wt wt 13 | 14 | " Make Y consistent with D and C. 15 | map Y y$ 16 | 17 | " Indent/unindent visual mode selection with tab/shift+tab 18 | vmap >gv 19 | vmap 23 | cnoremap 24 | cnoremap 25 | 26 | " Map backspace as alternative leader 27 | nmap 28 | vmap 29 | 30 | " Easier omnifunc mapping 31 | imap 32 | 33 | " Map regular , to ,, so it may be used for other mappings 34 | nnoremap ,, , 35 | 36 | 37 | " SpaceVim 38 | 39 | let g:which_key_map = {} 40 | 41 | nnoremap :WhichKey '' 42 | nnoremap :WhichKey ',' 43 | 44 | nnoremap : 45 | nnoremap : 46 | let g:which_key_map['/'] = 'toggle comment' 47 | noremap / :call NERDComment("n", "Toggle") 48 | 49 | let g:which_key_map.b = {'name': '+buffer'} 50 | let g:which_key_map.b.c = 'copy current path' 51 | nnoremap bc :let @* = expand("%"):echo "Copied: ".expand("%") 52 | let g:which_key_map.b.C = 'copy current path & line num.' 53 | nnoremap bC :let @* = expand("%").":".line("."):echo "Copied: ".expand("%").":".line(".") 54 | let g:which_key_map.b.r = 'reload buffer from disk' 55 | nnoremap br :e! 56 | let g:which_key_map.b.s = 'toggle spell-check in buffer' 57 | nnoremap bs :setlocal spell! 58 | 59 | let g:which_key_map.f = {'name': '+files'} 60 | let g:which_key_map.f.g = 'search files by content (grep)' 61 | nnoremap fg :Ack 62 | let g:which_key_map.f.s = 'search files by name' 63 | nnoremap fs :FzfFiles 64 | let g:which_key_map.f.l = 'toggle file list tree' 65 | nnoremap fl :NERDTreeToggle 66 | let g:which_key_map.f.L = 'open file list tree at current file' 67 | nnoremap fL :NERDTreeFind 68 | 69 | autocmd FileType gitcommit nnoremap gf ggd/message #2:dj 70 | 71 | nnoremap h :nohlsearch 72 | 73 | let g:which_key_map.t = {'name': '+tags'} 74 | let g:which_key_map.t.L = 'toggle tag list' 75 | nnoremap tl :TagbarToggle 76 | let g:which_key_map.t.L = 'search tags' 77 | nnoremap ts :call fzf#vim#tags('') 78 | 79 | let g:which_key_map.u = 'toggle undo tree' 80 | nnoremap u :MundoToggle 81 | 82 | let g:which_key_map.l = {'name': '+lang'} 83 | let g:which_key_map.l.e = 'error details' 84 | let g:which_key_map.l.g = {'name': '+goto'} 85 | let g:which_key_map.l.g.d = 'goto definition' 86 | let g:which_key_map.l.g.i = 'goto implementation' 87 | let g:which_key_map.l.g.r = 'goto reference' 88 | let g:which_key_map.l.g.t = 'goto type definition' 89 | let g:which_key_map.l.h = 'highlight usage' 90 | let g:which_key_map.l.h = 'clear highlight' 91 | let g:which_key_map.l.r = 'rename' 92 | let g:which_key_map.l.s = 'start language server' 93 | let g:which_key_map.l.t = 'reveal type' 94 | " nnoremap le :call LanguageClient#explainErrorAtPoint() 95 | nnoremap lgd lua vim.lsp.buf.definition() 96 | nnoremap lgi lua vim.lsp.buf.implementation() 97 | nnoremap lgr lua vim.lsp.buf.references() 98 | nnoremap lgt lua vim.lsp.buf.type_definition() 99 | nnoremap lh lua vim.lsp.buf.buf_highlight_references() 100 | nnoremap lH lua vim.lsp.buf.buf_clear_references() 101 | nnoremap lr lua vim.lsp.buf.rename() 102 | nnoremap ls LspStart 103 | nnoremap lt lua vim.lsp.buf.hover() 104 | autocmd FileType haskell nnoremap lt InteroGenericType 105 | autocmd FileType scala nnoremap lt :EnType 106 | 107 | if $TERM ==# "xterm-kitty" 108 | map 109 | map 110 | for n in [2, 3, 4] 111 | execute "map <".n."-ScrollWheelUp> " 112 | execute "map <".n."-ScrollWheelDown> " 113 | endfor 114 | endif 115 | -------------------------------------------------------------------------------- /lib/vim/config/packages.vim: -------------------------------------------------------------------------------- 1 | function s:lazyload(plugin, file_types) 2 | execute "autocmd FileType " . a:file_types . " packadd " . a:plugin 3 | endfunction 4 | 5 | call s:lazyload("bundler", "ruby") 6 | call s:lazyload("ensime", "java,scala") 7 | call s:lazyload("fireplace", "clojure") 8 | call s:lazyload("intero-neovim", "haskell") 9 | call s:lazyload("jedi", "python") 10 | call s:lazyload("parinfer", "clojure,lisp,racket") 11 | call s:lazyload("racer", "rust") 12 | call s:lazyload("rake", "ruby") 13 | call s:lazyload("textobj-rubyblock", "ruby") 14 | -------------------------------------------------------------------------------- /lib/vim/config/plugins.vim: -------------------------------------------------------------------------------- 1 | " Abolish 2 | cabbrev S Subvert 3 | cabbrev %S %Subvert 4 | 5 | " Ack 6 | if executable('rg') 7 | let g:ackprg = 'sh -c ''rg --vimgrep "$@" \| sort --field-separator=: --key=1,1 --stable'' --' 8 | elseif executable('ag') 9 | let g:ackprg = 'ag --vimgrep' 10 | endif 11 | 12 | " ALE 13 | let g:ale_echo_msg_format='%severity% <%linter%> %code: %%s' 14 | let g:ale_echo_msg_error_str='[ERROR]' 15 | let g:ale_echo_msg_info_str='[INFO]' 16 | let g:ale_echo_msg_warning_str='[WARN]' 17 | let g:ale_python_auto_pipenv = 1 18 | let g:ale_rust_cargo_use_clippy = executable('cargo-clippy') 19 | autocmd FileType haskell let b:ale_linters = ['stack_ghc'] 20 | autocmd FileType javascript let b:ale_linters = ['eslint', 'tsserver'] 21 | autocmd FileType ruby let b:ale_linters = ['ruby', 'rubocop'] 22 | 23 | " Blockle 24 | let g:blockle_mapping = 'rb' 25 | 26 | " EasyMotion 27 | let g:EasyMotion_do_mapping = 0 28 | 29 | " Easytags 30 | set tags=./tags,tags 31 | let g:easytags_auto_highlight = 0 32 | let g:easytags_async = 1 33 | let g:easytags_dynamic_files = 1 34 | 35 | " Indent Guides 36 | let g:indent_guides_auto_colors = 0 37 | let g:indent_guides_default_mapping = 0 38 | autocmd VimEnter,Colorscheme * :hi link IndentGuidesOdd Normal 39 | autocmd VimEnter,Colorscheme * :hi link IndentGuidesEven CursorLine 40 | 41 | " Indexed Search 42 | let g:indexed_search_show_index_mappings = 0 43 | 44 | " fzf 45 | let g:fzf_command_prefix = 'Fzf' 46 | let g:fzf_layout = { 'down': '40%' } 47 | let g:fzf_preview_window = '' 48 | map :FzfFiles 49 | 50 | " Haskell 51 | let g:haskell_backpack = 1 " enable highlighting of backpack keywords 52 | let g:haskell_enable_arrowsyntax = 1 " enable highlighting of `proc` 53 | let g:haskell_enable_pattern_synonyms = 1 " enable highlighting of `pattern` 54 | let g:haskell_enable_quantification = 1 " enable highlighting of `forall` 55 | let g:haskell_enable_recursivedo = 1 " enable highlighting of `mdo` and `rec` 56 | let g:haskell_enable_static_pointers = 1 " enable highlighting of `static` 57 | let g:haskell_enable_typeroles = 1 " enable highlighting of type roles 58 | 59 | " indentLine 60 | let g:indentLine_char = '┃' 61 | let g:indentLine_color_term = 18 62 | autocmd FileType markdown,nerdtree IndentLinesDisable 63 | 64 | " jedi 65 | let g:jedi#popup_on_dot = 0 66 | 67 | " JSON 68 | let g:vim_json_syntax_conceal = 0 69 | 70 | " Julia 71 | let g:latex_to_unicode_tab = 0 72 | 73 | " LSP 74 | if has('nvim-0.5.0') 75 | lua << LUA 76 | local on_attach = function(client, bufnr) 77 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 78 | buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') 79 | end 80 | 81 | require'lspconfig'.pylsp.setup{ 82 | on_attach = on_attach, 83 | settings = { 84 | pylsp = { 85 | configurationSources = {"flake8"}, 86 | plugins = { 87 | pylsp_mypy = { 88 | enabled = true, 89 | live_mode = false, 90 | } 91 | }, 92 | }, 93 | }, 94 | } 95 | require'lspconfig'.solargraph.setup{ 96 | on_attach = on_attach, 97 | } 98 | require'lspconfig'.rust_analyzer.setup{ 99 | on_attach = on_attach, 100 | } 101 | LUA 102 | else 103 | let g:lspconfig = 1 " Prevent plugin loading 104 | endif 105 | 106 | " Markdown 107 | let g:vim_markdown_folding_disabled=1 108 | autocmd FileType markdown set conceallevel=0 109 | 110 | " Mundo 111 | let g:mundo_prefer_python3 = 1 112 | 113 | " NERDCommenter 114 | let NERDCreateDefaultMappings = 0 115 | let NERDSpaceDelims = 1 116 | 117 | " NERDTree 118 | let NERDTreeShowHidden=1 119 | let NERDTreeRespectWildIgnore=1 120 | 121 | " Python mode syntax 122 | let g:pymode_syntax_all = 0 123 | let g:pymode_syntax_print_as_function = 1 124 | let g:pymode_syntax_string_format = 0 125 | let g:pymode_syntax_string_formatting = 0 126 | let g:pymode_syntax_string_templates = 0 127 | 128 | " Python PEP8 Indent 129 | let g:python_pep8_indent_hang_closing = 1 130 | 131 | " Ruby 132 | let g:ruby_indent_assignment_style = 'variable' 133 | let g:ruby_indent_block_style = 'do' 134 | let g:ruby_operators = 1 135 | let g:ruby_spellcheck_strings = 1 136 | 137 | " Signify 138 | let g:signify_update_on_focusgained = 1 139 | 140 | " Syntastic 141 | let g:syntastic_enable_signs=1 142 | let g:syntastic_javascript_jshint_args = '--config '.expand('~/.jshintrc') 143 | 144 | " TagList 145 | if filereadable("/usr/local/bin/ctags") 146 | let Tlist_Ctags_Cmd = "/usr/local/bin/ctags" 147 | endif 148 | 149 | " Which Key 150 | autocmd VimEnter * call which_key#register('', "g:which_key_map") 151 | -------------------------------------------------------------------------------- /lib/vim/config/settings.vim: -------------------------------------------------------------------------------- 1 | func s:fallback(value, fallback) 2 | if empty(a:value) 3 | return a:fallback 4 | else 5 | return a:value 6 | endif 7 | endfunc 8 | 9 | func s:xdg_path(name, child) 10 | if a:name ==# "cache" 11 | let l:path = s:fallback($XDG_CACHE_HOME, $HOME . "/.cache/vim") 12 | elseif a:name ==# "data" 13 | let l:path = s:fallback($XDG_DATA_HOME, $HOME . "/.local/share/vim") 14 | else 15 | throw "unknown XDG type" 16 | endif 17 | let l:path = l:path . a:child 18 | call mkdir(l:path, "p", 0700) 19 | return l:path 20 | endfunc 21 | 22 | let mapleader = "\" 23 | let maplocalleader = "," 24 | 25 | set backspace=indent,eol,start 26 | set cursorline 27 | set breakindent 28 | set hidden 29 | set laststatus=2 30 | set lazyredraw 31 | set mouse=a 32 | set nojoinspaces 33 | set nomodeline 34 | set nowrap 35 | set number 36 | set ruler 37 | set scrolloff=3 38 | set sidescrolloff=3 39 | set showcmd 40 | set showtabline=2 41 | set splitbelow splitright 42 | set timeoutlen=500 43 | set title 44 | set virtualedit=block 45 | set wildignorecase 46 | set wildmenu 47 | 48 | " Store backup & swap files elsewhere to avoid directory pollution 49 | execute "set backupdir=" . fnameescape(s:xdg_path("cache", "/backup")) 50 | execute "set directory=" . fnameescape(s:xdg_path("cache", "/swap")) 51 | execute "set undodir=" . fnameescape(s:xdg_path("data", "/undo")) 52 | 53 | " Search settings 54 | set ignorecase 55 | set incsearch 56 | set smartcase 57 | set hlsearch 58 | 59 | " Indentation settings (soft tabs, two spaces) 60 | set autoindent 61 | set expandtab 62 | set shiftwidth=2 63 | set smartindent 64 | set smarttab 65 | set tabstop=2 66 | set list listchars=extends:…,tab:»\ ,trail:· 67 | filetype plugin indent on 68 | 69 | " Persistent undo 70 | if(has("persistent_undo")) 71 | set undofile 72 | set undolevels=1000 73 | endif 74 | 75 | augroup CursorLine 76 | autocmd! 77 | autocmd ColorScheme * hi CursorLineNr cterm=NONE 78 | autocmd BufWinEnter,FocusGained,WinEnter * setlocal cursorline 79 | autocmd FocusLost,WinLeave * setlocal nocursorline 80 | augroup END 81 | 82 | if exists('$BASE16_THEME') && (!exists('g:colors_name') || g:colors_name != 'base16-' . $BASE16_THEME) 83 | let base16colorspace=256 84 | execute 'colorscheme base16-' . $BASE16_THEME 85 | elseif filereadable(expand("~/.vimrc_background")) 86 | let base16colorspace=256 87 | source ~/.vimrc_background 88 | endif 89 | 90 | " Highlight if there is color 91 | if(&t_Co > 2 || has("gui_running")) 92 | syntax on 93 | endif 94 | 95 | " Don't store global state in sessions 96 | set sessionoptions-=options 97 | -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarshall/dotfiles/8609de132f8a4f18e8f5667d8f01917354f94934/lib/vim/pack/user/opt/.keep -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/bundler: -------------------------------------------------------------------------------- 1 | ../../../bundle/bundler -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/fireplace: -------------------------------------------------------------------------------- 1 | ../../../bundle/fireplace -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/gdb-neovim: -------------------------------------------------------------------------------- 1 | ../../../bundle/gdb-neovim -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/intero-neovim: -------------------------------------------------------------------------------- 1 | ../../../bundle/intero-neovim -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/racer: -------------------------------------------------------------------------------- 1 | ../../../bundle/racer -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/rake: -------------------------------------------------------------------------------- 1 | ../../../bundle/rake -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/startuptime: -------------------------------------------------------------------------------- 1 | ../../../bundle/startuptime -------------------------------------------------------------------------------- /lib/vim/pack/user/opt/textobj-rubyblock: -------------------------------------------------------------------------------- 1 | ../../../bundle/textobj-rubyblock -------------------------------------------------------------------------------- /lib/vim/pack/user/start/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarshall/dotfiles/8609de132f8a4f18e8f5667d8f01917354f94934/lib/vim/pack/user/start/.keep -------------------------------------------------------------------------------- /lib/vim/pack/user/start/ZoomWin: -------------------------------------------------------------------------------- 1 | ../../../bundle/ZoomWin -------------------------------------------------------------------------------- /lib/vim/pack/user/start/abolish: -------------------------------------------------------------------------------- 1 | ../../../bundle/abolish -------------------------------------------------------------------------------- /lib/vim/pack/user/start/ack: -------------------------------------------------------------------------------- 1 | ../../../bundle/ack -------------------------------------------------------------------------------- /lib/vim/pack/user/start/alchemist: -------------------------------------------------------------------------------- 1 | ../../../bundle/alchemist -------------------------------------------------------------------------------- /lib/vim/pack/user/start/ale: -------------------------------------------------------------------------------- 1 | ../../../bundle/ale -------------------------------------------------------------------------------- /lib/vim/pack/user/start/applescript: -------------------------------------------------------------------------------- 1 | ../../../bundle/applescript -------------------------------------------------------------------------------- /lib/vim/pack/user/start/argtextobj: -------------------------------------------------------------------------------- 1 | ../../../bundle/argtextobj -------------------------------------------------------------------------------- /lib/vim/pack/user/start/base16: -------------------------------------------------------------------------------- 1 | ../../../bundle/base16 -------------------------------------------------------------------------------- /lib/vim/pack/user/start/beancount: -------------------------------------------------------------------------------- 1 | ../../../bundle/beancount -------------------------------------------------------------------------------- /lib/vim/pack/user/start/bitbake: -------------------------------------------------------------------------------- 1 | ../../../bundle/bitbake -------------------------------------------------------------------------------- /lib/vim/pack/user/start/blockle: -------------------------------------------------------------------------------- 1 | ../../../bundle/blockle -------------------------------------------------------------------------------- /lib/vim/pack/user/start/bundle: -------------------------------------------------------------------------------- 1 | ../../../bundle -------------------------------------------------------------------------------- /lib/vim/pack/user/start/camelcasemotion: -------------------------------------------------------------------------------- 1 | ../../../bundle/camelcasemotion -------------------------------------------------------------------------------- /lib/vim/pack/user/start/coffee-script: -------------------------------------------------------------------------------- 1 | ../../../bundle/coffee-script -------------------------------------------------------------------------------- /lib/vim/pack/user/start/cucumber: -------------------------------------------------------------------------------- 1 | ../../../bundle/cucumber -------------------------------------------------------------------------------- /lib/vim/pack/user/start/easymotion: -------------------------------------------------------------------------------- 1 | ../../../bundle/easymotion -------------------------------------------------------------------------------- /lib/vim/pack/user/start/easytags: -------------------------------------------------------------------------------- 1 | ../../../bundle/easytags -------------------------------------------------------------------------------- /lib/vim/pack/user/start/editorconfig: -------------------------------------------------------------------------------- 1 | ../../../bundle/editorconfig -------------------------------------------------------------------------------- /lib/vim/pack/user/start/elixir: -------------------------------------------------------------------------------- 1 | ../../../bundle/elixir -------------------------------------------------------------------------------- /lib/vim/pack/user/start/elm: -------------------------------------------------------------------------------- 1 | ../../../bundle/elm -------------------------------------------------------------------------------- /lib/vim/pack/user/start/endwise: -------------------------------------------------------------------------------- 1 | ../../../bundle/endwise -------------------------------------------------------------------------------- /lib/vim/pack/user/start/exchange: -------------------------------------------------------------------------------- 1 | ../../../bundle/exchange -------------------------------------------------------------------------------- /lib/vim/pack/user/start/fennel: -------------------------------------------------------------------------------- 1 | ../../../bundle/fennel -------------------------------------------------------------------------------- /lib/vim/pack/user/start/fugitive: -------------------------------------------------------------------------------- 1 | ../../../bundle/fugitive -------------------------------------------------------------------------------- /lib/vim/pack/user/start/fzf: -------------------------------------------------------------------------------- 1 | ../../../bundle/fzf -------------------------------------------------------------------------------- /lib/vim/pack/user/start/glsl: -------------------------------------------------------------------------------- 1 | ../../../bundle/glsl -------------------------------------------------------------------------------- /lib/vim/pack/user/start/haml: -------------------------------------------------------------------------------- 1 | ../../../bundle/haml -------------------------------------------------------------------------------- /lib/vim/pack/user/start/haskell: -------------------------------------------------------------------------------- 1 | ../../../bundle/haskell -------------------------------------------------------------------------------- /lib/vim/pack/user/start/hcl: -------------------------------------------------------------------------------- 1 | ../../../bundle/hcl -------------------------------------------------------------------------------- /lib/vim/pack/user/start/hy: -------------------------------------------------------------------------------- 1 | ../../../bundle/hy -------------------------------------------------------------------------------- /lib/vim/pack/user/start/idris: -------------------------------------------------------------------------------- 1 | ../../../bundle/idris -------------------------------------------------------------------------------- /lib/vim/pack/user/start/indent-guides: -------------------------------------------------------------------------------- 1 | ../../../bundle/indent-guides -------------------------------------------------------------------------------- /lib/vim/pack/user/start/indent-object: -------------------------------------------------------------------------------- 1 | ../../../bundle/indent-object -------------------------------------------------------------------------------- /lib/vim/pack/user/start/indentLine: -------------------------------------------------------------------------------- 1 | ../../../bundle/indentLine -------------------------------------------------------------------------------- /lib/vim/pack/user/start/indentwise: -------------------------------------------------------------------------------- 1 | ../../../bundle/indentwise -------------------------------------------------------------------------------- /lib/vim/pack/user/start/indexed-search: -------------------------------------------------------------------------------- 1 | ../../../bundle/indexed-search -------------------------------------------------------------------------------- /lib/vim/pack/user/start/janet: -------------------------------------------------------------------------------- 1 | ../../../bundle/janet -------------------------------------------------------------------------------- /lib/vim/pack/user/start/javascript: -------------------------------------------------------------------------------- 1 | ../../../bundle/javascript -------------------------------------------------------------------------------- /lib/vim/pack/user/start/jinja2: -------------------------------------------------------------------------------- 1 | ../../../bundle/jinja2 -------------------------------------------------------------------------------- /lib/vim/pack/user/start/json: -------------------------------------------------------------------------------- 1 | ../../../bundle/json -------------------------------------------------------------------------------- /lib/vim/pack/user/start/jsonnet: -------------------------------------------------------------------------------- 1 | ../../../bundle/jsonnet -------------------------------------------------------------------------------- /lib/vim/pack/user/start/jsx: -------------------------------------------------------------------------------- 1 | ../../../bundle/jsx -------------------------------------------------------------------------------- /lib/vim/pack/user/start/julia: -------------------------------------------------------------------------------- 1 | ../../../bundle/julia -------------------------------------------------------------------------------- /lib/vim/pack/user/start/l9: -------------------------------------------------------------------------------- 1 | ../../../bundle/l9 -------------------------------------------------------------------------------- /lib/vim/pack/user/start/lkml: -------------------------------------------------------------------------------- 1 | ../../../bundle/lkml -------------------------------------------------------------------------------- /lib/vim/pack/user/start/matchit: -------------------------------------------------------------------------------- 1 | ../../../bundle/matchit -------------------------------------------------------------------------------- /lib/vim/pack/user/start/misc: -------------------------------------------------------------------------------- 1 | ../../../bundle/misc -------------------------------------------------------------------------------- /lib/vim/pack/user/start/mundo: -------------------------------------------------------------------------------- 1 | ../../../bundle/mundo -------------------------------------------------------------------------------- /lib/vim/pack/user/start/mustache: -------------------------------------------------------------------------------- 1 | ../../../bundle/mustache -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nerdcommenter: -------------------------------------------------------------------------------- 1 | ../../../bundle/nerdcommenter -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nerdtree: -------------------------------------------------------------------------------- 1 | ../../../bundle/nerdtree -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nftables: -------------------------------------------------------------------------------- 1 | ../../../bundle/nftables -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nginx: -------------------------------------------------------------------------------- 1 | ../../../bundle/nginx -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nix: -------------------------------------------------------------------------------- 1 | ../../../bundle/nix -------------------------------------------------------------------------------- /lib/vim/pack/user/start/nvim-lspconfig: -------------------------------------------------------------------------------- 1 | ../../../bundle/nvim-lspconfig -------------------------------------------------------------------------------- /lib/vim/pack/user/start/pandoc: -------------------------------------------------------------------------------- 1 | ../../../bundle/pandoc -------------------------------------------------------------------------------- /lib/vim/pack/user/start/pandoc-syntax: -------------------------------------------------------------------------------- 1 | ../../../bundle/pandoc-syntax -------------------------------------------------------------------------------- /lib/vim/pack/user/start/parinfer-rust: -------------------------------------------------------------------------------- 1 | ../../../bundle/parinfer-rust -------------------------------------------------------------------------------- /lib/vim/pack/user/start/pest: -------------------------------------------------------------------------------- 1 | ../../../bundle/pest -------------------------------------------------------------------------------- /lib/vim/pack/user/start/projectionist: -------------------------------------------------------------------------------- 1 | ../../../bundle/projectionist -------------------------------------------------------------------------------- /lib/vim/pack/user/start/prolog: -------------------------------------------------------------------------------- 1 | ../../../bundle/prolog -------------------------------------------------------------------------------- /lib/vim/pack/user/start/ps1: -------------------------------------------------------------------------------- 1 | ../../../bundle/ps1 -------------------------------------------------------------------------------- /lib/vim/pack/user/start/puppet: -------------------------------------------------------------------------------- 1 | ../../../bundle/puppet -------------------------------------------------------------------------------- /lib/vim/pack/user/start/python-mode: -------------------------------------------------------------------------------- 1 | ../../../bundle/python-mode -------------------------------------------------------------------------------- /lib/vim/pack/user/start/python-pep8-indent: -------------------------------------------------------------------------------- 1 | ../../../bundle/python-pep8-indent -------------------------------------------------------------------------------- /lib/vim/pack/user/start/racket: -------------------------------------------------------------------------------- 1 | ../../../bundle/racket -------------------------------------------------------------------------------- /lib/vim/pack/user/start/rails: -------------------------------------------------------------------------------- 1 | ../../../bundle/rails -------------------------------------------------------------------------------- /lib/vim/pack/user/start/rainbow_parentheses: -------------------------------------------------------------------------------- 1 | ../../../bundle/rainbow_parentheses -------------------------------------------------------------------------------- /lib/vim/pack/user/start/regreplop: -------------------------------------------------------------------------------- 1 | ../../../bundle/regreplop -------------------------------------------------------------------------------- /lib/vim/pack/user/start/repeat: -------------------------------------------------------------------------------- 1 | ../../../bundle/repeat -------------------------------------------------------------------------------- /lib/vim/pack/user/start/ruby: -------------------------------------------------------------------------------- 1 | ../../../bundle/ruby -------------------------------------------------------------------------------- /lib/vim/pack/user/start/rust: -------------------------------------------------------------------------------- 1 | ../../../bundle/rust -------------------------------------------------------------------------------- /lib/vim/pack/user/start/scala: -------------------------------------------------------------------------------- 1 | ../../../bundle/scala -------------------------------------------------------------------------------- /lib/vim/pack/user/start/signify: -------------------------------------------------------------------------------- 1 | ../../../bundle/signify -------------------------------------------------------------------------------- /lib/vim/pack/user/start/snipMate: -------------------------------------------------------------------------------- 1 | ../../../bundle/snipMate -------------------------------------------------------------------------------- /lib/vim/pack/user/start/speeddating: -------------------------------------------------------------------------------- 1 | ../../../bundle/speeddating -------------------------------------------------------------------------------- /lib/vim/pack/user/start/splitjoin: -------------------------------------------------------------------------------- 1 | ../../../bundle/splitjoin -------------------------------------------------------------------------------- /lib/vim/pack/user/start/supertab: -------------------------------------------------------------------------------- 1 | ../../../bundle/supertab -------------------------------------------------------------------------------- /lib/vim/pack/user/start/surround: -------------------------------------------------------------------------------- 1 | ../../../bundle/surround -------------------------------------------------------------------------------- /lib/vim/pack/user/start/swift: -------------------------------------------------------------------------------- 1 | ../../../bundle/swift -------------------------------------------------------------------------------- /lib/vim/pack/user/start/tabular: -------------------------------------------------------------------------------- 1 | ../../../bundle/tabular -------------------------------------------------------------------------------- /lib/vim/pack/user/start/tagbar: -------------------------------------------------------------------------------- 1 | ../../../bundle/tagbar -------------------------------------------------------------------------------- /lib/vim/pack/user/start/terraform: -------------------------------------------------------------------------------- 1 | ../../../bundle/terraform -------------------------------------------------------------------------------- /lib/vim/pack/user/start/textobj-user: -------------------------------------------------------------------------------- 1 | ../../../bundle/textobj-user -------------------------------------------------------------------------------- /lib/vim/pack/user/start/tmux-focus-events: -------------------------------------------------------------------------------- 1 | ../../../bundle/tmux-focus-events -------------------------------------------------------------------------------- /lib/vim/pack/user/start/toml: -------------------------------------------------------------------------------- 1 | ../../../bundle/toml -------------------------------------------------------------------------------- /lib/vim/pack/user/start/tslime: -------------------------------------------------------------------------------- 1 | ../../../bundle/tslime -------------------------------------------------------------------------------- /lib/vim/pack/user/start/typescript: -------------------------------------------------------------------------------- 1 | ../../../bundle/typescript -------------------------------------------------------------------------------- /lib/vim/pack/user/start/unimpaired: -------------------------------------------------------------------------------- 1 | ../../../bundle/unimpaired -------------------------------------------------------------------------------- /lib/vim/pack/user/start/vis: -------------------------------------------------------------------------------- 1 | ../../../bundle/vis -------------------------------------------------------------------------------- /lib/vim/pack/user/start/which-key: -------------------------------------------------------------------------------- 1 | ../../../bundle/which-key -------------------------------------------------------------------------------- /lib/vim/pack/user/start/yats: -------------------------------------------------------------------------------- 1 | ../../../bundle/yats -------------------------------------------------------------------------------- /lib/vim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | pragma 2 | pragmas 3 | inline 4 | -------------------------------------------------------------------------------- /lib/vim/spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarshall/dotfiles/8609de132f8a4f18e8f5667d8f01917354f94934/lib/vim/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /lib/zsh/env.zsh: -------------------------------------------------------------------------------- 1 | if [[ "$(uname)" == Darwin ]] && [[ -x /usr/libexec/path_helper ]]; then 2 | eval "$(/usr/libexec/path_helper)" 3 | fi 4 | 5 | source ~/.config/dotfiles/shell/env.zsh 6 | 7 | fpath=(~/.config/dotfiles/zsh/functions /usr/local/share/zsh-completions $fpath) 8 | autoload -U ~/.config/dotfiles/zsh/functions/*(:t) 9 | 10 | for dir in ~/.config/dotfiles/zsh/plugins/*; do 11 | if [[ -f "$dir/env.zsh" ]]; then 12 | source "$dir/env.zsh" 13 | fi 14 | done 15 | -------------------------------------------------------------------------------- /lib/zsh/functions/_c: -------------------------------------------------------------------------------- 1 | #compdef c 2 | dirs=(~/Code/*) 3 | _files -W dirs -/ 4 | -------------------------------------------------------------------------------- /lib/zsh/functions/_gem: -------------------------------------------------------------------------------- 1 | #compdef gem 2 | #autoload 3 | 4 | # gem zsh completion, based on homebrew completion 5 | 6 | _gem_installed() { 7 | installed_gems=(`gem list --local --no-versions`) 8 | } 9 | 10 | local -a _1st_arguments 11 | _1st_arguments=( 12 | 'cert:Manage RubyGems certificates and signing settings' 13 | 'check:Check installed gems' 14 | 'cleanup:Clean up old versions of installed gems in the local repository' 15 | 'contents:Display the contents of the installed gems' 16 | 'dependency:Show the dependencies of an installed gem' 17 | 'environment:Display information about the RubyGems environment' 18 | 'fetch:Download a gem and place it in the current directory' 19 | 'generate_index:Generates the index files for a gem server directory' 20 | 'help:Provide help on the `gem` command' 21 | 'install:Install a gem into the local repository' 22 | 'list:Display gems whose name starts with STRING' 23 | 'lock:Generate a lockdown list of gems' 24 | 'mirror:Mirror a gem repository' 25 | 'outdated:Display all gems that need updates' 26 | 'owner:Manage gem owners on RubyGems.org.' 27 | 'pristine:Restores installed gems to pristine condition from files located in the gem cache' 28 | 'push:Push a gem up to RubyGems.org' 29 | 'query:Query gem information in local or remote repositories' 30 | 'rdoc:Generates RDoc for pre-installed gems' 31 | 'search:Display all gems whose name contains STRING' 32 | 'server:Documentation and gem repository HTTP server' 33 | 'sources:Manage the sources and cache file RubyGems uses to search for gems' 34 | 'specification:Display gem specification (in yaml)' 35 | 'stale:List gems along with access times' 36 | 'uninstall:Uninstall gems from the local repository' 37 | 'unpack:Unpack an installed gem to the current directory' 38 | 'update:Update the named gems (or all installed gems) in the local repository' 39 | 'which:Find the location of a library file you can require' 40 | ) 41 | 42 | local expl 43 | local -a gems installed_gems 44 | 45 | _arguments \ 46 | '(-v --version)'{-v,--version}'[show version]' \ 47 | '(-h --help)'{-h,--help}'[show help]' \ 48 | '*:: :->subcmds' && return 0 49 | 50 | if (( CURRENT == 1 )); then 51 | _describe -t commands "gem subcommand" _1st_arguments 52 | return 53 | fi 54 | 55 | case "$words[1]" in 56 | list) 57 | if [[ "$state" == forms ]]; then 58 | _gem_installed 59 | _requested installed_gems expl 'installed gems' compadd -a installed_gems 60 | fi ;; 61 | uninstall|update) 62 | _gem_installed 63 | _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;; 64 | esac 65 | -------------------------------------------------------------------------------- /lib/zsh/functions/_git-unite: -------------------------------------------------------------------------------- 1 | #compdef 2 | _git-merge "$@" 3 | -------------------------------------------------------------------------------- /lib/zsh/functions/_git_unite: -------------------------------------------------------------------------------- 1 | #compdef 2 | _git_merge "$@" 3 | -------------------------------------------------------------------------------- /lib/zsh/functions/_h: -------------------------------------------------------------------------------- 1 | #compdef h 2 | _files -W ~ -/ 3 | -------------------------------------------------------------------------------- /lib/zsh/functions/_npm: -------------------------------------------------------------------------------- 1 | #compdef npm 2 | 3 | # Node Package Manager 0.3.15 completion, letting npm do all the completion work 4 | 5 | _npm() { 6 | compadd -- $(_npm_complete $words) 7 | } 8 | 9 | # We want to show all errors of any substance, but never the "npm (not )ok" one. 10 | # (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) 11 | _npm_complete() { 12 | local ask_npm 13 | ask_npm=(npm completion --color false --loglevel error -- $@) 14 | { _call_program npm $ask_npm 2>&1 >&3 \ 15 | | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ 16 | } 3>&1 17 | } 18 | 19 | _npm "$@" 20 | -------------------------------------------------------------------------------- /lib/zsh/functions/_pip: -------------------------------------------------------------------------------- 1 | #compdef pip 2 | #autoload 3 | 4 | # pip zsh completion, based on homebrew completion 5 | 6 | _pip_installed() { 7 | installed_pkgs=(`pip freeze`) 8 | } 9 | 10 | local -a _1st_arguments 11 | _1st_arguments=( 12 | 'bundle:Create pybundles (archives containing multiple packages)' 13 | 'freeze:Output all currently installed packages (exact versions) to stdout' 14 | 'help:Show available commands' 15 | 'install:Install packages' 16 | 'search:Search PyPI' 17 | 'uninstall:Uninstall packages' 18 | 'unzip:Unzip individual packages' 19 | 'zip:Zip individual packages' 20 | ) 21 | 22 | local expl 23 | local -a pkgs installed_pkgs 24 | 25 | _arguments \ 26 | '(--version)--version[Show version number of program and exit]' \ 27 | '(-v --verbose)'{-v,--verbose}'[Give more output]' \ 28 | '(-q --quiet)'{-q,--quiet}'[Give less output]' \ 29 | '(-h --help)'{-h,--help}'[Show help]' \ 30 | '*:: :->subcmds' && return 0 31 | 32 | if (( CURRENT == 1 )); then 33 | _describe -t commands "pip subcommand" _1st_arguments 34 | return 35 | fi 36 | 37 | case "$words[1]" in 38 | list) 39 | if [[ "$state" == forms ]]; then 40 | _pip_installed 41 | _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs 42 | fi ;; 43 | uninstall) 44 | _pip_installed 45 | _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;; 46 | esac 47 | -------------------------------------------------------------------------------- /lib/zsh/functions/_redis-cli: -------------------------------------------------------------------------------- 1 | #compdef redis-cli rec 2 | #autoload 3 | 4 | #redis cli completion, based off homebrew completion (ref. 2011-04-14) 5 | 6 | local -a _1st_arguments 7 | _1st_arguments=( 8 | 'append:append a value to a key' 9 | 'auth:authenticate to the server' 10 | 'bgrewriteeaof:asynchronously rewrite the append-only file' 11 | 'bgsave:asynchornously save the dataset to disk' 12 | 'blpop:remove and get the first element in a list, or block until one is available' 13 | 'brpop:remove and get the last element in a list, or block until one is available' 14 | 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available' 15 | # 'config get:get the value of a configuration parameter' 16 | # 'config set:set a configuration parameter to the given value' 17 | # 'config resetstat: reset the stats returned by INFO' 18 | 'dbsize:return the number of keys in the selected database' 19 | # 'debug object:get debugging information about a key' 20 | # 'debug setgfault:make the server crash' 21 | 'decr:decrement the integer value of a key by one' 22 | 'decrby:decrement the integet value of a key by the given number' 23 | 'del:delete a key' 24 | 'discard:discard all commands issued after MULTI' 25 | 'echo:echo the given string' 26 | 'exec:execute all commands issued after a MULTI' 27 | 'exists:determine if a key exists' 28 | 'expire:set the time to live for a key, in seconds' 29 | 'expireat:set the expiration for a key as a UNIX timestamp' 30 | 'flushall:remove all keys from all databases' 31 | 'flushdb:remove all keys from the current database' 32 | 'get:get the value of a key' 33 | 'getbit:returns the bit value at offset in the string value stored at key' 34 | 'getrange:get a substring of the string stored at a key' 35 | 'getset:set the string value of a key and return its old value' 36 | 'hdel:delete a hash field' 37 | 'hexists:determine if a hash field exists' 38 | 'hget:get the value of a hash field' 39 | 'hgetall:get all the fields and values in a hash' 40 | 'hincrby:increment the integer value of a hash field by the given number' 41 | 'hkeys:get all the fields in a hash' 42 | 'hlen:get the number of fields in a hash' 43 | 'hmget:get the values of all the given hash fields' 44 | 'hmset:set multiple hash fields to multiple values' 45 | 'hset:set the string value of a hash field' 46 | 'hsetnx:set the value of a hash field, only if the field does not exist' 47 | 'hvals:get all the values in a hash' 48 | 'incr:increment the integer value of a key by one' 49 | 'incrby:increment the integer value of a key by the given number' 50 | 'info:get information and statistics about the server' 51 | 'keys:find all keys matching the given pattern' 52 | 'lastsave:get the UNIX timestamp of the last successful save to disk' 53 | 'lindex:get an element from a list by its index' 54 | 'linset:insert an element before or after another element in a list' 55 | 'llen:get the length of a list' 56 | 'lpop:remove and get the first element in a list' 57 | 'lpush:prepend a value to a list' 58 | 'lpushx:prepend a value to a list, only if the list exists' 59 | 'lrange:get a range of elements from a list' 60 | 'lrem:remove elements from a list' 61 | 'lset:set the value of an element in a list by its index' 62 | 'ltrim:trim a list to the specified range' 63 | 'mget:get the values of all the given keys' 64 | 'monitor:listen for all requests received by the server in real time' 65 | 'move:move a key to another database' 66 | 'mset:set multiple keys to muliple values' 67 | 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist' 68 | 'multi:mark the start of a transaction block' 69 | 'object:inspect the internals of Redis objects' 70 | 'persist:remove the expiration from a key' 71 | 'ping:ping the server' 72 | 'psubscribe:listen for messages published to channels matching the given patterns' 73 | 'publish:post a message to a channel' 74 | 'punsubscribe:stop listening for messages posted to channels matching the given patterns' 75 | 'quit:close the connection' 76 | 'randomkey:return a random key from the keyspace' 77 | 'rename:rename a key' 78 | 'renamenx:rename a key, only if the new key does not exist' 79 | 'rpop:remove and get the last element in a list' 80 | 'rpoplpush:remove the last element in a list, append it to another list and return it' 81 | 'rpush:append a value to a list' 82 | 'rpushx:append a value to a list, only if the list exists' 83 | 'sadd:add a member to a set' 84 | 'save:synchronously save the dataset to disk' 85 | 'scard:get the number of members in a set' 86 | 'sdiff:subtract multiple sets' 87 | 'sdiffstore:subtract multiple sets and store the resulting set in a key' 88 | 'select:change the selected database for the current connection' 89 | 'set:set the string value of a key' 90 | 'setbit:sets or clears the bit at offset in the string value stored at key' 91 | 'setex:set the value and expiration of a key' 92 | 'setnx:set the value of a key, only if the key does not exist' 93 | 'setrange:overwrite part of a string at key starting at the specified offset' 94 | 'shutdown:synchronously save the dataset to disk and then shut down the server' 95 | 'sinter:intersect multiple sets' 96 | 'sinterstore:intersect multiple sets and store the resulting set in a key' 97 | 'sismember:determine if a given value is a member of a set' 98 | 'slaveof:make the server a slave of another instance, or promote it as master' 99 | 'smembers:get all the members in a set' 100 | 'smove:move a member from one set to another' 101 | 'sort:sort the elements in a list, set or sorted set' 102 | 'spop:remove and return a random member from a set' 103 | 'srandmember:get a random member from a set' 104 | 'srem:remove a member from a set' 105 | 'strlen:get the length of the value stored in a key' 106 | 'subscribe:listen for messages published to the given channels' 107 | 'sunion:add multiple sets' 108 | 'sunionstore:add multiple sets and store the resulting set in a key' 109 | 'ttl:get the time to live for a key' 110 | 'type:determine the type stored at key' 111 | 'unsubscribe:stop listening for messages posted to the given channels' 112 | 'unwatch:forget about all watched keys' 113 | 'watch:watch the given keys to determine execution of the MULTI/EXEC block' 114 | 'zadd:add a member to a sorted set, or update its score if it already exists' 115 | 'zcard:get the number of members in a sorted set' 116 | 'zcount:count the members in a sorted set with scores within the given values' 117 | 'zincrby:increment the score of a member in a sorted set' 118 | 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key' 119 | 'zrange:return a range of members in a sorted set, by index' 120 | 'zrangebyscore:return a range of members in a sorted set, by score' 121 | 'zrank:determine the index of a member in a sorted set' 122 | 'zrem:remove a member from a sorted set' 123 | 'zremrangebyrank:remove all members in a sorted set within the given indexes' 124 | 'zremrangebyscore:remove all members in a sorted set within the given scores' 125 | 'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low' 126 | 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low' 127 | 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low' 128 | 'zscore:get the score associated with the given member in a sorted set' 129 | 'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key' 130 | ) 131 | 132 | local expl 133 | 134 | _arguments \ 135 | '(-v --version)'{-v,--version}'[show version]' \ 136 | '(-h --help)'{-h,--help}'[show help]' \ 137 | '*:: :->subcmds' && return 0 138 | 139 | if (( CURRENT == 1 )); then 140 | _describe -t commands "redis-cli subcommand" _1st_arguments 141 | return 142 | fi 143 | -------------------------------------------------------------------------------- /lib/zsh/interactive.zsh: -------------------------------------------------------------------------------- 1 | source ~/.config/dotfiles/shell/interactive.zsh 2 | source ~/.config/dotfiles/zsh/lib/aliases.zsh 3 | source ~/.config/dotfiles/zsh/lib/config.zsh 4 | source ~/.config/dotfiles/zsh/lib/completions.zsh 5 | 6 | for dir in ~/.config/dotfiles/zsh/plugins/*; do 7 | if [[ -f "$dir/interactive.zsh" ]]; then 8 | source "$dir/interactive.zsh" 9 | fi 10 | done 11 | 12 | source ~/.config/dotfiles/zsh/lib/prompt.zsh 13 | -------------------------------------------------------------------------------- /lib/zsh/lib/aliases.zsh: -------------------------------------------------------------------------------- 1 | alias importhistory="fc -RI" 2 | alias history="history 1" 3 | alias reloadzsh="source ~/.zshrc" 4 | -------------------------------------------------------------------------------- /lib/zsh/lib/completions.zsh: -------------------------------------------------------------------------------- 1 | autoload -Uz compinit 2 | compinit 3 | 4 | # Matches case insensitive for lowercase 5 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 6 | 7 | # Pasting with tabs doesn't perform completion 8 | zstyle ':completion:*' insert-tab pending 9 | 10 | function verbose_completion() { 11 | zstyle ':completion:*' verbose yes 12 | zstyle ':completion:*:descriptions' format '%B%d%b' 13 | zstyle ':completion:*:messages' format '%d' 14 | zstyle ':completion:*:warnings' format 'No matches for: %d' 15 | zstyle ':completion:*' group-name '' 16 | } 17 | 18 | # For Ubuntu. Requires the "command-not-found" package be installed. 19 | [[ -f /etc/zsh_command_not_found ]] && . /etc/zsh_command_not_found 20 | -------------------------------------------------------------------------------- /lib/zsh/lib/config.zsh: -------------------------------------------------------------------------------- 1 | HISTFILE=${XDG_DATA_HOME:-~/.local/share}/zsh/history 2 | HISTSIZE=10000 3 | SAVEHIST=$HISTSIZE 4 | WORDCHARS="${WORDCHARS//[=\/]}|" 5 | REPORTTIME=10 # Print elapsed time when more than 10 seconds 6 | 7 | mkdir -p "$(dirname "$HISTFILE")" 8 | 9 | setopt AUTO_PUSHD 10 | setopt COMPLETE_IN_WORD 11 | setopt CORRECT 12 | setopt EXTENDED_HISTORY # Add timestamps to history 13 | setopt EXTENDEDGLOB 14 | setopt HASH_LIST_ALL 15 | setopt HIST_IGNORE_ALL_DUPS 16 | setopt HIST_REDUCE_BLANKS 17 | setopt HIST_VERIFY 18 | setopt IGNORE_EOF 19 | setopt INC_APPEND_HISTORY 20 | setopt LOCAL_OPTIONS 21 | setopt LOCAL_TRAPS 22 | setopt NO_BG_NICE 23 | setopt NO_HUP 24 | setopt NOTIFY 25 | setopt PRINT_EXIT_VALUE 26 | setopt PROMPT_SUBST 27 | setopt PUSHD_IGNORE_DUPS 28 | setopt PUSHD_SILENT 29 | 30 | autoload -U edit-command-line 31 | zle -N edit-command-line 32 | zle -N newtab 33 | 34 | run-last-command() { zle up-history; zle accept-line } 35 | foreground-current-job() { fg } 36 | kill-current-job() { kill %% } 37 | zle -N run-last-command 38 | zle -N foreground-current-job 39 | zle -N kill-current-job 40 | 41 | bindkey -e 42 | bindkey '\e[3~' delete-char 43 | bindkey '^b' backward-word 44 | bindkey '^f' forward-word 45 | bindkey '^a' beginning-of-line 46 | bindkey '^e' end-of-line 47 | bindkey '^r' history-incremental-search-backward 48 | bindkey '^x^x' kill-current-job 49 | bindkey '^x^e' edit-command-line 50 | bindkey '^p' run-last-command 51 | bindkey '^z' foreground-current-job 52 | -------------------------------------------------------------------------------- /lib/zsh/lib/prompt.zsh: -------------------------------------------------------------------------------- 1 | function __git_prompt() { 2 | local g="$(git rev-parse --git-dir 2>/dev/null)" 3 | if [ -n "$g" ]; then 4 | local r 5 | local b 6 | if [ -d "$g/../.dotest" ] 7 | then 8 | if test -f "$g/../.dotest/rebasing" 9 | then 10 | r="|REBASE" 11 | elif test -f "$g/../.dotest/applying" 12 | then 13 | r="|AM" 14 | else 15 | r="|AM/REBASE" 16 | fi 17 | b="$(git symbolic-ref HEAD 2>/dev/null)" 18 | elif [ -f "$g/.dotest-merge/interactive" ] 19 | then 20 | r="|REBASE-i" 21 | b="$(cat "$g/.dotest-merge/head-name")" 22 | elif [ -d "$g/.dotest-merge" ] 23 | then 24 | r="|REBASE-m" 25 | b="$(cat "$g/.dotest-merge/head-name")" 26 | elif [ -f "$g/MERGE_HEAD" ] 27 | then 28 | r="|MERGING" 29 | b="$(git symbolic-ref HEAD 2>/dev/null)" 30 | else 31 | if [ -f "$g/BISECT_LOG" ] 32 | then 33 | r="|BISECTING" 34 | fi 35 | if ! b="$(git symbolic-ref HEAD 2>/dev/null)" 36 | then 37 | if ! b="tag: $(git describe --exact-match --tags HEAD 2>/dev/null)" 38 | then 39 | b="$(cut -c1-7 "$g/HEAD")..." 40 | fi 41 | fi 42 | fi 43 | 44 | if [ -n "$1" ]; then 45 | printf "$1" "${b##refs/heads/}$r" 46 | else 47 | printf "[%s]" "${b##refs/heads/}$r" 48 | fi 49 | fi 50 | } 51 | 52 | function __shorten_path() { 53 | local fullpath=${1} 54 | local maxlen=$2 # Note that maxlen will not be strictly adhered to since the 55 | # last dir in the path will never be shortened. 56 | 57 | local len=${#fullpath} 58 | local parts 59 | local result 60 | 61 | fullpath=$(echo $fullpath | sed "s@^$HOME@~@" | sed "s@^$(realpath "$HOME")@~@") 62 | 63 | if [ $len -gt $maxlen ]; then 64 | parts=("${(s@/@)fullpath}") 65 | 66 | for i in {1..$(((${#parts[@]} - 1)))}; do 67 | if [ $len -le $maxlen ]; then break; fi 68 | local part=$parts[$i] 69 | len=$((($len - ${#part}))) 70 | parts[$i]=$part[0,1] 71 | done 72 | 73 | IFS='/' result=${parts[*]} 74 | else 75 | result=$fullpath 76 | fi 77 | 78 | echo $result 79 | } 80 | 81 | function __prompt() { 82 | local colon 83 | local git 84 | local hostname 85 | local curpath 86 | local username 87 | local jailname 88 | local nixshell 89 | local color_dir='%{%F{cyan}%}' 90 | local color_git='%{%b%F{yellow}%}' 91 | local color_jail='%{%F{8}%}' 92 | local color_none='%{%b%f%}' 93 | local color_prompt='%{%B%F{red}%}' 94 | local color_user_host='%{%F{magenta}%}' 95 | local maxpathlen=40 # max length of curpath (in characters) 96 | local usernames="${DOTFILES_USERNAMES:-amarshall,andrew.marshall}" 97 | 98 | [[ -n $JAIL_NAME ]] && jailname=$(printf '⟦JAIL: %s⟧ ' $JAIL_NAME) 99 | [[ -n $IN_NIX_SHELL ]] && nixshell=$(printf '⟦NIX: %s⟧ ' $IN_NIX_SHELL) 100 | echo "$usernames" | grep --extended-regexp --quiet "(^|,)$USERNAME(,|$)" || username='%n' # Don't display user if it's my own 101 | [[ -n $SSH_CONNECTION ]] && hostname=$hostname'@%m' # If running locally, we probably know what machine it is 102 | # always display "@" so host is not mistaken for username 103 | ([ -n "$username" ] || [ -n "$hostname" ]) && colon=':' # Don't separate if nothing to separate 104 | [[ $HOME != $(pwd) ]] && curpath=$(__shorten_path "$(pwd)" $maxpathlen) # Don't display the path if we're home 105 | git=$(__git_prompt) # Display information about current git repo 106 | 107 | case "$1" in 108 | prompt) 109 | printf "%s" $color_jail$nixshell$jailname$color_user_host$username$hostname $color_none$colon $color_dir$curpath $color_git$git $color_prompt'%(!.#.⦆)'$color_none' ' 110 | ;; 111 | title) 112 | print -Pn "\e]0;" $username$hostname$colon "%~\a" 113 | ;; 114 | esac 115 | } 116 | 117 | function __precmd_title() { 118 | __prompt title 119 | } 120 | 121 | precmd_functions=(__precmd_title $precmd_functions) 122 | PROMPT='$(__prompt prompt)' 123 | RPROMPT='' 124 | -------------------------------------------------------------------------------- /lib/zsh/plugins/_core/interactive.zsh: -------------------------------------------------------------------------------- 1 | unalias run-help 2 | autoload run-help 3 | -------------------------------------------------------------------------------- /lib/zsh/plugins/command-not-found/interactive.zsh: -------------------------------------------------------------------------------- 1 | [[ -f /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found 2 | -------------------------------------------------------------------------------- /lib/zsh/plugins/fzf/interactive.zsh: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/junegunn/fzf/blob/0.17.5/shell/key-bindings.zsh 2 | 3 | # Key bindings 4 | # ------------ 5 | if [[ $- == *i* ]]; then 6 | 7 | # CTRL-T - Paste the selected file path(s) into the command line 8 | __fsel() { 9 | local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ 10 | -o -type f -print \ 11 | -o -type d -print \ 12 | -o -type l -print 2> /dev/null | cut -b3-"}" 13 | setopt localoptions pipefail 2> /dev/null 14 | eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do 15 | echo -n "${(q)item} " 16 | done 17 | local ret=$? 18 | echo 19 | return $ret 20 | } 21 | 22 | __fzf_use_tmux__() { 23 | [ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] 24 | } 25 | 26 | __fzfcmd() { 27 | __fzf_use_tmux__ && 28 | echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" 29 | } 30 | 31 | fzf-file-widget() { 32 | LBUFFER="${LBUFFER}$(__fsel)" 33 | local ret=$? 34 | zle reset-prompt 35 | return $ret 36 | } 37 | zle -N fzf-file-widget 38 | bindkey '^J' fzf-file-widget 39 | 40 | # Ensure precmds are run after cd 41 | fzf-redraw-prompt() { 42 | local precmd 43 | for precmd in $precmd_functions; do 44 | $precmd 45 | done 46 | zle reset-prompt 47 | } 48 | zle -N fzf-redraw-prompt 49 | 50 | # ALT-C - cd into the selected directory 51 | fzf-cd-widget() { 52 | local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ 53 | -o -type d -print 2> /dev/null | cut -b3-"}" 54 | setopt localoptions pipefail 2> /dev/null 55 | local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)" 56 | if [[ -z "$dir" ]]; then 57 | zle redisplay 58 | return 0 59 | fi 60 | cd "$dir" 61 | local ret=$? 62 | zle fzf-redraw-prompt 63 | return $ret 64 | } 65 | zle -N fzf-cd-widget 66 | # bindkey '^H' fzf-cd-widget 67 | 68 | # CTRL-R - Paste the selected command from history into the command line 69 | fzf-history-widget() { 70 | local selected num 71 | setopt localoptions noglobsubst noposixbuiltins pipefail 2> /dev/null 72 | selected=( $(fc -rl 1 | 73 | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS --nth=2.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) 74 | local ret=$? 75 | if [ -n "$selected" ]; then 76 | num=$selected[1] 77 | if [ -n "$num" ]; then 78 | zle vi-fetch-history -n $num 79 | fi 80 | fi 81 | zle reset-prompt 82 | return $ret 83 | } 84 | zle -N fzf-history-widget 85 | bindkey '^R' fzf-history-widget 86 | 87 | fi 88 | -------------------------------------------------------------------------------- /lib/zsh/profile.zsh: -------------------------------------------------------------------------------- 1 | source ~/.config/dotfiles/shell/profile.zsh 2 | 3 | for dir in ~/.config/dotfiles/zsh/plugins/*; do 4 | if [[ -f "$dir/profile.zsh" ]]; then 5 | source "$dir/profile.zsh" 6 | fi 7 | done 8 | --------------------------------------------------------------------------------