├── .gitconfig ├── .gitignore ├── README.md ├── alacritty.toml ├── asdfrc ├── config.fish ├── gpg-agent.conf ├── init.lua ├── ripgreprc ├── stylua.toml └── tmux.conf /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Sidney Liebrand 3 | email = sidneyliebrand@gmail.com 4 | signingkey = 57621E845F2B6000 5 | [core] 6 | editor = nvim 7 | excludesfile = ~/.gitignore 8 | [push] 9 | default = current 10 | followTags = true 11 | [commit] 12 | gpgsign = true 13 | [tag] 14 | gpgsign = true 15 | [pull] 16 | rebase = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | biome.json 3 | .tool-versions 4 | *.orig* 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | Welcome to my dotfiles repository. It includes configuration files 4 | for all the [tools](#links) I use on a daily basis. 5 | 6 | # Links 7 | 8 | - [alacritty](https://github.com/alacritty/alacritty) >= 0.10 9 | - [autojump](https://github.com/wting/autojump) >= 22.5 10 | - [ripgrep](https://github.com/BurntSushi/ripgrep) >= 13.0 11 | - [neovim](https://neovim.io) >= 0.8 12 | - [gnupg](https://www.gnupg.org) >= 2.3 13 | - [asdf](https://asdf-vm.com) >= 0.10 14 | - [brew](https://brew.sh/) >= 3.5 15 | - [fish](https://fishshell.com) >= 3.5 16 | - [tmux](https://github.com/tmux/tmux/wiki) >= 3.3 17 | - [fzf](https://github.com/junegunn/fzf) >= 0.30 18 | -------------------------------------------------------------------------------- /alacritty.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | live_config_reload = true 3 | 4 | [terminal.shell] 5 | args = ["--login", "-c", "tmux attach || tmux"] 6 | program = "/bin/zsh" 7 | 8 | [window] 9 | decorations = "none" 10 | startup_mode = "Maximized" 11 | dimensions.lines = 0 12 | dimensions.columns = 0 13 | padding.x = 0 14 | padding.y = 0 15 | 16 | [scrolling] 17 | history = 0 18 | 19 | [font] 20 | size = 16.0 21 | normal = { family = "CaskaydiaCove Nerd Font Mono", style = "SemiLight" } 22 | italic = { family = "CaskaydiaCove Nerd Font Mono", style = "SemiLight Italic" } 23 | bold = { family = "CaskaydiaCove Nerd Font Mono", style = "Bold" } 24 | bold_italic = { family = "CaskaydiaCove Nerd Font Mono", style = "Bold Italic" } 25 | 26 | [colors] 27 | primary.background = "#000000" 28 | primary.foreground = "#d8d7d7" 29 | normal.black = "#555555" 30 | normal.blue = "#5eabd3" 31 | normal.cyan = "#60d7af" 32 | normal.green = "#afd75f" 33 | normal.magenta = "#af87d7" 34 | normal.red = "#d15c5c" 35 | normal.white = "#d8d7d7" 36 | normal.yellow = "#d1d05c" 37 | 38 | [keyboard] 39 | bindings = [ 40 | { key = "I", mods = "Control", chars = "\u001B[105;5u" }, 41 | { key = "Return", mods = "Shift", chars = "\u001B[13;2u" }, 42 | { key = "Return", mods = "Control", chars = "\u001B[13;5u" }, 43 | { key = "Return", mods = "Control|Shift", chars = "\u001B[13;6u" }, 44 | { key = "A", mods = "Control|Shift", chars = "\u001B[65;6u" }, 45 | { key = "B", mods = "Control|Shift", chars = "\u001B[66;6u" }, 46 | { key = "C", mods = "Control|Shift", chars = "\u001B[67;6u" }, 47 | { key = "D", mods = "Control|Shift", chars = "\u001B[68;6u" }, 48 | { key = "E", mods = "Control|Shift", chars = "\u001B[69;6u" }, 49 | { key = "F", mods = "Control|Shift", chars = "\u001B[70;6u" }, 50 | { key = "G", mods = "Control|Shift", chars = "\u001B[71;6u" }, 51 | { key = "H", mods = "Control|Shift", chars = "\u001B[72;6u" }, 52 | { key = "I", mods = "Control|Shift", chars = "\u001B[73;6u" }, 53 | { key = "J", mods = "Control|Shift", chars = "\u001B[74;6u" }, 54 | { key = "K", mods = "Control|Shift", chars = "\u001B[75;6u" }, 55 | { key = "L", mods = "Control|Shift", chars = "\u001B[76;6u" }, 56 | { key = "M", mods = "Control|Shift", chars = "\u001B[77;6u" }, 57 | { key = "N", mods = "Control|Shift", chars = "\u001B[78;6u" }, 58 | { key = "O", mods = "Control|Shift", chars = "\u001B[79;6u" }, 59 | { key = "P", mods = "Control|Shift", chars = "\u001B[80;6u" }, 60 | { key = "Q", mods = "Control|Shift", chars = "\u001B[81;6u" }, 61 | { key = "R", mods = "Control|Shift", chars = "\u001B[82;6u" }, 62 | { key = "S", mods = "Control|Shift", chars = "\u001B[83;6u" }, 63 | { key = "T", mods = "Control|Shift", chars = "\u001B[84;6u" }, 64 | { key = "U", mods = "Control|Shift", chars = "\u001B[85;6u" }, 65 | { key = "V", mods = "Control|Shift", chars = "\u001B[86;6u" }, 66 | { key = "W", mods = "Control|Shift", chars = "\u001B[87;6u" }, 67 | { key = "X", mods = "Control|Shift", chars = "\u001B[88;6u" }, 68 | { key = "Y", mods = "Control|Shift", chars = "\u001B[89;6u" }, 69 | { key = "Z", mods = "Control|Shift", chars = "\u001B[90;6u" }, 70 | { key = "Key1", mods = "Control|Shift", chars = "\u001B[49;6u" }, 71 | { key = "Key2", mods = "Control|Shift", chars = "\u001B[50;6u" }, 72 | { key = "Key3", mods = "Control|Shift", chars = "\u001B[51;6u" }, 73 | { key = "Key4", mods = "Control|Shift", chars = "\u001B[52;6u" }, 74 | { key = "Key5", mods = "Control|Shift", chars = "\u001B[53;6u" }, 75 | { key = "Key6", mods = "Control|Shift", chars = "\u001B[54;6u" }, 76 | { key = "Key7", mods = "Control|Shift", chars = "\u001B[55;6u" }, 77 | { key = "Key8", mods = "Control|Shift", chars = "\u001B[56;6u" }, 78 | { key = "Key9", mods = "Control|Shift", chars = "\u001B[57;6u" }, 79 | { key = "Key0", mods = "Control|Shift", chars = "\u001B[48;6u" }, 80 | { key = "Minus", mods = "Control|Shift", chars = "\u001B[45;6u" }, 81 | { key = "Equals", mods = "Control|Shift", chars = "\u001B[61;6u" }, 82 | { key = "LBracket", mods = "Control|Shift", chars = "\u001B[91;6u" }, 83 | { key = "RBracket", mods = "Control|Shift", chars = "\u001B[93;6u" }, 84 | { key = "Backslash", mods = "Control|Shift", chars = "\u001B[92;6u" }, 85 | { key = "Semicolon", mods = "Control|Shift", chars = "\u001B[59;6u" }, 86 | { key = "Period", mods = "Control|Shift", chars = "\u001B[46;6u" }, 87 | { key = "Slash", mods = "Control|Shift", chars = "\u001B[47;6u" }, 88 | { key = "Comma", mods = "Control|Shift", chars = "\u001B[44;6u" }, 89 | { key = "`", mods = "Control|Shift", chars = "\u001B[96;6u" }, 90 | { key = "'", mods = "Control|Shift", chars = "\u001B[39;6u" }, 91 | ] 92 | -------------------------------------------------------------------------------- /asdfrc: -------------------------------------------------------------------------------- 1 | legacy_version_file = yes 2 | -------------------------------------------------------------------------------- /config.fish: -------------------------------------------------------------------------------- 1 | # Settings {{{ 2 | set -U fish_greeting 3 | set -U fish_color_command ff8800 4 | set -U fish_color_param magenta 5 | 6 | set -gx CPATH "$(brew --prefix zstd)/include:$(brew --prefix openssl)/include" 7 | set -gx LIBRARY_PATH "$(brew --prefix zstd)/lib:$(brew --prefix openssl)/lib" 8 | set -gx DOTFILES_DIRECTORY "$HOME/dotfiles" 9 | set -gx ASDF_CONFIG_FILE "$HOME/.config/asdf/asdfrc" 10 | set -gx RIPGREP_CONFIG_PATH "$HOME/.config/ripgrep/ripgreprc" 11 | set -gx FZF_DEFAULT_OPTS '--height=50% --layout=reverse' 12 | set -gx FZF_DEFAULT_COMMAND 'rg --files --no-ignore-vcs --hidden' 13 | set -gx SHELL (which fish) 14 | set -gx GPG_TTY (tty) 15 | set -gx EDITOR nvim 16 | set -gx EVENT_NOKQUEUE 1 17 | set -gx HOMEBREW_FORCE_VENDOR_RUBY 1 18 | set -gx HOMEBREW_NO_ENV_HINTS 1 19 | # }}} 20 | 21 | # Aliases {{{ 22 | # don't send terminal type 'alacritty' through ssh 23 | alias ssh "env TERM=xterm-256color ssh" 24 | alias rails "env TERM=xterm-256color rails" 25 | 26 | # config files 27 | alias zx "source ~/.config/fish/config.fish" 28 | 29 | # gpg-agent 30 | alias gpg-add "echo | gpg -s >/dev/null >&1" 31 | # }}} 32 | 33 | # Abbreviations {{{ 34 | # git 35 | abbr g. 'git add .' 36 | abbr gc 'git commit -m' 37 | abbr gco 'git checkout' 38 | abbr gd 'git diff' 39 | abbr gl 'git log' 40 | abbr gp 'git push' 41 | abbr gpl 'git pull' 42 | abbr gg 'git status' 43 | abbr gs 'git stash' 44 | abbr gsp 'git stash pop' 45 | 46 | # vim / vim-isms 47 | abbr v "$EDITOR ." 48 | # }}} 49 | 50 | # Utility functions {{{ 51 | function kp --description "Kill processes" 52 | set -l __kp__pid '' 53 | set __kp__pid (ps -ef | sed 1d | eval "fzf $FZF_DEFAULT_OPTS -m --header='[kill:process]'" | awk '{print $2}') 54 | 55 | if test "x$__kp__pid" != "x" 56 | if test "x$argv[1]" != "x" 57 | echo $__kp__pid | xargs kill $argv[1] 58 | else 59 | echo $__kp__pid | xargs kill -9 60 | end 61 | kp 62 | end 63 | end 64 | 65 | function gcb --description "Delete git branches" 66 | set delete_mode '-d' 67 | 68 | if contains -- '--force' $argv 69 | set force_label ':force' 70 | set delete_mode '-D' 71 | end 72 | 73 | set -l branches_to_delete (git branch | sed -E 's/^[* ] //g' | fzf -m --header="[git:branch:delete$force_label]") 74 | 75 | if test -n "$branches_to_delete" 76 | git branch $delete_mode $branches_to_delete 77 | end 78 | end 79 | 80 | function fish_prompt --description 'Write out the prompt' 81 | switch $status 82 | case 0 ; set_color green 83 | case 127 ; set_color yellow 84 | case '*' ; set_color red 85 | end 86 | 87 | set_color --bold 88 | echo -n '• ' 89 | set_color blue 90 | echo -n (prompt_pwd) 91 | 92 | if git rev-parse --is-inside-work-tree &> /dev/null 93 | set_color yellow 94 | echo -n " on " 95 | set_color green 96 | echo -n (git branch --show-current) 97 | 98 | if git diff --quiet HEAD -- 99 | set_color magenta 100 | end 101 | 102 | echo -n ' ⚑' 103 | end 104 | 105 | set_color yellow 106 | echo -n ' ❯ ' 107 | set_color normal 108 | end 109 | # }}} 110 | 111 | # GPG {{{ 112 | if not test (pgrep gpg-agent) 113 | gpg-agent --daemon --no-grab >/dev/null 2>&1 114 | end 115 | # }}} 116 | 117 | # Sourcing {{{ 118 | [ -f /opt/homebrew/share/autojump/autojump.fish ]; and source /opt/homebrew/share/autojump/autojump.fish 119 | [ -f /opt/homebrew/opt/asdf/libexec/asdf.fish ]; and source /opt/homebrew/opt/asdf/libexec/asdf.fish 120 | # }}} 121 | -------------------------------------------------------------------------------- /gpg-agent.conf: -------------------------------------------------------------------------------- 1 | default-cache-ttl 86400 2 | pinentry-program /opt/homebrew/bin/pinentry-mac 3 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local function apply_default_highlights() 2 | vim.cmd([[ 3 | highlight Normal ctermbg=NONE guibg=NONE 4 | highlight NormalNC ctermbg=NONE guibg=NONE 5 | highlight CursorLine ctermbg=8 guibg=#282a2b 6 | highlight TrailingWhitespace ctermbg=8 guibg=#41535B ctermfg=0 guifg=Black 7 | highlight VertSplit ctermbg=NONE guibg=NONE ctermfg=Gray guifg=Gray 8 | highlight LualineSeparator ctermbg=NONE guibg=#504945 ctermfg=Gray guifg=Gray 9 | ]]) 10 | end 11 | 12 | local augroup = 'init.lua' 13 | vim.api.nvim_create_augroup(augroup, {}) 14 | 15 | vim.loader.enable() 16 | 17 | -- globals {{{ 18 | vim.g.mapleader = ' ' 19 | vim.g.loaded_node_provider = 0 20 | vim.g.loaded_ruby_provider = 0 21 | vim.g.loaded_perl_provider = 0 22 | vim.g.loaded_python3_provider = 0 23 | 24 | vim.g['mkdx#settings'] = { 25 | restore_visual = 1, 26 | gf_on_steroids = 1, 27 | enter = { shift = 1 }, 28 | highlight = { enable = 1 }, 29 | fold = { enable = 1 }, 30 | links = { external = { enable = 1 } }, 31 | toc = { 32 | text = 'Table of Contents', 33 | update_on_write = 1, 34 | details = { nesting_level = 0 }, 35 | }, 36 | } 37 | -- }}} 38 | 39 | -- settings {{{ 40 | local undo_directory = vim.env.HOME .. '/.local/share/nvim/undo//' 41 | local backup_directory = vim.env.HOME .. '/.local/share/nvim/backup//' 42 | 43 | vim.opt.list = true 44 | vim.opt.wrap = false 45 | vim.opt.ruler = false 46 | vim.opt.tabstop = 2 47 | vim.opt.ttyfast = true 48 | vim.opt.showmode = false 49 | vim.opt.undofile = true 50 | vim.opt.swapfile = false 51 | vim.opt.smartcase = true 52 | vim.opt.expandtab = true 53 | vim.opt.backupcopy = 'yes' 54 | vim.opt.ignorecase = true 55 | vim.opt.cursorline = true 56 | vim.opt.splitbelow = true 57 | vim.opt.splitright = true 58 | vim.opt.shiftwidth = 0 59 | vim.opt.timeoutlen = 400 60 | vim.opt.updatetime = 100 61 | vim.opt.softtabstop = 2 62 | vim.opt.showtabline = 0 63 | vim.opt.termguicolors = true 64 | vim.opt.path:append({ '**' }) 65 | vim.opt.undodir:prepend({ undo_directory }) 66 | vim.opt.backupdir:prepend({ backup_directory }) 67 | vim.opt.clipboard:append({ 'unnamedplus' }) 68 | vim.opt.listchars:append({ nbsp = '+', tab = '‣ ', trail = '•' }) 69 | vim.opt.fillchars:append({ msgsep = ' ', vert = '│', eob = ' ' }) 70 | vim.opt.wildignore:append({ '.git', '.DS_Store', 'node_modules' }) 71 | vim.opt.completeopt:append({ 'menu', 'menuone', 'noselect' }) 72 | vim.opt.virtualedit:append({ 'onemore' }) 73 | 74 | for _, path in ipairs({ undo_directory, backup_directory }) do 75 | if vim.fn.isdirectory(path) == 0 then 76 | vim.fn.mkdir(path, 'p') 77 | end 78 | end 79 | -- }}} 80 | 81 | -- plugins {{{ 82 | local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' 83 | if not vim.uv.fs_stat(lazypath) then 84 | vim.fn.system({ 85 | 'git', 86 | 'clone', 87 | '--filter=blob:none', 88 | 'https://github.com/folke/lazy.nvim.git', 89 | '--branch=stable', 90 | lazypath, 91 | }) 92 | end 93 | 94 | vim.opt.rtp:prepend(lazypath) 95 | 96 | require('lazy').setup({ 97 | { 98 | 'nvim-lualine/lualine.nvim', 99 | config = function() 100 | function file_status() 101 | if vim.bo.modified then 102 | return '\u{eabc}' 103 | end 104 | 105 | return '' 106 | end 107 | 108 | function diag_config(type, icon) 109 | icon = icon or type:sub(0, 1) 110 | 111 | return { 112 | 'diagnostics', 113 | sources = { 'nvim_diagnostic' }, 114 | sections = { type }, 115 | symbols = { [type] = icon }, 116 | colored = true, 117 | update_in_insert = false, 118 | } 119 | end 120 | 121 | require('lualine').setup({ 122 | options = { 123 | theme = 'gruvbox-material', 124 | section_separators = { left = '', right = '' }, 125 | component_separators = { 126 | left = '%#LualineSeparator#', 127 | right = '%#LualineSeparator#', 128 | }, 129 | }, 130 | sections = { 131 | lualine_a = { { 'filename', file_status = false, path = 1 } }, 132 | lualine_b = { 133 | { file_status, color = { fg = '#ffa657' } }, 134 | diag_config('error', '󰅚 '), 135 | diag_config('warn', '󰀪 '), 136 | diag_config('info', '󰋽 '), 137 | diag_config('hint', '󰌶 '), 138 | }, 139 | lualine_c = {}, 140 | lualine_x = {}, 141 | lualine_y = {}, 142 | lualine_z = { 'location' }, 143 | }, 144 | }) 145 | end, 146 | }, 147 | { 148 | 'folke/trouble.nvim', 149 | opts = {}, 150 | cmd = 'Trouble', 151 | keys = { 152 | { 153 | 'd', 154 | 'Trouble diagnostics toggle', 155 | desc = 'Diagnostics (Trouble)', 156 | }, 157 | }, 158 | }, 159 | { 'sidofc/mkdx', ft = { 'markdown' } }, 160 | { 161 | 'kylechui/nvim-surround', 162 | event = { 'BufReadPre' }, 163 | config = function() 164 | require('nvim-surround').setup() 165 | end, 166 | }, 167 | { 168 | 'sainnhe/gruvbox-material', 169 | lazy = false, 170 | priority = 1000, 171 | config = function() 172 | vim.g.gruvbox_material_enable_italic = true 173 | vim.g.gruvbox_material_better_performance = 1 174 | vim.cmd.colorscheme('gruvbox-material') 175 | end, 176 | }, 177 | { 178 | 'sidofc/carbon.nvim', 179 | dependencies = { 'nvim-tree/nvim-web-devicons' }, 180 | config = function() 181 | require('carbon').setup({ 182 | sync_pwd = true, 183 | indicators = { collapse = '▾', expand = '▸' }, 184 | actions = { toggle_recursive = '' }, 185 | }) 186 | end, 187 | }, 188 | { 189 | 'NeogitOrg/neogit', 190 | keys = { 'm' }, 191 | dependencies = { 'nvim-lua/plenary.nvim' }, 192 | config = function() 193 | require('neogit').setup({ 194 | disable_hint = true, 195 | disable_signs = true, 196 | disable_insert_on_commit = false, 197 | disable_commit_confirmation = true, 198 | sections = { 199 | recent = { hidden = true, folded = true }, 200 | }, 201 | mappings = { 202 | popup = { 203 | P = 'PullPopup', 204 | p = 'PushPopup', 205 | }, 206 | }, 207 | }) 208 | 209 | vim.keymap.set('n', 'm', vim.cmd.Neogit, { silent = true }) 210 | end, 211 | }, 212 | { 213 | 'stevearc/conform.nvim', 214 | config = function() 215 | local js_tool = 'prettier' 216 | 217 | require('conform').setup({ 218 | format_on_save = { timeout_ms = 1000 }, 219 | formatters_by_ft = { 220 | rust = { 'rustfmt' }, 221 | lua = { 'stylua' }, 222 | ejs = { js_tool }, 223 | css = { js_tool }, 224 | scss = { js_tool }, 225 | json = { js_tool }, 226 | html = { js_tool }, 227 | javascript = { js_tool }, 228 | typescript = { js_tool }, 229 | javascriptreact = { js_tool }, 230 | typescriptreact = { js_tool }, 231 | }, 232 | }) 233 | end, 234 | }, 235 | { 236 | 'aserowy/tmux.nvim', 237 | keys = { 238 | '', 239 | '', 240 | '', 241 | '', 242 | '', 243 | '', 244 | '', 245 | '', 246 | }, 247 | config = function() 248 | local tmux = require('tmux') 249 | 250 | tmux.setup({ 251 | copy_sync = { enable = false }, 252 | navigation = { 253 | cycle_navigation = false, 254 | enable_default_keybindings = false, 255 | }, 256 | resize = { 257 | resize_step_x = 6, 258 | resize_step_y = 3, 259 | enable_default_keybindings = false, 260 | }, 261 | }) 262 | 263 | vim.keymap.set('n', '', tmux.move_left) 264 | vim.keymap.set('n', '', tmux.move_bottom) 265 | vim.keymap.set('n', '', tmux.move_top) 266 | vim.keymap.set('n', '', tmux.move_right) 267 | 268 | vim.keymap.set('n', '', tmux.resize_left) 269 | vim.keymap.set('n', '', tmux.resize_bottom) 270 | vim.keymap.set('n', '', tmux.resize_top) 271 | vim.keymap.set('n', '', tmux.resize_right) 272 | end, 273 | }, 274 | { 275 | 'neovim/nvim-lspconfig', 276 | event = { 'BufReadPre' }, 277 | config = function() 278 | -- npm install --global typescript typescript-language-server 279 | -- npm install --global vscode-langservers-extracted 280 | -- npm install --global @biomejs/biome 281 | -- brew install lua-language-server 282 | 283 | local lsp = require('lspconfig') 284 | 285 | local function on_attach(_, bufnr) 286 | local opts = { noremap = true, silent = true, buffer = bufnr } 287 | 288 | vim.keymap.set('n', 'gn', function() 289 | vim.diagnostic.jump({ count = 1, float = true }) 290 | end, opts) 291 | 292 | vim.keymap.set('n', 'gp', function() 293 | vim.diagnostic.jump({ count = -1, float = true }) 294 | end, opts) 295 | end 296 | 297 | vim.lsp.enable('rust_analyzer') 298 | vim.lsp.config( 299 | 'rust_analyzer', 300 | coq.lsp_ensure_capabilities({ on_attach = on_attach }) 301 | ) 302 | 303 | vim.lsp.enable('eslint') 304 | vim.lsp.config( 305 | 'eslint', 306 | coq.lsp_ensure_capabilities({ on_attach = on_attach }) 307 | ) 308 | 309 | vim.lsp.enable('ts_ls') 310 | vim.lsp.config( 311 | 'ts_ls', 312 | coq.lsp_ensure_capabilities({ on_attach = on_attach }) 313 | ) 314 | 315 | vim.lsp.enable('lua_ls') 316 | vim.lsp.config( 317 | 'lua_ls', 318 | coq.lsp_ensure_capabilities({ 319 | settings = { Lua = {} }, 320 | on_attach = on_attach, 321 | on_init = function(client) 322 | if client.workspace_folders then 323 | local path = client.workspace_folders[1].name 324 | if 325 | path ~= vim.fn.stdpath('config') 326 | and vim.loop.fs_stat(path .. '/.luarc.json') 327 | then 328 | return 329 | end 330 | end 331 | 332 | client.config.settings.Lua = 333 | vim.tbl_deep_extend('force', client.config.settings.Lua, { 334 | runtime = { version = 'LuaJIT' }, 335 | workspace = { 336 | checkThirdParty = false, 337 | library = { 338 | vim.env.VIMRUNTIME, 339 | '${3rd}/luv/library', 340 | '${3rd}/busted/library', 341 | }, 342 | }, 343 | }) 344 | end, 345 | }) 346 | ) 347 | 348 | vim.diagnostic.config({ 349 | signs = false, 350 | virtual_text = true, 351 | float = false, 352 | }) 353 | end, 354 | }, 355 | { 356 | 'nvim-treesitter/nvim-treesitter', 357 | build = ':TSUpdate', 358 | event = { 'BufRead' }, 359 | config = function() 360 | require('nvim-treesitter.configs').setup({ 361 | indent = { enable = true }, 362 | highlight = { enable = true }, 363 | incremental_selection = { enable = true }, 364 | ensure_installed = { 365 | 'c', 366 | 'cpp', 367 | 'css', 368 | 'bash', 369 | 'fish', 370 | 'html', 371 | 'java', 372 | 'javascript', 373 | 'json', 374 | 'json5', 375 | 'lua', 376 | 'pug', 377 | 'python', 378 | 'ruby', 379 | 'rust', 380 | 'scss', 381 | 'toml', 382 | 'tsx', 383 | 'typescript', 384 | 'vimdoc', 385 | 'vim', 386 | 'yaml', 387 | }, 388 | }) 389 | end, 390 | }, 391 | { 392 | 'ibhagwan/fzf-lua', 393 | keys = { '', '', '' }, 394 | config = function() 395 | local fzf_lua = require('fzf-lua') 396 | 397 | fzf_lua.setup({ 398 | actions = { 399 | files = { 400 | ['default'] = fzf_lua.actions.file_edit_or_qf, 401 | ['ctrl-x'] = fzf_lua.actions.file_split, 402 | ['ctrl-v'] = fzf_lua.actions.file_vsplit, 403 | }, 404 | }, 405 | winopts = function() 406 | local height = 15 407 | 408 | return { 409 | border = { '—', '—', '—', '', '', '', '', '' }, 410 | row = vim.o.lines - vim.o.cmdheight - 3 - height, 411 | column = 1, 412 | height = height, 413 | width = vim.o.columns + 1, 414 | } 415 | end, 416 | }) 417 | 418 | vim.keymap.set('n', '', function() 419 | fzf_lua.help_tags({ previewer = false }) 420 | end) 421 | 422 | vim.keymap.set('n', '', function() 423 | fzf_lua.files({ 424 | prompt = '> ', 425 | previewer = false, 426 | cwd_prompt = false, 427 | rg_opts = [[--color=never --files --hidden --follow --no-ignore -g "!.git/**" -g "!node_modules/**" -g "!.DS_Store"]], 428 | fzf_opts = { ['--info'] = 'inline' }, 429 | }) 430 | end) 431 | 432 | vim.keymap.set('n', '', function() 433 | fzf_lua.live_grep_native({ 434 | prompt = '> ', 435 | no_header_i = false, 436 | previewer = false, 437 | exec_empty_query = true, 438 | fzf_opts = { ['--info'] = 'inline', ['--nth'] = '2..' }, 439 | }) 440 | end) 441 | end, 442 | }, 443 | }) 444 | -- }}} 445 | 446 | -- mappings {{{ 447 | vim.keymap.set({ 'n', 'v', 'o', 'i' }, '', '') 448 | vim.keymap.set({ 'n', 'v', 'o', 'i' }, '', '') 449 | vim.keymap.set({ 'n', 'v', 'o', 'i' }, '', '') 450 | vim.keymap.set({ 'n', 'v', 'o', 'i' }, '', '') 451 | vim.keymap.set({ 'n', 'v', 'o' }, '>>', '') 452 | vim.keymap.set({ 'n', 'v', 'o' }, '<<', '') 453 | vim.keymap.set({ 'n', 'v', 'o' }, 'K', '{') 454 | vim.keymap.set({ 'n', 'v', 'o' }, 'J', '}') 455 | vim.keymap.set({ 'n', 'v', 'o' }, 'H', '^') 456 | vim.keymap.set({ 'n', 'v', 'o' }, 'L', '$') 457 | 458 | vim.keymap.set('i', '', '') 459 | vim.keymap.set('i', '', '') 460 | vim.keymap.set('i', '', '') 461 | vim.keymap.set('i', '', '') 462 | 463 | vim.keymap.set('n', '$', '') 464 | vim.keymap.set('n', '^', '') 465 | vim.keymap.set('n', '{', '') 466 | vim.keymap.set('n', '}', '') 467 | 468 | vim.keymap.set('n', '', ':write', { silent = true }) 469 | vim.keymap.set('v', '', ':writegv', { silent = true }) 470 | vim.keymap.set('i', '', ':write', { silent = true }) 471 | vim.keymap.set('o', '', ':write', { silent = true }) 472 | 473 | vim.keymap.set('i', '<>', '<>') 474 | vim.keymap.set('i', '()', '()') 475 | vim.keymap.set('i', '{}', '{}') 476 | vim.keymap.set('i', '[]', '[]') 477 | vim.keymap.set('i', '""', '""') 478 | vim.keymap.set('i', "''", "''") 479 | vim.keymap.set('i', '``', '``') 480 | 481 | vim.keymap.set('n', '', '>>') 482 | vim.keymap.set('n', '', '<<') 483 | vim.keymap.set('v', '', '>>gv') 484 | vim.keymap.set('v', '', '<<gv') 485 | vim.keymap.set('i', '', '') 486 | 487 | vim.keymap.set('v', 'i', ':normal! Tvt') 488 | vim.keymap.set('o', 'i', ':normal! Tvt') 489 | vim.keymap.set('v', 'a', ':normal! Fvf') 490 | vim.keymap.set('o', 'a', ':normal! Fvf') 491 | 492 | vim.keymap.set('n', 'Y', 'y$') 493 | vim.keymap.set('n', 'Q', '@q') 494 | vim.keymap.set('n', 'U', '') 495 | vim.keymap.set('n', '', '') 496 | vim.keymap.set('n', '', '') 497 | 498 | vim.keymap.set('n', '', function() 499 | return pcall(vim.cmd.cnext) or pcall(vim.cmd.cfirst) 500 | end) 501 | 502 | vim.keymap.set('n', '', function() 503 | return pcall(vim.cmd.cprev) or pcall(vim.cmd.clast) 504 | end) 505 | 506 | vim.keymap.set('n', '', function() 507 | local winid = vim.api.nvim_get_current_win() 508 | local windows = vim.fn.getwininfo() 509 | 510 | if #windows > 1 then 511 | vim.api.nvim_win_close(winid, false) 512 | elseif vim.bo.filetype ~= 'carbon.explorer' then 513 | pcall(vim.cmd.Carbon) 514 | end 515 | end, { nowait = true }) 516 | -- }}} 517 | 518 | -- autocommands {{{ 519 | vim.api.nvim_create_autocmd( 520 | { 'FocusLost', 'VimLeave', 'WinLeave', 'BufLeave' }, 521 | { 522 | group = augroup, 523 | pattern = '*', 524 | callback = function() 525 | vim.wo.cursorline = false 526 | end, 527 | } 528 | ) 529 | 530 | vim.api.nvim_create_autocmd( 531 | { 'FocusGained', 'VimEnter', 'WinEnter', 'BufEnter' }, 532 | { 533 | group = augroup, 534 | pattern = '*', 535 | callback = function() 536 | vim.wo.cursorline = true 537 | end, 538 | } 539 | ) 540 | 541 | vim.api.nvim_create_autocmd( 542 | { 'BufEnter' }, 543 | { group = augroup, pattern = 'global', callback = vim.cmd.checktime } 544 | ) 545 | 546 | vim.api.nvim_create_autocmd('VimResized', { 547 | group = augroup, 548 | callback = function() 549 | vim.cmd.wincmd('=') 550 | end, 551 | }) 552 | 553 | vim.api.nvim_create_autocmd('TextYankPost', { 554 | group = augroup, 555 | callback = function() 556 | vim.highlight.on_yank({ 557 | higroup = 'IncSearch', 558 | timeout = 150, 559 | on_visual = true, 560 | }) 561 | end, 562 | }) 563 | 564 | vim.api.nvim_create_autocmd('CmdlineEnter', { 565 | group = augroup, 566 | pattern = { '/', '?' }, 567 | callback = function() 568 | vim.opt_global.hlsearch = true 569 | end, 570 | }) 571 | 572 | vim.api.nvim_create_autocmd('CmdlineLeave', { 573 | group = augroup, 574 | pattern = { '/', '?' }, 575 | callback = function() 576 | vim.opt_global.hlsearch = false 577 | end, 578 | }) 579 | 580 | local filetype_handlers = { 581 | [{ 582 | 'markdown', 583 | 'python', 584 | 'json', 585 | 'jsonc', 586 | 'javascript', 587 | 'javascriptreact', 588 | 'typescript', 589 | 'typescriptreact', 590 | 'html', 591 | 'css', 592 | 'scss', 593 | 'php', 594 | }] = function() 595 | vim.opt_local.expandtab = true 596 | vim.opt_local.shiftwidth = 0 597 | vim.opt_local.tabstop = 4 598 | vim.opt_local.softtabstop = 4 599 | end, 600 | 601 | qf = function() 602 | vim.opt_local.list = false 603 | end, 604 | 605 | NeogitStatus = function() 606 | vim.opt_local.list = false 607 | end, 608 | } 609 | 610 | for pattern, callback in pairs(filetype_handlers) do 611 | vim.api.nvim_create_autocmd('FileType', { 612 | group = augroup, 613 | pattern = pattern, 614 | callback = callback, 615 | }) 616 | end 617 | -- }}} 618 | 619 | -- colorscheme and highlights {{{ 620 | apply_default_highlights() 621 | vim.api.nvim_create_autocmd('ColorScheme', { 622 | group = augroup, 623 | pattern = '*', 624 | callback = apply_default_highlights, 625 | }) 626 | -- }}} 627 | -------------------------------------------------------------------------------- /ripgreprc: -------------------------------------------------------------------------------- 1 | --glob 2 | !{node_modules,tmp,history,_site} 3 | 4 | --glob 5 | !*{.min,.orig,history,debug,cache,public/js} 6 | 7 | --glob 8 | !.{git/*,DS_Store,Trashes,asdf,cargo,rustup,npm,gem,pylint} 9 | 10 | --glob 11 | !{Library,Music,Screenshots,Movies,Desktop,Downloads,Applications} 12 | -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferSingle" 6 | -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | # Variables {{{ 2 | is_vim="ps -c -o state= -o command= -t #{pane_tty} | grep -iqE '^\\S+ +n?vim$'" 3 | # }}} 4 | 5 | # Settings {{{ 6 | setw -g mode-keys vi 7 | set -g status off 8 | set -g pane-border-style fg="#9EC400" 9 | set -g pane-active-border-style fg="#666666" 10 | set -g focus-events on 11 | set -g default-shell /opt/homebrew/bin/fish 12 | set -g default-command /opt/homebrew/bin/fish 13 | set -g prefix C-a 14 | set -sg escape-time 1 15 | set -g base-index 1 16 | set -g renumber-windows on 17 | # }}} 18 | 19 | # Keybindings {{{ 20 | bind C-d kill-window 21 | bind c new-window -c '#{pane_current_path}' 22 | bind q split-window -v -l 6 -c '#{pane_current_path}' 23 | bind - split-window -v -c '#{pane_current_path}' 24 | bind \\ split-window -h -c '#{pane_current_path}' 25 | bind [ swap-pane -U 26 | bind ] swap-pane -D 27 | bind a copy-mode 28 | bind k killp 29 | bind s setw synchronize-panes 30 | bind e send-keys C-l 31 | bind r source-file ~/.config/tmux/tmux.conf 32 | 33 | bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'pbcopy' 34 | bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy' 35 | bind-key -T copy-mode-vi v send -X begin-selection 36 | bind-key -T copy-mode-vi H send -X start-of-line 37 | bind-key -T copy-mode-vi L send -X end-of-line 38 | bind-key -T copy-mode-vi K send -X previous-paragraph 39 | bind-key -T copy-mode-vi J send -X next-paragraph 40 | bind-key -T copy-mode-vi Escape send -X cancel 41 | bind-key -T copy-mode-vi / command-prompt -i -p ">" "send -X search-forward-incremental %1" 42 | bind-key -T copy-mode-vi ? command-prompt -i -p ">" "send -X search-forward-incremental %1" 43 | 44 | bind-key -n C-h if $is_vim { send-keys C-h } { if -F '#{pane_at_left}' {} { select-pane -L } } 45 | bind-key -n C-j if $is_vim { send-keys C-j } { if -F '#{pane_at_bottom}' {} { select-pane -D } } 46 | bind-key -n C-k if $is_vim { send-keys C-k } { if -F '#{pane_at_top}' {} { select-pane -U } } 47 | bind-key -n C-l if $is_vim { send-keys C-l } { if -F '#{pane_at_right}' {} { select-pane -R } } 48 | bind-key -n C-S-h if $is_vim { send-keys C-S-h } { resize-pane -L 6 } 49 | bind-key -n C-S-j if $is_vim { send-keys C-S-j } { resize-pane -D 3 } 50 | bind-key -n C-S-k if $is_vim { send-keys C-S-k } { resize-pane -U 3 } 51 | bind-key -n C-S-l if $is_vim { send-keys C-S-l } { resize-pane -R 6 } 52 | # }}} 53 | --------------------------------------------------------------------------------