├── .gitignore ├── .gitmodules ├── home ├── .config │ ├── fish │ │ ├── completions │ │ │ ├── bun.fish │ │ │ ├── docker.fish │ │ │ └── kubectl.fish │ │ ├── conf.d │ │ │ ├── aliases.fish │ │ │ ├── brew.fish │ │ │ ├── bun.fish │ │ │ ├── catppuccin_macchiato_theme.fish │ │ │ ├── fnm.fish │ │ │ ├── functions.fish │ │ │ ├── git.fish │ │ │ ├── graphite.fish │ │ │ ├── orbstack.fish │ │ │ ├── starship.fish │ │ │ └── zoxide.fish │ │ ├── config.fish │ │ ├── fish_plugins │ │ ├── fish_variables │ │ └── functions │ │ │ ├── __git.branch_has_wip.fish │ │ │ ├── __git.current_branch.fish │ │ │ ├── __git.default_branch.fish │ │ │ ├── __git.destroy.fish │ │ │ ├── __git.init.fish │ │ │ ├── gbage.fish │ │ │ ├── gbda.fish │ │ │ ├── gdv.fish │ │ │ ├── gignored.fish │ │ │ ├── glp.fish │ │ │ ├── grename.fish │ │ │ ├── grt.fish │ │ │ ├── gtest.fish │ │ │ ├── gtl.fish │ │ │ ├── gunwip.fish │ │ │ └── gwip.fish │ ├── ghostty │ │ └── config │ ├── git │ │ ├── config │ │ └── work_config │ ├── nvim │ │ ├── after │ │ │ ├── ftdetect │ │ │ │ ├── ocamlinterface.lua │ │ │ │ └── reason.lua │ │ │ ├── ftplugin │ │ │ │ └── gleam.vim │ │ │ └── syntax │ │ │ │ ├── dune.vim │ │ │ │ └── reason.vim │ │ ├── init.lua │ │ ├── lua │ │ │ ├── dmmulroy │ │ │ │ ├── copy_file_path_to_clipboard.lua │ │ │ │ ├── highlight_yank.lua │ │ │ │ ├── init.lua │ │ │ │ ├── keymaps.lua │ │ │ │ ├── lazy.lua │ │ │ │ ├── ocaml_extensions.lua │ │ │ │ ├── options.lua │ │ │ │ ├── prelude.lua │ │ │ │ ├── rotate_windows.lua │ │ │ │ ├── set_file_type.lua │ │ │ │ ├── toggle_diagnostics.lua │ │ │ │ └── vertical_help.lua │ │ │ └── plugins │ │ │ │ ├── cloak.lua │ │ │ │ ├── codecompanion.lua │ │ │ │ ├── color-scheme.lua │ │ │ │ ├── copilot.lua │ │ │ │ ├── dressing.lua │ │ │ │ ├── fidget.lua │ │ │ │ ├── gitsigns.lua │ │ │ │ ├── harpoon.lua │ │ │ │ ├── lsp.lua │ │ │ │ ├── lualine.lua │ │ │ │ ├── luasnip.lua │ │ │ │ ├── nvim-autopairs.lua │ │ │ │ ├── nvim-cmp.lua │ │ │ │ ├── nvim-highlight-colors.lua │ │ │ │ ├── nvim-tmux-navigator.lua │ │ │ │ ├── nvim-ts-autotag.lua │ │ │ │ ├── nvim-web-devicons.lua │ │ │ │ ├── oil.lua │ │ │ │ ├── render-markdown.lua │ │ │ │ ├── snacks.lua │ │ │ │ ├── spectre.lua │ │ │ │ ├── symbols-outline.lua │ │ │ │ ├── telescope.lua │ │ │ │ ├── treesitter.lua │ │ │ │ ├── tsc.lua │ │ │ │ ├── two-slash.lua │ │ │ │ ├── ufo.lua │ │ │ │ ├── undotree.lua │ │ │ │ ├── vim-maximizer.lua │ │ │ │ ├── vim-surround.lua │ │ │ │ ├── which-key.lua │ │ │ │ └── wilder.lua │ │ └── snippets │ │ │ ├── effect.ts.json │ │ │ ├── package.json │ │ │ └── typescript.json │ ├── starship.toml │ └── tmux │ │ └── tmux.conf └── .ideavimrc ├── init.sh └── packages ├── bundle └── bundle.work /.gitignore: -------------------------------------------------------------------------------- 1 | */**/.undodir 2 | lazy-lock.json 3 | .aider* 4 | .envrc 5 | */**/tmux/plugins/* 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "home/.config/tmux/plugins/tpm"] 2 | path = home/.config/tmux/plugins/tpm 3 | url = https://github.com/tmux-plugins/tpm 4 | -------------------------------------------------------------------------------- /home/.config/fish/completions/bun.fish: -------------------------------------------------------------------------------- 1 | # This is terribly complicated 2 | # It's because: 3 | # 1. bun run has to have dynamic completions 4 | # 2. there are global options 5 | # 3. bun {install add remove} gets special options 6 | # 4. I don't know how to write fish completions well 7 | # Contributions very welcome!! 8 | 9 | function __fish__get_bun_bins 10 | string split ' ' (bun getcompletes b) 11 | end 12 | 13 | function __fish__get_bun_scripts 14 | set -lx SHELL bash 15 | set -lx MAX_DESCRIPTION_LEN 40 16 | string trim (string split '\n' (string split '\t' (bun getcompletes z))) 17 | end 18 | 19 | function __fish__get_bun_packages 20 | if test (commandline -ct) != "" 21 | set -lx SHELL fish 22 | string split ' ' (bun getcompletes a (commandline -ct)) 23 | end 24 | end 25 | 26 | function __history_completions 27 | set -l tokens (commandline --current-process --tokenize) 28 | history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' 29 | end 30 | 31 | function __fish__get_bun_bun_js_files 32 | string split ' ' (bun getcompletes j) 33 | end 34 | 35 | set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global 36 | set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" 37 | 38 | set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x 39 | set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x 40 | 41 | function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts" 42 | # Do nothing if we already have a builtin subcommand, 43 | # or any subcommand other than "run". 44 | if __fish_seen_subcommand_from $bun_builtin_cmds_without_run 45 | or not __fish_use_subcommand && not __fish_seen_subcommand_from run 46 | return 47 | end 48 | # Do we already have a bin or script subcommand? 49 | set -l bins (__fish__get_bun_bins) 50 | if __fish_seen_subcommand_from $bins 51 | return 52 | end 53 | # Scripts have descriptions appended with a tab separator. 54 | # Strip off descriptions for the purposes of subcommand testing. 55 | set -l scripts (__fish__get_bun_scripts) 56 | if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts) 57 | return 58 | end 59 | # Emit scripts. 60 | for script in $scripts 61 | echo $script 62 | end 63 | # Emit binaries and JS files (but only if we're doing `bun run`). 64 | if __fish_seen_subcommand_from run 65 | for bin in $bins 66 | echo "$bin"\t"package bin" 67 | end 68 | for file in (__fish__get_bun_bun_js_files) 69 | echo "$file"\t"Bun.js" 70 | end 71 | end 72 | end 73 | 74 | 75 | # Clear existing completions 76 | complete -e -c bun 77 | 78 | # Dynamically emit scripts and binaries 79 | complete -c bun -f -a "(__bun_complete_bins_scripts)" 80 | 81 | # Complete flags if we have no subcommand or a flag-friendly one. 82 | set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags" 83 | complete -c bun \ 84 | -n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' 85 | complete -c bun \ 86 | -n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' 87 | complete -c bun \ 88 | -n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' 89 | complete -c bun \ 90 | -n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' 91 | complete -c bun \ 92 | -n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)' 93 | complete -c bun \ 94 | -n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' 95 | 96 | # Complete dev and create as first subcommand. 97 | complete -c bun \ 98 | -n "__fish_use_subcommand" -a 'dev' -d 'Start dev server' 99 | complete -c bun \ 100 | -n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' 101 | 102 | # Complete "next" and "react" if we've seen "create". 103 | complete -c bun \ 104 | -n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project' 105 | 106 | complete -c bun \ 107 | -n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project' 108 | 109 | # Complete "upgrade" as first subcommand. 110 | complete -c bun \ 111 | -n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x 112 | # Complete "-h/--help" unconditionally. 113 | complete -c bun \ 114 | -s "h" -l "help" -d 'See all commands and flags' -x 115 | 116 | # Complete "-v/--version" if we have no subcommand. 117 | complete -c bun \ 118 | -n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x 119 | 120 | # Complete additional subcommands. 121 | complete -c bun \ 122 | -n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x 123 | 124 | 125 | complete -c bun \ 126 | -n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' 127 | 128 | 129 | complete -c bun \ 130 | -n "__fish_seen_subcommand_from bun" -F -d 'Bundle this' 131 | 132 | complete -c bun \ 133 | -n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory" 134 | 135 | 136 | complete -c bun \ 137 | -n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' 138 | 139 | complete -c bun \ 140 | -n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' 141 | 142 | complete -c bun \ 143 | -n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' 144 | 145 | complete -c bun \ 146 | -n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' 147 | 148 | 149 | for i in (seq (count $bun_install_boolean_flags)) 150 | complete -c bun \ 151 | -n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" 152 | end 153 | 154 | complete -c bun \ 155 | -n "__fish_seen_subcommand_from install add remove" -l 'cwd' -d 'Change working directory' 156 | 157 | complete -c bun \ 158 | -n "__fish_seen_subcommand_from install add remove" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' 159 | 160 | complete -c bun \ 161 | -n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)' 162 | 163 | complete -c bun \ 164 | -n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)' 165 | 166 | complete -c bun \ 167 | -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f 168 | 169 | complete -c bun \ 170 | -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f 171 | 172 | # Add built-in subcommands with descriptions. 173 | complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template" 174 | complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files" 175 | complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun" 176 | complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary" 177 | complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f 178 | complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f 179 | complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f 180 | complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f 181 | complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f 182 | complete -c bun -n "__fish_use_subcommand" -a "unlink" -d "Unregister a local npm package" -f 183 | complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f 184 | complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f 185 | complete -c bun -n "__fish_use_subcommand" -a "outdated" -d "Display the latest versions of outdated dependencies" -f 186 | complete -c bun -n "__fish_use_subcommand" -a "publish" -d "Publish your package from local to npm" -f 187 | -------------------------------------------------------------------------------- /home/.config/fish/completions/docker.fish: -------------------------------------------------------------------------------- 1 | /Applications/OrbStack.app/Contents/MacOS/../Resources/completions/docker.fish -------------------------------------------------------------------------------- /home/.config/fish/completions/kubectl.fish: -------------------------------------------------------------------------------- 1 | /Applications/OrbStack.app/Contents/MacOS/../Resources/completions/kubectl.fish -------------------------------------------------------------------------------- /home/.config/fish/conf.d/aliases.fish: -------------------------------------------------------------------------------- 1 | alias c 'clear' 2 | alias code 'vim' 3 | alias grep 'grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}' 4 | alias ks 'tmux kill-server' 5 | alias pn 'pnpm' 6 | alias vimdiff 'nvim -d' 7 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/brew.fish: -------------------------------------------------------------------------------- 1 | # Brew 2 | set -U fish_user_paths /opt/homebrew/bin $fish_user_paths 3 | 4 | set --global --export HOMEBREW_PREFIX "/opt/homebrew"; 5 | set --global --export HOMEBREW_CELLAR "/opt/homebrew/Cellar"; 6 | set --global --export HOMEBREW_REPOSITORY "/opt/homebrew"; 7 | fish_add_path --global --move --path "/opt/homebrew/bin" "/opt/homebrew/sbin"; 8 | if test -n "$MANPATH[1]"; set --global --export MANPATH '' $MANPATH; end; 9 | if not contains "/opt/homebrew/share/info" $INFOPATH; set --global --export INFOPATH "/opt/homebrew/share/info" $INFOPATH; end; 10 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/bun.fish: -------------------------------------------------------------------------------- 1 | # bun 2 | set --export BUN_INSTALL "$HOME/.bun" 3 | set --export PATH $BUN_INSTALL/bin $PATH 4 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/catppuccin_macchiato_theme.fish: -------------------------------------------------------------------------------- 1 | # name: 'Catppuccin macchiato' 2 | # url: 'https://github.com/catppuccin/fish' 3 | # preferred_background: 24273a 4 | 5 | set fish_color_normal cad3f5 6 | set fish_color_command c6a0f6 7 | set fish_color_param f0c6c6 8 | set fish_color_keyword ed8796 9 | set fish_color_quote a6da95 10 | set fish_color_redirection f5bde6 11 | set fish_color_end f5a97f 12 | set fish_color_comment 8087a2 13 | set fish_color_error ed8796 14 | set fish_color_gray 6e738d 15 | set fish_color_selection --background=363a4f 16 | set fish_color_search_match --background=363a4f 17 | set fish_color_option a6da95 18 | set fish_color_operator f5bde6 19 | set fish_color_escape ee99a0 20 | set fish_color_autosuggestion 6e738d 21 | set fish_color_cancel ed8796 22 | set fish_color_cwd eed49f 23 | set fish_color_user 8bd5ca 24 | set fish_color_host 8aadf4 25 | set fish_color_host_remote a6da95 26 | set fish_color_status ed8796 27 | set fish_pager_color_progress 6e738d 28 | set fish_pager_color_prefix f5bde6 29 | set fish_pager_color_completion cad3f5 30 | set fish_pager_color_description 6e738d 31 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/fnm.fish: -------------------------------------------------------------------------------- 1 | fnm env --use-on-cd --shell fish | source 2 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/functions.fish: -------------------------------------------------------------------------------- 1 | function fvim 2 | if test (count $argv) -eq 0 3 | fd -t f | fzf --header "Open File in Vim" --preview "cat {}" | xargs nvim 4 | else 5 | set -l query (string join " " $argv) 6 | fd -t f | fzf --header "Open File in Vim" --preview "cat {}" -q "$query" | xargs nvim 7 | end 8 | end 9 | 10 | function vim 11 | if test (count $argv) -eq 0 12 | nvim . 13 | else 14 | nvim $argv 15 | end 16 | end 17 | 18 | function vi 19 | if test (count $argv) -eq 0 20 | nvim . 21 | else 22 | nvim $argv 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/git.fish: -------------------------------------------------------------------------------- 1 | # Remove legacy hooks to prevent errors when upgrading. 2 | # This can be removed when we cleanup other universal abbr code. 3 | functions -e _git_install _git_update _git_uninstall 4 | 5 | # fisher initialization, protected as omf also tries to run it. 6 | set -q fisher_path; or set -l fisher_path $__fish_config_dir 7 | if test -f $fisher_path/functions/__git.init.fish 8 | source $fisher_path/functions/__git.init.fish 9 | __git.init 10 | end 11 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/graphite.fish: -------------------------------------------------------------------------------- 1 | # git helpers adapted from fish git completion 2 | function __fish_git_local_branches 3 | command git for-each-ref --format='%(refname:strip=2)' refs/heads/ 2>/dev/null 4 | end 5 | 6 | function __fish_git_remote_branches 7 | command git for-each-ref --format="%(refname:strip=3)" refs/remotes/ 2>/dev/null 8 | end 9 | 10 | # graphite helpers 11 | function __gt_command_completions 12 | set -lx SHELL (type -p fish) 13 | set -l command (commandline -opc) 14 | # uncomment to include options, e.g. -q, --help 15 | # $command --get-yargs-completions 16 | # uncomment to exclude options (default) 17 | $command --get-yargs-completions | string replace -r '\-.*' '' 18 | end 19 | 20 | # disable file completions for the entire command 21 | complete -c gt -f 22 | 23 | # add completions as provided by CLI 24 | complete -c gt -a "(__gt_command_completions)" 25 | 26 | # commands that take branches 27 | complete -c gt -x -n "__fish_seen_subcommand_from checkout co bco delete dl rename rn onto --onto -o tr utr track untrack" -a "(__fish_git_local_branches)" 28 | 29 | # gt downstack get takes remote branches 30 | complete -c gt -x -n "__fish_seen_subcommand_from ds dsg get g" -n "__fish_seen_subcommand_from get dsg" -a "(__fish_git_remote_branches)" 31 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/orbstack.fish: -------------------------------------------------------------------------------- 1 | 2 | # Added by OrbStack: command-line tools and integration 3 | # This won't be added again if you remove it. 4 | source ~/.orbstack/shell/init2.fish 2>/dev/null || : 5 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/starship.fish: -------------------------------------------------------------------------------- 1 | starship init fish | source 2 | -------------------------------------------------------------------------------- /home/.config/fish/conf.d/zoxide.fish: -------------------------------------------------------------------------------- 1 | zoxide init fish | source 2 | -------------------------------------------------------------------------------- /home/.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # Disable greeting 2 | set fish_greeting 3 | 4 | # Set Editor to neovim 5 | set -gx EDITOR 'nvim' 6 | 7 | # Set neovim as the program to open manpages 8 | set -gx MANPAGER 'nvim +Man!' 9 | -------------------------------------------------------------------------------- /home/.config/fish/fish_plugins: -------------------------------------------------------------------------------- 1 | jhillyerd/plugin-git 2 | -------------------------------------------------------------------------------- /home/.config/fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR __fish_initialized:3800 4 | SETUVAR _fisher_jhillyerd_2F_plugin_2D_git_files:\x7e/\x2econfig/fish/functions/__git\x2ebranch_has_wip\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2ecurrent_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edefault_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edestroy\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2einit\x2efish\x1e\x7e/\x2econfig/fish/functions/gbage\x2efish\x1e\x7e/\x2econfig/fish/functions/gbda\x2efish\x1e\x7e/\x2econfig/fish/functions/gdv\x2efish\x1e\x7e/\x2econfig/fish/functions/gignored\x2efish\x1e\x7e/\x2econfig/fish/functions/glp\x2efish\x1e\x7e/\x2econfig/fish/functions/grename\x2efish\x1e\x7e/\x2econfig/fish/functions/grt\x2efish\x1e\x7e/\x2econfig/fish/functions/gtest\x2efish\x1e\x7e/\x2econfig/fish/functions/gtl\x2efish\x1e\x7e/\x2econfig/fish/functions/gunwip\x2efish\x1e\x7e/\x2econfig/fish/functions/gwip\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/git\x2efish 5 | SETUVAR _fisher_plugins:jhillyerd/plugin\x2dgit 6 | SETUVAR _fisher_upgraded_to_4_4:\x1d 7 | SETUVAR fish_color_cwd_root:red 8 | SETUVAR fish_color_history_current:\x2d\x2dbold 9 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 10 | SETUVAR fish_key_bindings:fish_default_key_bindings 11 | SETUVAR fish_pager_color_selected_background:\x2dr 12 | SETUVAR fish_user_paths:/opt/homebrew/bin 13 | -------------------------------------------------------------------------------- /home/.config/fish/functions/__git.branch_has_wip.fish: -------------------------------------------------------------------------------- 1 | function __git.branch_has_wip -d "Returns 0 if branch has --wip--, otherwise 1" 2 | git log -n 1 2>/dev/null | grep -qc "\-\-wip\-\-" 3 | end 4 | -------------------------------------------------------------------------------- /home/.config/fish/functions/__git.current_branch.fish: -------------------------------------------------------------------------------- 1 | function __git.current_branch -d "Output git's current branch name" 2 | begin 3 | git symbolic-ref HEAD; or \ 4 | git rev-parse --short HEAD; or return 5 | end 2>/dev/null | sed -e 's|^refs/heads/||' 6 | end 7 | -------------------------------------------------------------------------------- /home/.config/fish/functions/__git.default_branch.fish: -------------------------------------------------------------------------------- 1 | function __git.default_branch -d "Use init.defaultBranch if it's set and exists, otherwise use main if it exists. Falls back to master" 2 | command git rev-parse --git-dir &>/dev/null; or return 3 | if set -l default_branch (command git config --get init.defaultBranch) 4 | and command git show-ref -q --verify refs/heads/{$default_branch} 5 | echo $default_branch 6 | else if command git show-ref -q --verify refs/heads/main 7 | echo main 8 | else 9 | echo master 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /home/.config/fish/functions/__git.destroy.fish: -------------------------------------------------------------------------------- 1 | function __git.destroy 2 | for ab in $__git_plugin_abbreviations 3 | abbr -e $ab 4 | end 5 | set -Ue __git_plugin_abbreviations 6 | set -Ue __git_plugin_initialized 7 | end 8 | -------------------------------------------------------------------------------- /home/.config/fish/functions/__git.init.fish: -------------------------------------------------------------------------------- 1 | function __git.init 2 | function __git.create_abbr -d "Create Git plugin abbreviation" 3 | set -l name $argv[1] 4 | set -l body $argv[2..-1] 5 | 6 | # TODO: global scope abbr will be default in fish 3.6.0 7 | abbr -a -g $name $body 8 | end 9 | 10 | # Provide a smooth transition from universal to global abbreviations by 11 | # deleting the old univeral ones. Can be removed after fish 3.6 is in 12 | # wide-spread use, i.e. 2024. __git.destroy should also be removed 13 | # at the same time. 14 | if set -q __git_plugin_initialized 15 | __git.destroy 16 | end 17 | 18 | # git abbreviations 19 | __git.create_abbr g git 20 | __git.create_abbr ga git add 21 | __git.create_abbr gaa git add --all 22 | __git.create_abbr gau git add --update 23 | __git.create_abbr gapa git add --patch 24 | __git.create_abbr gap git apply 25 | __git.create_abbr gb git branch -vv 26 | __git.create_abbr gba git branch -a -v 27 | __git.create_abbr gban git branch -a -v --no-merged 28 | __git.create_abbr gbd git branch -d 29 | __git.create_abbr gbD git branch -D 30 | __git.create_abbr ggsup git branch --set-upstream-to=origin/\(__git.current_branch\) 31 | __git.create_abbr gbl git blame -b -w 32 | __git.create_abbr gbs git bisect 33 | __git.create_abbr gbsb git bisect bad 34 | __git.create_abbr gbsg git bisect good 35 | __git.create_abbr gbsr git bisect reset 36 | __git.create_abbr gbss git bisect start 37 | __git.create_abbr gc git commit -v 38 | __git.create_abbr gc! git commit -v --amend 39 | __git.create_abbr gcn! git commit -v --no-edit --amend 40 | __git.create_abbr gca git commit -v -a 41 | __git.create_abbr gca! git commit -v -a --amend 42 | __git.create_abbr gcan! git commit -v -a --no-edit --amend 43 | __git.create_abbr gcv git commit -v --no-verify 44 | __git.create_abbr gcav git commit -a -v --no-verify 45 | __git.create_abbr gcav! git commit -a -v --no-verify --amend 46 | __git.create_abbr gcm git commit -m 47 | __git.create_abbr gcam git commit -a -m 48 | __git.create_abbr gcs git commit -S 49 | __git.create_abbr gscam git commit -S -a -m 50 | __git.create_abbr gcfx git commit --fixup 51 | __git.create_abbr gcf git config --list 52 | __git.create_abbr gcl git clone 53 | __git.create_abbr gclean git clean -di 54 | __git.create_abbr gclean! git clean -dfx 55 | __git.create_abbr gclean!! "git reset --hard; and git clean -dfx" 56 | __git.create_abbr gcount git shortlog -sn 57 | __git.create_abbr gcp git cherry-pick 58 | __git.create_abbr gcpa git cherry-pick --abort 59 | __git.create_abbr gcpc git cherry-pick --continue 60 | __git.create_abbr gd git diff 61 | __git.create_abbr gdca git diff --cached 62 | __git.create_abbr gds git diff --stat 63 | __git.create_abbr gdsc git diff --stat --cached 64 | __git.create_abbr gdt git diff-tree --no-commit-id --name-only -r 65 | __git.create_abbr gdw git diff --word-diff 66 | __git.create_abbr gdwc git diff --word-diff --cached 67 | __git.create_abbr gdto git difftool 68 | __git.create_abbr gdg git diff --no-ext-diff 69 | __git.create_abbr gignore git update-index --assume-unchanged 70 | __git.create_abbr gf git fetch 71 | __git.create_abbr gfa git fetch --all --prune 72 | __git.create_abbr gfm "git fetch origin (__git.default_branch) --prune; and git merge FETCH_HEAD" 73 | __git.create_abbr gfo git fetch origin 74 | __git.create_abbr gl git pull 75 | __git.create_abbr ggl git pull origin \(__git.current_branch\) 76 | __git.create_abbr gll git pull origin 77 | __git.create_abbr glr git pull --rebase 78 | __git.create_abbr glg git log --stat 79 | __git.create_abbr glgg git log --graph 80 | __git.create_abbr glgga git log --graph --decorate --all 81 | __git.create_abbr glo git log --oneline --decorate --color 82 | __git.create_abbr glog git log --oneline --decorate --color --graph 83 | __git.create_abbr gloga git log --oneline --decorate --color --graph --all 84 | __git.create_abbr glom git log --oneline --decorate --color \(__git.default_branch\).. 85 | __git.create_abbr glod git log --oneline --decorate --color develop.. 86 | __git.create_abbr gloo "git log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short" 87 | __git.create_abbr gm git merge 88 | __git.create_abbr gmt git mergetool --no-prompt 89 | __git.create_abbr gmom git merge origin/\(__git.default_branch\) 90 | __git.create_abbr gp git push 91 | __git.create_abbr gp! git push --force-with-lease 92 | __git.create_abbr gpo git push origin 93 | __git.create_abbr gpo! git push --force-with-lease origin 94 | __git.create_abbr gpv git push --no-verify 95 | __git.create_abbr gpv! git push --no-verify --force-with-lease 96 | __git.create_abbr ggp git push origin \(__git.current_branch\) 97 | __git.create_abbr ggp! git push origin \(__git.current_branch\) --force-with-lease 98 | __git.create_abbr gpu git push origin \(__git.current_branch\) --set-upstream 99 | __git.create_abbr gpoat "git push origin --all; and git push origin --tags" 100 | __git.create_abbr ggpnp "git pull origin (__git.current_branch); and git push origin (__git.current_branch)" 101 | __git.create_abbr gr git remote -vv 102 | __git.create_abbr gra git remote add 103 | __git.create_abbr grb git rebase 104 | __git.create_abbr grba git rebase --abort 105 | __git.create_abbr grbc git rebase --continue 106 | __git.create_abbr grbi git rebase --interactive 107 | __git.create_abbr grbm git rebase \(__git.default_branch\) 108 | __git.create_abbr grbmi git rebase \(__git.default_branch\) --interactive 109 | __git.create_abbr grbmia git rebase \(__git.default_branch\) --interactive --autosquash 110 | __git.create_abbr grbom "git fetch origin (__git.default_branch); and git rebase FETCH_HEAD" 111 | __git.create_abbr grbomi "git fetch origin (__git.default_branch); and git rebase FETCH_HEAD --interactive" 112 | __git.create_abbr grbomia "git fetch origin (__git.default_branch); and git rebase FETCH_HEAD --interactive --autosquash" 113 | __git.create_abbr grbd git rebase develop 114 | __git.create_abbr grbdi git rebase develop --interactive 115 | __git.create_abbr grbdia git rebase develop --interactive --autosquash 116 | __git.create_abbr grbs git rebase --skip 117 | __git.create_abbr ggu git pull --rebase origin \(__git.current_branch\) 118 | __git.create_abbr grev git revert 119 | __git.create_abbr grh git reset 120 | __git.create_abbr grhh git reset --hard 121 | __git.create_abbr grhpa git reset --patch 122 | __git.create_abbr grm git rm 123 | __git.create_abbr grmc git rm --cached 124 | __git.create_abbr grmv git remote rename 125 | __git.create_abbr grpo git remote prune origin 126 | __git.create_abbr grrm git remote remove 127 | __git.create_abbr grs git restore 128 | __git.create_abbr grset git remote set-url 129 | __git.create_abbr grss git restore --source 130 | __git.create_abbr grst git restore --staged 131 | __git.create_abbr grup git remote update 132 | __git.create_abbr grv git remote -v 133 | __git.create_abbr gsh git show 134 | __git.create_abbr gsd git svn dcommit 135 | __git.create_abbr gsr git svn rebase 136 | __git.create_abbr gsb git status -sb 137 | __git.create_abbr gss git status -s 138 | __git.create_abbr gst git status 139 | __git.create_abbr gsta git stash 140 | __git.create_abbr gstd git stash drop 141 | __git.create_abbr gstl git stash list 142 | __git.create_abbr gstp git stash pop 143 | __git.create_abbr gsts git stash show --text 144 | __git.create_abbr gsu git submodule update 145 | __git.create_abbr gsur git submodule update --recursive 146 | __git.create_abbr gsuri git submodule update --recursive --init 147 | __git.create_abbr gts git tag -s 148 | __git.create_abbr gtv git tag | sort -V 149 | __git.create_abbr gsw git switch 150 | __git.create_abbr gswc git switch --create 151 | __git.create_abbr gunignore git update-index --no-assume-unchanged 152 | __git.create_abbr gup git pull --rebase 153 | __git.create_abbr gupv git pull --rebase -v 154 | __git.create_abbr gupa git pull --rebase --autostash 155 | __git.create_abbr gupav git pull --rebase --autostash -v 156 | __git.create_abbr gwch git whatchanged -p --abbrev-commit --pretty=medium 157 | 158 | # git checkout abbreviations 159 | __git.create_abbr gco git checkout 160 | __git.create_abbr gcb git checkout -b 161 | __git.create_abbr gcod git checkout develop 162 | __git.create_abbr gcom git checkout \(__git.default_branch\) 163 | 164 | # git flow abbreviations 165 | __git.create_abbr gfb git flow bugfix 166 | __git.create_abbr gff git flow feature 167 | __git.create_abbr gfr git flow release 168 | __git.create_abbr gfh git flow hotfix 169 | __git.create_abbr gfs git flow support 170 | 171 | __git.create_abbr gfbs git flow bugfix start 172 | __git.create_abbr gffs git flow feature start 173 | __git.create_abbr gfrs git flow release start 174 | __git.create_abbr gfhs git flow hotfix start 175 | __git.create_abbr gfss git flow support start 176 | 177 | __git.create_abbr gfbt git flow bugfix track 178 | __git.create_abbr gfft git flow feature track 179 | __git.create_abbr gfrt git flow release track 180 | __git.create_abbr gfht git flow hotfix track 181 | __git.create_abbr gfst git flow support track 182 | 183 | __git.create_abbr gfp git flow publish 184 | 185 | # git worktree abbreviations 186 | __git.create_abbr gwt git worktree 187 | __git.create_abbr gwta git worktree add 188 | __git.create_abbr gwtls git worktree list 189 | __git.create_abbr gwtlo git worktree lock 190 | __git.create_abbr gwtmv git worktree move 191 | __git.create_abbr gwtpr git worktree prune 192 | __git.create_abbr gwtrm git worktree remove 193 | __git.create_abbr gwtulo git worktree unlock 194 | 195 | # GitLab push options 196 | __git.create_abbr gmr git push origin \(__git.current_branch\) --set-upstream -o merge_request.create 197 | __git.create_abbr gmwps git push origin \(__git.current_branch\) --set-upstream -o merge_request.create -o merge_request.merge_when_pipeline_succeeds 198 | 199 | # Cleanup declared functions 200 | functions -e __git.create_abbr 201 | end 202 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gbage.fish: -------------------------------------------------------------------------------- 1 | function gbage -d "List local branches and display their age" 2 | git for-each-ref --sort=committerdate refs/heads/ \ 3 | --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))" 4 | end 5 | 6 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gbda.fish: -------------------------------------------------------------------------------- 1 | function gbda -d "Delete all branches merged in current HEAD, including squashed" 2 | git branch --merged | \ 3 | # *: current branch, +: current branch on worktree. 4 | command grep -vE '^\*|^\+|^\s*(master|main|develop)\s*$' | \ 5 | command xargs -r -n 1 git branch -d 6 | 7 | set -l default_branch (__git.default_branch) 8 | git for-each-ref refs/heads/ "--format=%(refname:short)" | \ 9 | while read branch 10 | set -l merge_base (git merge-base $default_branch $branch) 11 | if string match -q -- '-*' (git cherry $default_branch (git commit-tree (git rev-parse $branch\^{tree}) -p $merge_base -m _)) 12 | git branch -D $branch 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gdv.fish: -------------------------------------------------------------------------------- 1 | function gdv -w "git diff -w" -d "Pipe `git diff` to `view` command" 2 | git diff -w $argv | view - 3 | end 4 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gignored.fish: -------------------------------------------------------------------------------- 1 | function gignored -w 'grep "^[[:lower:]]"' -d "list temporarily ignored files" 2 | git ls-files -v | grep "^[[:lower:]]" $argv 3 | end 4 | -------------------------------------------------------------------------------- /home/.config/fish/functions/glp.fish: -------------------------------------------------------------------------------- 1 | function glp -d "git log at requested pretty level" -a format 2 | set -q format[1]; and git log --pretty=$format 3 | end 4 | 5 | complete -c glp -x -a "(complete -C 'git log --pretty=' | sed 's/^--pretty=//')" 6 | -------------------------------------------------------------------------------- /home/.config/fish/functions/grename.fish: -------------------------------------------------------------------------------- 1 | function grename -d "Rename 'old' branch to 'new', including in origin remote" -a old new 2 | if test (count $argv) -ne 2 3 | echo "Usage: "(status -u)" old_branch new_branch" 4 | return 1 5 | end 6 | git branch -m $old $new 7 | git push origin :$old 8 | and git push --set-upstream origin $new 9 | end 10 | 11 | complete -c grename -x -a "(complete -C 'git branch ')" 12 | -------------------------------------------------------------------------------- /home/.config/fish/functions/grt.fish: -------------------------------------------------------------------------------- 1 | function grt -d "cd into the top of the current repository or submodule" 2 | cd (git rev-parse --show-toplevel; or echo ".") 3 | end 4 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gtest.fish: -------------------------------------------------------------------------------- 1 | # gtest: test a command against git staged changes. 2 | # 3 | # example usage: 4 | # gtest make test 5 | function gtest -d "test command on staged changes only" 6 | # Stash working dir, keeping index changes. 7 | git stash push -q --keep-index --include-untracked; or return 8 | 9 | # Run test command against index changes only. 10 | command $argv 11 | set cmdstatus $status 12 | 13 | # Return working dir and index to original state. 14 | # Note: reset + restore is required to prevent merge conflicts 15 | # when popping the stash. 16 | git reset -q 17 | git restore . 18 | git stash pop -q --index; or return $status 19 | 20 | return $cmdstatus 21 | end 22 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gtl.fish: -------------------------------------------------------------------------------- 1 | function gtl -d "List tags matching prefix" -a prefix 2 | git tag --sort=-v:refname -n -l $prefix\* 3 | end 4 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gunwip.fish: -------------------------------------------------------------------------------- 1 | # Work In Progress (wip) 2 | # These features allow to pause a branch development and switch to another one 3 | # When you want to go back to work, just unwip it 4 | # 5 | function gunwip -d "git uncommit the work-in-progress branch" 6 | git log -n 1 | grep -q -c "\--wip--"; and git reset HEAD~1 7 | end 8 | -------------------------------------------------------------------------------- /home/.config/fish/functions/gwip.fish: -------------------------------------------------------------------------------- 1 | # Work In Progress (wip) 2 | # These features allow to pause a branch development and switch to another one 3 | # When you want to go back to work, just unwip it 4 | # 5 | function gwip -d "git commit a work-in-progress branch" 6 | git add -A; git rm (git ls-files --deleted) 2> /dev/null; git commit -m "--wip--" --no-verify 7 | end 8 | -------------------------------------------------------------------------------- /home/.config/ghostty/config: -------------------------------------------------------------------------------- 1 | # Ghostty theme 2 | theme = catppuccin-macchiato 3 | 4 | # Shell integrations 5 | shell-integration = fish 6 | quit-after-last-window-closed = true 7 | 8 | # Font family 9 | font-family = MonoLisa 10 | font-style = Regular 11 | font-style-italic = Regular Italic 12 | font-style-bold = Bold 13 | font-style-bold-italic = Bold Italic 14 | 15 | # Font size 16 | font-size = 20 17 | 18 | # Opacity of split windows 19 | unfocused-split-opacity = 0.97 20 | 21 | # Set the background-opacity to be fully opaque 22 | background-opacity = 1.0 23 | 24 | # Cursor style 25 | cursor-style-blink = true 26 | 27 | # Clipboard settings 28 | clipboard-read = allow 29 | clipboard-write = allow 30 | 31 | # macos options 32 | macos-option-as-alt = true 33 | macos-titlebar-proxy-icon = hidden 34 | 35 | # Always show ghostty as the title 36 | title = ghostty 37 | 38 | # Window settings 39 | window-width = 90 40 | window-height = 30 41 | window-colorspace = display-p3 42 | window-padding-color = background 43 | window-padding-balance = true 44 | window-padding-x = 0 45 | window-padding-y = 0 46 | 47 | 48 | -------------------------------------------------------------------------------- /home/.config/git/config: -------------------------------------------------------------------------------- 1 | 2 | [alias] 3 | fomo = "!fish -c 'git fetch origin $(__git.default_branch) && git rebase origin/$(__git.default_branch) --autostash'" 4 | lg = "!fish -c 'git_log_n $argv'" 5 | nuke = "!git add --all && git stash && git stash clear" 6 | 7 | [branch] 8 | sort = "-committerdate" 9 | 10 | [column] 11 | ui = "auto" 12 | 13 | [commit] 14 | gpgSign = true 15 | 16 | [core] 17 | editor = "nvim" 18 | fsmonitor = true 19 | 20 | [fetch] 21 | prune = true 22 | writeCommitGraph = true 23 | 24 | [filter "lfs"] 25 | clean = "git-lfs clean -- %f" 26 | process = "git-lfs filter-process" 27 | required = true 28 | smudge = "git-lfs smudge -- %f" 29 | 30 | [gpg] 31 | format = "ssh" 32 | 33 | [init] 34 | defaultBranch = "main" 35 | 36 | [pull] 37 | rebase = true 38 | 39 | [rebase] 40 | updateRefs = true 41 | 42 | [rerere] 43 | enabled = true 44 | 45 | [tag] 46 | gpgSign = true 47 | 48 | [user] 49 | email = "dillon.mulroy@gmail.com" 50 | name = "Dillon Mulroy" 51 | signingKey = "~/.ssh/key.pub" 52 | signingkey = "~/.ssh/key.pub" 53 | 54 | [includeIf "gitdir:~/Code/work/"] 55 | path = "~/.config/git/work_config" 56 | -------------------------------------------------------------------------------- /home/.config/git/work_config: -------------------------------------------------------------------------------- 1 | [user] 2 | email = "dillon.mulroy@vercel.com" 3 | name = "Dillon Mulroy" 4 | signingkey = "~/.ssh/key.pub" 5 | -------------------------------------------------------------------------------- /home/.config/nvim/after/ftdetect/ocamlinterface.lua: -------------------------------------------------------------------------------- 1 | -- Properly set the file type for ocaml interface files 2 | vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { 3 | pattern = "*.mli", 4 | desc = "Detect and set the proper file type for ocaml interface files", 5 | callback = function() 6 | vim.cmd(":set filetype=ocamlinterface") 7 | end, 8 | }) 9 | -------------------------------------------------------------------------------- /home/.config/nvim/after/ftdetect/reason.lua: -------------------------------------------------------------------------------- 1 | -- Detect and set the proper file type for ReasonML files 2 | vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { 3 | pattern = "*.re,*.rei", 4 | desc = "Detect and set the proper file type for ReasonML files", 5 | callback = function() 6 | vim.cmd("set filetype=reason") 7 | end, 8 | }) 9 | -------------------------------------------------------------------------------- /home/.config/nvim/after/ftplugin/gleam.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=//%s 2 | setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:////,:///,:// 3 | -------------------------------------------------------------------------------- /home/.config/nvim/after/syntax/dune.vim: -------------------------------------------------------------------------------- 1 | set syntax=lisp 2 | syn keyword lispDecl library jbuild_version executables executable rule ocamllex ocamlyacc menhir install alias test tests 3 | syn keyword lispAtom true false 4 | syn keyword lispKey no_dynlink install_c_headers modes self_build_stubs_archive 5 | syn keyword lispKey preprocess preprocessor_deps optional c_names cxx_names 6 | syn keyword lispKey public_name name names modules synopsis libraries wrapped 7 | syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags 8 | syn keyword lispKey flags pps ocamlc_flags javascript_files ocamlopt_flags 9 | syn keyword lispKey action library_flags c_flags c_library_flags kind package 10 | -------------------------------------------------------------------------------- /home/.config/nvim/after/syntax/reason.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Reason (Forked from Rust) 3 | " Maintainer: (Jordan - for Reason changes) Patrick Walton 4 | " Maintainer: Ben Blum 5 | " Maintainer: Chris Morgan 6 | " Last Change: January 29, 2015 7 | " Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved. 8 | 9 | if version < 600 10 | syntax clear 11 | elseif exists("b:current_syntax") && b:current_syntax == "reason" 12 | finish 13 | endif 14 | 15 | " Syntax definitions {{{1 16 | " Basic keywords {{{2 17 | syn keyword reasonConditional try switch if else for while 18 | syn keyword reasonOperator as to downto 19 | 20 | " syn keyword reasonKeyword fun nextgroup=reasonFuncName skipwhite skipempty 21 | syn match reasonAssert "\" 36 | " Polymorphic variants 37 | syn match reasonConstructor "`\w\(\w\|'\)*\>" 38 | 39 | syn match reasonModPath "\<\u\(\w\|'\)* *\."he=e-1 40 | syn match reasonModPath "\(\\|<\|%\)=\?" 78 | " This one isn't *quite* right, as we could have binary-& with a reference 79 | 80 | " This isn't actually correct; a closure with no arguments can be `|| { }`. 81 | " Last, because the & in && isn't a sigil 82 | syn match reasonOperator display "&&\|||" 83 | " This is reasonArrowCharacter rather than reasonArrow for the sake of matchparen, 84 | " so it skips the ->; see http://stackoverflow.com/a/30309949 for details. 85 | syn match reasonArrowCharacter display "=>" 86 | 87 | syn match reasonEscapeError display contained /\\./ 88 | syn match reasonEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ 89 | syn match reasonEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/ 90 | syn match reasonEscapeUnicode display contained /\\u{\x\{1,6}}/ 91 | syn match reasonStringContinuation display contained /\\\n\s*/ 92 | syn region reasonString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=reasonEscape,reasonEscapeError,reasonStringContinuation 93 | syn region reasonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation,@Spell 94 | syn region reasonString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell 95 | 96 | syn region reasonMultilineString start=+b{|+ skip=+\\\\\|\\"+ end=+|}+ contains=reasonEscape,reasonEscapeError,reasonStringContinuation 97 | syn region reasonMultilineString start=+{|+ end=+|}+ contains=reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation,@Spell 98 | 99 | 100 | " https://github.com/pangloss/vim-javascript/blob/master/syntax/javascript.vim 101 | " lc=1 means leading context, for "not backslashed" 102 | syntax region reasonTemplateExpression contained matchgroup=reasonTemplateBraces start=+\(^\|[^\\]\)${+lc=1 end=+}+ contains=@interpolation keepend 103 | syntax region reasonTemplateString start=+`\($\| \)+ skip=+\\`+ end=+`+ contains=reasonTemplateExpression,jsSpecial,@Spell extend 104 | syntax match reasonTaggedTemplate /\<\K\k*\ze`/ nextgroup=reasonTemplateString 105 | 106 | 107 | syn region reasonAttribute start="#!\?\[" end="\]" contains=reasonString,reasonDerive 108 | " This list comes from src/libsyntax/ext/deriving/mod.rs 109 | " Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show). 110 | 111 | " Number literals 112 | syn match reasonDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\=" 113 | syn match reasonHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" 114 | syn match reasonOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" 115 | syn match reasonBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" 116 | 117 | " Special case for numbers of the form "1." which are float literals, unless followed by 118 | " an identifier, which makes them integer literals with a method call or field access, 119 | " or by another ".", which makes them integer literals followed by the ".." token. 120 | " (This must go first so the others take precedence.) 121 | syn match reasonFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!" 122 | " To mark a number as a normal float, it must have at least one of the three things integral values don't have: 123 | " a decimal point and more numbers; an exponent; and a type suffix. 124 | syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" 125 | syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\=" 126 | syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)" 127 | 128 | " For the benefit of delimitMate 129 | 130 | syn match reasonCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ 131 | " The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). 132 | syn match reasonCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ 133 | syn match reasonCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=reasonEscape,reasonEscapeError,reasonCharacterInvalid,reasonCharacterInvalidUnicode 134 | syn match reasonCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonCharacterInvalid 135 | 136 | syn match reasonShebang /\%^#![^[].*/ 137 | syn region reasonCommentLine start="//" end="$" contains=reasonTodo,@Spell 138 | " syn region reasonCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=reasonTodo,@Spell 139 | syn region reasonCommentBlock matchgroup=reasonCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=reasonTodo,reasonCommentBlockNest,@Spell 140 | syn region reasonCommentBlockDoc matchgroup=reasonCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=reasonTodo,reasonCommentBlockDocNest,@Spell 141 | syn region reasonCommentBlockNest matchgroup=reasonCommentBlock start="/\*" end="\*/" contains=reasonTodo,reasonCommentBlockNest,@Spell contained transparent 142 | syn region reasonCommentBlockDocNest matchgroup=reasonCommentBlockDoc start="/\*" end="\*/" contains=reasonTodo,reasonCommentBlockDocNest,@Spell contained transparent 143 | " FIXME: this is a really ugly and not fully correct implementation. Most 144 | " importantly, a case like ``/* */*`` should have the final ``*`` not being in 145 | " a comment, but in practice at present it leaves comments open two levels 146 | " deep. But as long as you stay away from that particular case, I *believe* 147 | " the highlighting is correct. Due to the way Vim's syntax engine works 148 | " (greedy for start matches, unlike Zust's tokeniser which is searching for 149 | " the earliest-starting match, start or end), I believe this cannot be solved. 150 | " Oh you who would fix it, don't bother with things like duplicating the Block 151 | " rules and putting ``\*\@", "", { desc = "Disable space (leader) in normal mode" }) 8 | 9 | vim.keymap.set("n", "", "") 10 | 11 | -- Window and kitty navigation 12 | vim.keymap.set("n", "", function() 13 | if vim.fn.exists(":NvimTmuxNavigateDown") ~= 0 then 14 | vim.cmd.NvimTmuxNavigateDown() 15 | else 16 | vim.cmd.wincmd("j") 17 | end 18 | end, { desc = "Navigate down" }) 19 | 20 | vim.keymap.set("n", "", function() 21 | if vim.fn.exists(":NvimTmuxNavigateUp") ~= 0 then 22 | vim.cmd.NvimTmuxNavigateUp() 23 | else 24 | vim.cmd.wincmd("k") 25 | end 26 | end, { desc = "Navigate up" }) 27 | 28 | vim.keymap.set("n", "", function() 29 | if vim.fn.exists(":NvimTmuxNavigateRight") ~= 0 then 30 | vim.cmd.NvimTmuxNavigateRight() 31 | else 32 | vim.cmd.wincmd("l") 33 | end 34 | end, { desc = "Navigate right" }) 35 | 36 | vim.keymap.set("n", "", function() 37 | if vim.fn.exists(":NvimTmuxNavigateLeft") ~= 0 then 38 | vim.cmd.NvimTmuxNavigateLeft() 39 | else 40 | vim.cmd.wincmd("h") 41 | end 42 | end, { desc = "Navigate left" }) 43 | 44 | -- Swap between last two buffers 45 | vim.keymap.set("n", "'", "", { desc = "Switch to last buffer" }) 46 | 47 | -- Save and Quit 48 | vim.keymap.set("n", "w", "w", { silent = false, desc = "Save current buffer" }) 49 | vim.keymap.set("n", "q", "q", { silent = false, desc = "Quit current buffer" }) 50 | 51 | -- Map Oil to e 52 | vim.keymap.set("n", "e", function() 53 | require("oil").toggle_float() 54 | end, { desc = "Toggle Oil file explorer" }) 55 | 56 | -- Map Undotree 57 | vim.keymap.set("n", "ut", ":UndotreeToggle", { desc = "Toggle UndoTree" }) 58 | 59 | -- InspectTwoslashQueries 60 | vim.keymap.set("n", "ti", ":InspectTwoslashQueries", { desc = "[I]nspect [T]woslash Query" }) 61 | 62 | -- Center buffer while navigating 63 | vim.keymap.set("n", "", "zz", { desc = "Scroll up and center cursor" }) 64 | vim.keymap.set("n", "", "zz", { desc = "Scroll down and center cursor" }) 65 | vim.keymap.set("n", "{", "{zz", { desc = "Jump to previous paragraph and center" }) 66 | vim.keymap.set("n", "}", "}zz", { desc = "Jump to next paragraph and center" }) 67 | vim.keymap.set("n", "N", "Nzz", { desc = "Search previous and center" }) 68 | vim.keymap.set("n", "n", "nzz", { desc = "Search next and center" }) 69 | vim.keymap.set("n", "G", "Gzz", { desc = "Go to end of file and center" }) 70 | vim.keymap.set("n", "gg", "ggzz", { desc = "Go to beginning of file and center" }) 71 | vim.keymap.set("n", "gd", "gdzz", { desc = "Go to definition and center" }) 72 | vim.keymap.set("n", "", "zz", { desc = "Jump forward in jump list and center" }) 73 | vim.keymap.set("n", "", "zz", { desc = "Jump backward in jump list and center" }) 74 | vim.keymap.set("n", "%", "%zz", { desc = "Jump to matching bracket and center" }) 75 | vim.keymap.set("n", "*", "*zz", { desc = "Search for word under cursor and center" }) 76 | vim.keymap.set("n", "#", "#zz", { desc = "Search backward for word under cursor and center" }) 77 | 78 | -- Quick find/replace for word under cursor 79 | vim.keymap.set("n", "S", function() 80 | local cmd = ":%s///gI" 81 | local keys = vim.api.nvim_replace_termcodes(cmd, true, false, true) 82 | vim.api.nvim_feedkeys(keys, "n", false) 83 | end, { desc = "Quick find/replace word under cursor" }) 84 | 85 | -- Spectre for global find/replace 86 | vim.keymap.set("n", "S", function() 87 | require("spectre").toggle() 88 | end, { desc = "Toggle Spectre for global find/replace" }) 89 | 90 | -- Spectre for word under cursor (visual) 91 | vim.keymap.set("n", "sw", function() 92 | require("spectre").open_visual({ select_word = true }) 93 | end, { desc = "Search current word using Spectre" }) 94 | 95 | -- Jump to start/end of line 96 | vim.keymap.set("n", "L", "$", { desc = "Jump to end of line" }) 97 | vim.keymap.set("n", "H", "^", { desc = "Jump to beginning of line" }) 98 | 99 | -- Redo last change 100 | vim.keymap.set("n", "U", "", { desc = "Redo last change" }) 101 | 102 | -- Turn off highlighted search results 103 | vim.keymap.set("n", "no", "noh", { desc = "Toggle search highlighting" }) 104 | 105 | -- Code Companion 106 | vim.keymap.set( 107 | "n", 108 | "ai", 109 | "CodeCompanionChat Toggle", 110 | { desc = "Toggle Code Companion chat", noremap = true, silent = true } 111 | ) 112 | 113 | vim.keymap.set("n", "ts", function() 114 | if twoslash.config.is_enabled then 115 | vim.cmd("TwoslashQueriesDisable") 116 | Snacks.notify.info("Two Slash queries disabled") 117 | return 118 | end 119 | 120 | vim.cmd(":TwoslashQueriesEnable") 121 | Snacks.notify.info("Two Slash queries enabled") 122 | end, { desc = "Toggle [T]wo [S]lash queries" }) 123 | 124 | -- Diagnostics -- 125 | vim.keymap.set("n", "]d", function() 126 | vim.diagnostic.jump({ diagnostic = vim.diagnostic.get_next() }) 127 | vim.api.nvim_feedkeys("zz", "n", false) 128 | end, { desc = "Go to next diagnostic and center" }) 129 | 130 | vim.keymap.set("n", "[d", function() 131 | vim.diagnostic.jump({ diagnostic = vim.diagnostic.get_prev() }) 132 | vim.api.nvim_feedkeys("zz", "n", false) 133 | end, { desc = "Go to previous diagnostic and center" }) 134 | 135 | vim.keymap.set("n", "]e", function() 136 | vim.diagnostic.jump({ 137 | diagnostic = vim.diagnostic.get_next({ severity = vim.diagnostic.severity.ERROR }), 138 | }) 139 | vim.api.nvim_feedkeys("zz", "n", false) 140 | end, { desc = "Go to next error diagnostic and center" }) 141 | 142 | vim.keymap.set("n", "[e", function() 143 | vim.diagnostic.jump({ 144 | diagnostic = vim.diagnostic.get_prev({ severity = vim.diagnostic.severity.ERROR }), 145 | }) 146 | vim.api.nvim_feedkeys("zz", "n", false) 147 | end, { desc = "Go to previous error diagnostic and center" }) 148 | 149 | vim.keymap.set("n", "]w", function() 150 | vim.diagnostic.jump({ diagnostic = vim.diagnostic.get_next({ severity = vim.diagnostic.severity.WARN }) }) 151 | vim.api.nvim_feedkeys("zz", "n", false) 152 | end, { desc = "Go to next warning diagnostic and center" }) 153 | 154 | vim.keymap.set("n", "[w", function() 155 | vim.diagnostic.jump({ diagnostic = vim.diagnostic.get_prev({ severity = vim.diagnostic.severity.WARN }) }) 156 | vim.api.nvim_feedkeys("zz", "n", false) 157 | end, { desc = "Go to previous warning diagnostic and center" }) 158 | 159 | -- Diagnostic float and quickfix 160 | vim.keymap.set("n", "d", function() 161 | vim.diagnostic.open_float({ border = "rounded" }) 162 | end, { desc = "Open diagnostic float with rounded border" }) 163 | 164 | vim.keymap.set("n", "cd", copy_line_diagnostics_to_clipboard, { desc = "[C]opy line [D]iagnostics" }) 165 | 166 | vim.keymap.set("n", "ld", vim.diagnostic.setqflist, { desc = "Populate quickfix list with diagnostics" }) 167 | 168 | -- Quickfix navigation 169 | vim.keymap.set("n", "cn", ":cnextzz", { desc = "Go to next quickfix item and center" }) 170 | vim.keymap.set("n", "cp", ":cpreviouszz", { desc = "Go to previous quickfix item and center" }) 171 | vim.keymap.set("n", "co", ":copenzz", { desc = "Open quickfix list and center" }) 172 | vim.keymap.set("n", "cc", ":cclosezz", { desc = "Close quickfix list" }) 173 | 174 | -- Maximizer toggle and window resize 175 | vim.keymap.set("n", "m", ":MaximizerToggle", { desc = "Toggle window maximization" }) 176 | vim.keymap.set("n", "=", "=", { desc = "Equalize split window sizes" }) 177 | 178 | -- Format current buffer 179 | vim.keymap.set("n", "f", function() 180 | require("conform").format({ 181 | async = true, 182 | timeout_ms = 500, 183 | lsp_format = "fallback", 184 | }) 185 | end, { desc = "Format the current buffer" }) 186 | 187 | -- Rotate open windows 188 | vim.keymap.set("n", "rw", ":RotateWindows", { desc = "Rotate open windows" }) 189 | 190 | -- Open link under cursor 191 | vim.keymap.set("n", "gx", ":sil !open ", { silent = true, desc = "Open link under cursor" }) 192 | 193 | -- Run TypeScript compiler 194 | vim.keymap.set("n", "tc", ":TSC", { desc = "Run TypeScript compile" }) 195 | 196 | -- Harpoon keybinds -- 197 | vim.keymap.set("n", "ho", function() 198 | require("harpoon.ui").toggle_quick_menu() 199 | end, { desc = "Toggle Harpoon quick menu" }) 200 | 201 | vim.keymap.set("n", "ha", function() 202 | require("harpoon.mark").add_file() 203 | end, { desc = "Add current file to Harpoon" }) 204 | 205 | vim.keymap.set("n", "hr", function() 206 | require("harpoon.mark").rm_file() 207 | end, { desc = "Remove current file from Harpoon" }) 208 | 209 | vim.keymap.set("n", "hc", function() 210 | require("harpoon.mark").clear_all() 211 | end, { desc = "Clear all Harpoon marks" }) 212 | 213 | vim.keymap.set("n", "1", function() 214 | require("harpoon.ui").nav_file(1) 215 | end, { desc = "Navigate to Harpoon file 1" }) 216 | 217 | vim.keymap.set("n", "2", function() 218 | require("harpoon.ui").nav_file(2) 219 | end, { desc = "Navigate to Harpoon file 2" }) 220 | 221 | vim.keymap.set("n", "3", function() 222 | require("harpoon.ui").nav_file(3) 223 | end, { desc = "Navigate to Harpoon file 3" }) 224 | 225 | vim.keymap.set("n", "4", function() 226 | require("harpoon.ui").nav_file(4) 227 | end, { desc = "Navigate to Harpoon file 4" }) 228 | 229 | vim.keymap.set("n", "5", function() 230 | require("harpoon.ui").nav_file(5) 231 | end, { desc = "Navigate to Harpoon file 5" }) 232 | 233 | -- Telescope keybinds -- 234 | vim.keymap.set("n", "?", require("telescope.builtin").oldfiles, { desc = "Find recently opened files" }) 235 | 236 | vim.keymap.set("n", "sb", require("telescope.builtin").buffers, { desc = "Search open buffers" }) 237 | 238 | vim.keymap.set("n", "sf", function() 239 | require("telescope.builtin").find_files({ hidden = true }) 240 | end, { desc = "Find files (including hidden)" }) 241 | 242 | vim.keymap.set("n", "sh", require("telescope.builtin").help_tags, { desc = "Search help tags" }) 243 | 244 | vim.keymap.set("n", "sg", require("telescope.builtin").live_grep, { desc = "Live grep search" }) 245 | 246 | vim.keymap.set("n", "sc", require("telescope.builtin").git_bcommits, { desc = "[S]earch buffer [C]ommits" }) 247 | 248 | vim.keymap.set("n", "/", function() 249 | require("telescope.builtin").current_buffer_fuzzy_find( 250 | require("telescope.themes").get_dropdown({ previewer = false }) 251 | ) 252 | end, { desc = "Fuzzily search in current buffer" }) 253 | 254 | vim.keymap.set("n", "ss", function() 255 | require("telescope.builtin").spell_suggest(require("telescope.themes").get_dropdown({ previewer = false })) 256 | end, { desc = "Spell suggestions search" }) 257 | 258 | -- LSP Keybinds (per-buffer) 259 | M.map_lsp_keybinds = function(buffer_number) 260 | vim.keymap.set("n", "rn", vim.lsp.buf.rename, { desc = "LSP: Rename symbol", buffer = buffer_number }) 261 | vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "LSP: Code action", buffer = buffer_number }) 262 | vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "LSP: Go to definition", buffer = buffer_number }) 263 | vim.keymap.set( 264 | "n", 265 | "gr", 266 | require("telescope.builtin").lsp_references, 267 | { desc = "LSP: Go to references", buffer = buffer_number } 268 | ) 269 | vim.keymap.set( 270 | "n", 271 | "gi", 272 | require("telescope.builtin").lsp_implementations, 273 | { desc = "LSP: Go to implementations", buffer = buffer_number } 274 | ) 275 | vim.keymap.set( 276 | "n", 277 | "bs", 278 | require("telescope.builtin").lsp_document_symbols, 279 | { desc = "LSP: Document symbols", buffer = buffer_number } 280 | ) 281 | vim.keymap.set( 282 | "n", 283 | "ps", 284 | require("telescope.builtin").lsp_workspace_symbols, 285 | { desc = "LSP: Workspace symbols", buffer = buffer_number } 286 | ) 287 | 288 | local signature_help = function() 289 | return vim.lsp.buf.signature_help({ border = "rounded" }) 290 | end 291 | 292 | local hover = function() 293 | return vim.lsp.buf.hover({ border = "rounded" }) 294 | end 295 | 296 | vim.keymap.set("n", "K", hover, { desc = "LSP: Signature help", buffer = buffer_number }) 297 | 298 | vim.keymap.set("i", "", signature_help, { desc = "LSP: Signature help", buffer = buffer_number }) 299 | vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "LSP: Go to declaration", buffer = buffer_number }) 300 | vim.keymap.set("n", "td", vim.lsp.buf.type_definition, { desc = "LSP: Type definition", buffer = buffer_number }) 301 | end 302 | 303 | -- Symbol Outline keybind 304 | vim.keymap.set("n", "so", ":SymbolsOutline", { desc = "Toggle symbol outline" }) 305 | 306 | -- Toggle inlay hints 307 | -- vim.keymap.set("n", "ih", function() 308 | -- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({})) 309 | -- end, { desc = "Toggle [i]nlay [h]ints" }) 310 | 311 | -- Insert Mode -- 312 | vim.keymap.set("i", "jj", "", { desc = "Exit insert mode (jj)" }) 313 | vim.keymap.set("i", "JJ", "", { desc = "Exit insert mode (JJ)" }) 314 | 315 | -- Visual Mode -- 316 | vim.keymap.set("v", "", "", { desc = "Disable space (leader) in visual mode" }) 317 | vim.keymap.set("v", "L", "$", { desc = "Move to end of line in visual mode" }) 318 | vim.keymap.set("v", "H", "^", { desc = "Move to beginning of line in visual mode" }) 319 | vim.keymap.set("v", "", ":m '>+1gv=gv", { desc = "Move selected block down" }) 320 | vim.keymap.set("v", "", ":m '<-2gv=gv", { desc = "Move selected block up" }) 321 | 322 | -- Code Companion 323 | vim.keymap.set( 324 | "x", 325 | "ai", 326 | "'<,'>CodeCompanion", 327 | { desc = "Prompt Code Companion on the current selection", noremap = true, silent = true } 328 | ) 329 | 330 | vim.keymap.set("x", "p", '"_dP', { desc = "Paste without overwriting register" }) 331 | 332 | -- This keymap indents the selected visual block to the left and reselects it 333 | vim.keymap.set("x", "<<", function() 334 | vim.cmd("normal! <<") 335 | vim.cmd("normal! gv") 336 | end, { desc = "Indent left and reselect visual block" }) 337 | vim.keymap.set("x", "<<", function() 338 | vim.cmd("normal! <<") 339 | vim.cmd("normal! gv") 340 | end, { desc = "Indent left and reselect visual block" }) 341 | 342 | vim.keymap.set("x", ">>", function() 343 | vim.cmd("normal! >>") 344 | vim.cmd("normal! gv") 345 | end, { desc = "Indent right and reselect visual block" }) 346 | 347 | return M 348 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/lazy.lua: -------------------------------------------------------------------------------- 1 | -- Lazy install bootstrap snippet 2 | -- Bootstrap lazy.nvim 3 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 4 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 5 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 6 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 7 | if vim.v.shell_error ~= 0 then 8 | vim.api.nvim_echo({ 9 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 10 | { out, "WarningMsg" }, 11 | { "\nPress any key to exit..." }, 12 | }, true, {}) 13 | vim.fn.getchar() 14 | os.exit(1) 15 | end 16 | end 17 | 18 | vim.opt.rtp:prepend(lazypath) 19 | 20 | local lazy = require("lazy") 21 | 22 | lazy.setup({ 23 | spec = { 24 | { import = "plugins" }, 25 | }, 26 | change_detection = { 27 | enabled = true, 28 | notify = true, 29 | }, 30 | checker = { enabled = true }, 31 | }) 32 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/ocaml_extensions.lua: -------------------------------------------------------------------------------- 1 | -- Register various ocaml related syntax extensions 2 | vim.filetype.add({ 3 | extension = { 4 | mli = "ocaml.interface", 5 | mly = "ocaml.menhir", 6 | mll = "ocaml.ocamllex", 7 | mlx = "ocaml", 8 | t = "ocaml.cram", 9 | }, 10 | }) 11 | 12 | -- If you have `ocaml_interface` parser installed, it will use it for `ocaml.interface` files 13 | vim.treesitter.language.register("ocaml_interface", "ocaml.interface") 14 | vim.treesitter.language.register("menhir", "ocaml.menhir") 15 | vim.treesitter.language.register("ocaml_interface", "ocaml.interface") 16 | vim.treesitter.language.register("cram", "ocaml.cram") 17 | vim.treesitter.language.register("ocamllex", "ocaml.ocamllex") 18 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/options.lua: -------------------------------------------------------------------------------- 1 | -- Enable relative line numbers 2 | vim.opt.nu = true 3 | vim.opt.rnu = true 4 | 5 | -- Disable showing the mode below the statusline 6 | vim.opt.showmode = false 7 | 8 | -- Set tabs to 2 spaces 9 | vim.opt.tabstop = 2 10 | vim.opt.softtabstop = 2 11 | vim.opt.expandtab = true 12 | 13 | -- Enable auto indenting and set it to spaces 14 | vim.opt.smartindent = true 15 | vim.opt.shiftwidth = 2 16 | 17 | -- Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) 18 | vim.opt.breakindent = true 19 | 20 | -- Enable incremental searching 21 | vim.opt.incsearch = true 22 | vim.opt.hlsearch = true 23 | 24 | -- Disable text wrap 25 | vim.opt.wrap = false 26 | 27 | -- Set leader key to space 28 | vim.g.mapleader = " " 29 | vim.g.maplocalleader = " " 30 | 31 | -- Better splitting 32 | vim.opt.splitbelow = true 33 | vim.opt.splitright = true 34 | 35 | -- Enable mouse mode 36 | vim.opt.mouse = "a" 37 | 38 | -- Enable ignorecase + smartcase for better searching 39 | vim.opt.ignorecase = true 40 | vim.opt.smartcase = true 41 | 42 | -- Decrease updatetime to 250ms 43 | vim.opt.updatetime = 250 44 | 45 | -- Set completeopt to have a better completion experience 46 | vim.opt.completeopt = { "menu", "menuone", "noselect" } 47 | 48 | -- Enable persistent undo history 49 | vim.opt.undofile = true 50 | 51 | -- Enable 24-bit color 52 | vim.opt.termguicolors = true 53 | 54 | -- Enable the sign column to prevent the screen from jumping 55 | vim.opt.signcolumn = "yes" 56 | 57 | -- Enable access to System Clipboard 58 | vim.opt.clipboard = "unnamed,unnamedplus" 59 | 60 | -- Enable cursor line highlight 61 | vim.opt.cursorline = true 62 | 63 | -- Set fold settings 64 | -- These options were reccommended by nvim-ufo 65 | -- See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration 66 | vim.opt.foldcolumn = "0" 67 | vim.opt.foldenable = true 68 | vim.opt.foldlevel = 99 69 | vim.opt.foldlevelstart = 99 70 | vim.opt.foldnestmax = 5 71 | vim.opt.foldtext = "" 72 | 73 | -- Always keep 8 lines above/below cursor unless at start/end of file 74 | vim.opt.scrolloff = 8 75 | 76 | -- Place a column line 77 | vim.opt.colorcolumn = "80" 78 | 79 | vim.opt.guicursor = { 80 | "n-v-c:block", -- Normal, visual, command-line: block cursor 81 | "i-ci-ve:ver25", -- Insert, command-line insert, visual-exclude: vertical bar cursor with 25% width 82 | "r-cr:hor20", -- Replace, command-line replace: horizontal bar cursor with 20% height 83 | "o:hor50", -- Operator-pending: horizontal bar cursor with 50% height 84 | "a:blinkwait700-blinkoff400-blinkon250", -- All modes: blinking settings 85 | "sm:block-blinkwait175-blinkoff150-blinkon175", -- Showmatch: block cursor with specific blinking settings 86 | } 87 | 88 | -- Enable virtual lines for diagnostics 89 | vim.diagnostic.config({ 90 | float = { border = "rounded" }, 91 | virtual_text = true, 92 | -- virtual_text = { current_line = true }, 93 | virtual_lines = false, 94 | }) 95 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/prelude.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | --- Returns the current cursor position. 4 | --- @param opts? { zero_indexed?: boolean } Optional. A table of options with the following field: 5 | --- zero_indexed (boolean): if true, the returned row will be 0-indexed. 6 | --- @return { row: integer, col: integer } A table with keys `row` and `col`. 7 | local function get_cursor_position(opts) 8 | opts = opts or {} 9 | local zero_indexed = opts.zero_indexed or false 10 | 11 | -- Get the current window's cursor position. 12 | -- vim.api.nvim_win_get_cursor returns a table with { row, col } 13 | local pos = vim.api.nvim_win_get_cursor(0) 14 | 15 | if zero_indexed then 16 | -- Adjust the row to be 0-indexed. 17 | return { row = pos[1] - 1, col = pos[2] } 18 | else 19 | return { row = pos[1], col = pos[2] } 20 | end 21 | end 22 | 23 | M.get_cursor_position = get_cursor_position 24 | 25 | local function copy_line_diagnostics_to_clipboard() 26 | -- Get the current buffer and cursor position 27 | local bufnr = vim.api.nvim_get_current_buf() 28 | local line = get_cursor_position({ zero_indexed = true }).row 29 | 30 | -- Get diagnostics for the current line 31 | local diagnostics = vim.diagnostic.get(bufnr, { lnum = line }) 32 | 33 | if #diagnostics == 0 then 34 | print("No diagnostics on the current line.") 35 | Snacks.notify.info("No diagnostics on the current line.") 36 | return 37 | end 38 | 39 | -- Format diagnostics into a single string 40 | local diagnostic_messages = {} 41 | for _, diagnostic in ipairs(diagnostics) do 42 | table.insert(diagnostic_messages, diagnostic.message) 43 | end 44 | local result = table.concat(diagnostic_messages, "\n") 45 | 46 | -- Copy the result to the system clipboard 47 | vim.fn.setreg("+", result) 48 | Snacks.notify.info("Diagnostics copied to clipboard.") 49 | end 50 | 51 | M.copy_line_diagnostics_to_clipboard = copy_line_diagnostics_to_clipboard 52 | 53 | return M 54 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/rotate_windows.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("RotateWindows", function() 2 | local ignored_filetypes = { "neo-tree", "fidget", "Outline", "toggleterm", "qf", "notify" } 3 | local window_numbers = vim.api.nvim_tabpage_list_wins(0) 4 | local windows_to_rotate = {} 5 | 6 | for _, window_number in ipairs(window_numbers) do 7 | local buffer_number = vim.api.nvim_win_get_buf(window_number) 8 | local filetype = vim.bo[buffer_number].filetype 9 | 10 | if not vim.tbl_contains(ignored_filetypes, filetype) then 11 | table.insert(windows_to_rotate, { window_number = window_number, buffer_number = buffer_number }) 12 | end 13 | end 14 | 15 | local num_eligible_windows = vim.tbl_count(windows_to_rotate) 16 | 17 | if num_eligible_windows == 0 then 18 | return 19 | elseif num_eligible_windows == 1 then 20 | vim.api.nvim_err_writeln("There is no other window to rotate with.") 21 | return 22 | elseif num_eligible_windows == 2 then 23 | local firstWindow = windows_to_rotate[1] 24 | local secondWindow = windows_to_rotate[2] 25 | 26 | vim.api.nvim_win_set_buf(firstWindow.window_number, secondWindow.buffer_number) 27 | vim.api.nvim_win_set_buf(secondWindow.window_number, firstWindow.buffer_number) 28 | else 29 | vim.api.nvim_err_writeln("You can only swap 2 open windows. Found " .. num_eligible_windows .. ".") 30 | end 31 | end, {}) 32 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/set_file_type.lua: -------------------------------------------------------------------------------- 1 | -- Create a command 'sft' as a proxy for ':setfiletype' 2 | vim.api.nvim_create_user_command("SFT", function(opts) 3 | vim.cmd("setfiletype " .. opts.args) 4 | end, { 5 | nargs = 1, -- Expect exactly one argument 6 | complete = "filetype", -- Provide filetype completion 7 | desc = "Proxy command for setfiletype", 8 | }) 9 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/toggle_diagnostics.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("ToggleDiagnostics", function() 2 | Snacks.toggle.diagnostics():toggle() 3 | end, {}) 4 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/dmmulroy/vertical_help.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("FileType", { 2 | group = vim.api.nvim_create_augroup("vertical_help", { clear = true }), 3 | pattern = "help", 4 | callback = function() 5 | vim.bo.bufhidden = "unload" 6 | vim.cmd.wincmd("L") 7 | vim.cmd.wincmd("=") 8 | end, 9 | }) 10 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/cloak.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "laytan/cloak.nvim", 4 | lazy = false, 5 | config = function() 6 | require("cloak").setup({ 7 | patterns = { 8 | { 9 | file_pattern = "**/*.env*", 10 | cloak_pattern = "=.+", 11 | }, 12 | { 13 | file_pattern = "**/*.opencode.json", 14 | cloak_pattern = '("apiKey":) .+', 15 | replace = "%1 ", 16 | }, 17 | }, 18 | }) 19 | end, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/codecompanion.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "olimorris/codecompanion.nvim", 4 | event = "VeryLazy", 5 | opts = { 6 | adapters = { 7 | openai = function() 8 | return require("codecompanion.adapters").extend("openai", { 9 | env = { 10 | api_key = "OPENAI_API_KEY", 11 | }, 12 | }) 13 | end, 14 | }, 15 | }, 16 | dependencies = { 17 | "nvim-lua/plenary.nvim", 18 | "nvim-treesitter/nvim-treesitter", 19 | }, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/color-scheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "catppuccin/nvim", 4 | lazy = false, 5 | priority = 1000, 6 | config = function() 7 | require("catppuccin").setup({ 8 | integrations = { 9 | blink_cmp = true, 10 | fidget = true, 11 | gitsigns = true, 12 | harpoon = true, 13 | indent_blankline = { 14 | enabled = false, 15 | scope_color = "sapphire", 16 | colored_indent_levels = false, 17 | }, 18 | mason = true, 19 | native_lsp = { enabled = true }, 20 | noice = true, 21 | notify = true, 22 | symbols_outline = true, 23 | snacks = { 24 | enabled = true, 25 | indent_scope_color = "mauve", 26 | }, 27 | telescope = true, 28 | treesitter = true, 29 | treesitter_context = true, 30 | }, 31 | }) 32 | local palette = require("catppuccin.palettes").get_palette("macchiato") 33 | 34 | vim.cmd.colorscheme("catppuccin-macchiato") 35 | 36 | vim.api.nvim_set_hl(0, "BlinkCmpMenu", { bg = palette.base }) 37 | vim.api.nvim_set_hl(0, "BlinkCmpMenuBorder", { fg = palette.blue }) 38 | vim.api.nvim_set_hl(0, "BlinkCmpDoc", { bg = palette.base }) 39 | vim.api.nvim_set_hl(0, "BlinkCmpDocBorder", { fg = palette.blue }) 40 | vim.api.nvim_set_hl(0, "BlinkCmpSignatureHelp", { bg = palette.base }) 41 | vim.api.nvim_set_hl(0, "BlinkCmpSignatureHelpBorder", { fg = palette.blue }) 42 | vim.api.nvim_set_hl(0, "BlinkCmpDocSeparator", { fg = palette.blue, bg = palette.base }) 43 | vim.api.nvim_set_hl(0, "BlinkCmpGhostText", { fg = palette.overlay2 }) 44 | 45 | -- Hide all semantic highlights until upstream issues are resolved (https://github.com/catppuccin/nvim/issues/480) 46 | for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do 47 | vim.api.nvim_set_hl(0, group, {}) 48 | end 49 | end, 50 | }, 51 | } 52 | 53 | -- rosewater = "#f4dbd6", 54 | -- flamingo = "#f0c6c6", 55 | -- pink = "#f5bde6", 56 | -- mauve = "#c6a0f6", 57 | -- red = "#ed8796", 58 | -- maroon = "#ee99a0", 59 | -- peach = "#f5a97f", 60 | -- yellow = "#eed49f", 61 | -- green = "#a6da95", 62 | -- teal = "#8bd5ca", 63 | -- sky = "#91d7e3", 64 | -- sapphire = "#7dc4e4", 65 | -- blue = "#8aadf4", 66 | -- lavender = "#b7bdf8", 67 | -- text = "#cad3f5", 68 | -- subtext1 = "#b8c0e0", 69 | -- subtext0 = "#a5adcb", 70 | -- overlay2 = "#939ab7", 71 | -- overlay1 = "#8087a2", 72 | -- overlay0 = "#6e738d", 73 | -- surface2 = "#5b6078", 74 | -- surface1 = "#494d64", 75 | -- surface0 = "#363a4f", 76 | -- base = "#24273a", 77 | -- mantle = "#1e2030", 78 | -- crust = "#181926", 79 | --#919ABA 80 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/copilot.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "zbirenbaum/copilot.lua", 4 | cmd = "Copilot", 5 | lazy = true, 6 | event = "InsertEnter", 7 | config = function() 8 | require("copilot").setup({}) 9 | end, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/dressing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "stevearc/dressing.nvim", 4 | config = function() 5 | require("dressing").setup() 6 | end, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/fidget.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | 4 | "j-hui/fidget.nvim", 5 | event = { "BufEnter" }, 6 | config = function() 7 | -- Turn on LSP, formatting, and linting status and progress information 8 | require("fidget").setup({ 9 | notification = { 10 | window = { 11 | winblend = 0, 12 | }, 13 | }, 14 | progress = { 15 | display = { 16 | progress_icon = { "dots_negative" }, 17 | }, 18 | }, 19 | }) 20 | end, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "lewis6991/gitsigns.nvim", 4 | lazy = true, 5 | event = { "BufEnter" }, 6 | config = function() 7 | require("gitsigns").setup() 8 | end, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "ThePrimeagen/harpoon", 4 | lazy = true, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | event = { "BufReadPost" }, 5 | cmd = { "LspInfo", "LspInstall", "LspUninstall", "Mason" }, 6 | dependencies = { 7 | -- LSP installer plugins 8 | "williamboman/mason.nvim", 9 | "williamboman/mason-lspconfig.nvim", 10 | "WhoIsSethDaniel/mason-tool-installer.nvim", 11 | -- Integrate blink w/ LSP 12 | "hrsh7th/cmp-nvim-lsp", 13 | -- Progress indicator for LSP 14 | { "j-hui/fidget.nvim" }, 15 | }, 16 | config = function() 17 | local map_lsp_keybinds = require("dmmulroy.keymaps").map_lsp_keybinds 18 | 19 | local vtsls_inlay_hints = { 20 | enumMemberValues = { enabled = true }, 21 | functionLikeReturnTypes = { enabled = true }, 22 | functionParameterTypes = { enabled = true }, 23 | parameterNames = { enabled = "all" }, 24 | parameterNameWhenArgumentMatchesNames = { enabled = true }, 25 | propertyDeclarationTypes = { enabled = true }, 26 | variableTypes = { enabled = true }, 27 | variableTypeWhenTypeMatchesNames = { enabled = true }, 28 | } 29 | 30 | -- on_attach: call your custom keymap binding function 31 | local on_attach = function(_client, buffer_number) 32 | map_lsp_keybinds(buffer_number) 33 | end 34 | 35 | -- List your LSP servers here. 36 | local servers = { 37 | bashls = {}, 38 | biome = {}, 39 | cssls = {}, 40 | gleam = { 41 | settings = { inlayHints = true }, 42 | }, 43 | eslint = { 44 | autostart = false, 45 | cmd = { "vscode-eslint-language-server", "--stdio", "--max-old-space-size=12288" }, 46 | settings = { format = false }, 47 | }, 48 | html = {}, 49 | jsonls = {}, 50 | lua_ls = { 51 | settings = { 52 | Lua = { 53 | runtime = { version = "LuaJIT" }, 54 | workspace = { 55 | checkThirdParty = false, 56 | library = { 57 | "${3rd}/luv/library", 58 | unpack(vim.api.nvim_get_runtime_file("", true)), 59 | }, 60 | }, 61 | telemetry = { enabled = false }, 62 | }, 63 | }, 64 | }, 65 | marksman = {}, 66 | ocamllsp = { 67 | manual_install = true, 68 | cmd = { "dune", "exec", "ocamllsp" }, 69 | settings = { 70 | codelens = { enable = true }, 71 | inlayHints = { enable = true }, 72 | syntaxDocumentation = { enable = true }, 73 | }, 74 | }, 75 | nil_ls = {}, 76 | pyright = {}, 77 | sqlls = {}, 78 | tailwindcss = { 79 | filetypes = { "typescriptreact", "javascriptreact", "html", "svelte" }, 80 | }, 81 | vtsls = { 82 | on_attach = function(client, buffer_number) 83 | require("twoslash-queries").attach(client, buffer_number) 84 | return on_attach(client, buffer_number) 85 | end, 86 | settings = { 87 | complete_function_calls = true, 88 | vtsls = { 89 | autoUseWorkspaceTsdk = true, 90 | experimental = { 91 | completion = { 92 | enableServerSideFuzzyMatch = true, 93 | }, 94 | }, 95 | }, 96 | typescript = { 97 | updateImportOnFileMove = { enabled = "always" }, 98 | suggest = { 99 | completeFunctionCalls = true, 100 | }, 101 | tsserver = { 102 | maxTsServerMemory = 12288, 103 | }, 104 | inlayHints = vtsls_inlay_hints, 105 | }, 106 | javascript = { inlayHints = vtsls_inlay_hints }, 107 | }, 108 | }, 109 | yamlls = {}, 110 | svelte = {}, 111 | rust_analyzer = { 112 | check = { command = "clippy", features = "all" }, 113 | }, 114 | } 115 | 116 | local formatters = { 117 | prettierd = {}, 118 | stylua = {}, 119 | } 120 | 121 | local manually_installed_servers = { "ocamllsp", "gleam", "rust_analyzer" } 122 | local mason_tools_to_install = vim.tbl_keys(vim.tbl_deep_extend("force", {}, servers, formatters)) 123 | local ensure_installed = vim.tbl_filter(function(name) 124 | return not vim.tbl_contains(manually_installed_servers, name) 125 | end, mason_tools_to_install) 126 | 127 | require("mason-tool-installer").setup({ 128 | auto_update = true, 129 | run_on_start = true, 130 | start_delay = 3000, 131 | debounce_hours = 12, 132 | ensure_installed = ensure_installed, 133 | }) 134 | 135 | -- LSP servers and clients are able to communicate to each other what features they support. 136 | -- By default, Neovim doesn't support everything that is in the LSP specification. 137 | -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. 138 | -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. 139 | local capabilities = vim.lsp.protocol.make_client_capabilities() 140 | capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) 141 | 142 | -- Setup each LSP server. We merge in any server-specific capabilities by passing 143 | -- the existing config.capabilities to blink.cmp.get_lsp_capabilities. 144 | for name, config in pairs(servers) do 145 | require("lspconfig")[name].setup({ 146 | autostart = config.autostart, 147 | cmd = config.cmd, 148 | capabilities = capabilities, 149 | filetypes = config.filetypes, 150 | handlers = vim.tbl_deep_extend("force", {}, config.handlers or {}), 151 | on_attach = config.on_attach or on_attach, 152 | settings = config.settings, 153 | root_dir = config.root_dir, 154 | }) 155 | end 156 | 157 | -- Setup Mason for managing external LSP servers 158 | require("mason").setup({ ui = { border = "rounded" } }) 159 | require("mason-lspconfig").setup() 160 | 161 | -- Configure borders for LspInfo UI and diagnostics 162 | require("lspconfig.ui.windows").default_options.border = "rounded" 163 | end, 164 | }, 165 | { 166 | "stevearc/conform.nvim", 167 | event = { "BufWritePre" }, 168 | cmd = { "ConformInfo" }, 169 | opts = { 170 | notify_on_error = false, 171 | default_format_opts = { 172 | async = true, 173 | timeout_ms = 500, 174 | lsp_format = "fallback", 175 | }, 176 | format_after_save = { 177 | async = true, 178 | timeout_ms = 500, 179 | lsp_format = "fallback", 180 | }, 181 | formatters_by_ft = { 182 | javascript = { "biome" }, 183 | typescript = { "biome" }, 184 | typescriptreact = { "biome" }, 185 | svelte = { "prettierd", "prettier " }, 186 | lua = { "stylua" }, 187 | }, 188 | }, 189 | }, 190 | } 191 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-lualine/lualine.nvim", 4 | event = "VeryLazy", 5 | config = function() 6 | local harpoon = require("harpoon.mark") 7 | 8 | local function truncate_branch_name(branch) 9 | if not branch or branch == "" then 10 | return "" 11 | end 12 | 13 | -- Match the branch name to the specified format 14 | local user, team, ticket_number = string.match(branch, "^(%w+)/(%w+)%-(%d+)") 15 | 16 | -- If the branch name matches the format, display {user}/{team}-{ticket_number}, otherwise display the full branch name 17 | if ticket_number then 18 | return user .. "/" .. team .. "-" .. ticket_number 19 | else 20 | return branch 21 | end 22 | end 23 | 24 | local function harpoon_component() 25 | local total_marks = harpoon.get_length() 26 | 27 | if total_marks == 0 then 28 | return "" 29 | end 30 | 31 | local current_mark = "—" 32 | 33 | local mark_idx = harpoon.get_current_index() 34 | if mark_idx ~= nil then 35 | current_mark = tostring(mark_idx) 36 | end 37 | 38 | return string.format("󱡅 %s/%d", current_mark, total_marks) 39 | end 40 | 41 | require("lualine").setup({ 42 | options = { 43 | theme = "catppuccin", 44 | globalstatus = true, 45 | component_separators = { left = "", right = "" }, 46 | section_separators = { left = "█", right = "█" }, 47 | }, 48 | sections = { 49 | lualine_b = { 50 | { "branch", icon = "", fmt = truncate_branch_name }, 51 | harpoon_component, 52 | "diff", 53 | "diagnostics", 54 | }, 55 | lualine_c = { 56 | { "filename", path = 1 }, 57 | }, 58 | lualine_x = { 59 | "filetype", 60 | }, 61 | }, 62 | }) 63 | end, 64 | }, 65 | } 66 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/luasnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "L3MON4D3/LuaSnip", 4 | event = "InsertEnter", 5 | build = (function() 6 | if vim.fn.executable("make") == 0 then 7 | return 8 | end 9 | return "make install_jsregexp" 10 | end)(), 11 | dependencies = { 12 | { 13 | "rafamadriz/friendly-snippets", 14 | config = function() 15 | require("luasnip.loaders.from_vscode").lazy_load() 16 | require("luasnip.loaders.from_vscode").lazy_load({ 17 | paths = { vim.fn.stdpath("config") .. "/snippets" }, 18 | }) 19 | end, 20 | }, 21 | }, 22 | config = function() 23 | local ls = require("luasnip") 24 | 25 | ls.config.set_config({ 26 | history = true, 27 | updateevents = "TextChanged,TextChangedI", 28 | }) 29 | end, 30 | }, 31 | } 32 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-autopairs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "windwp/nvim-autopairs", 3 | event = "InsertEnter", 4 | dependencies = { "hrsh7th/nvim-cmp" }, 5 | config = function() 6 | require("nvim-autopairs").setup({}) 7 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 8 | local cmp = require("cmp") 9 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) 10 | end, 11 | } 12 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "hrsh7th/nvim-cmp", 4 | event = { "InsertEnter" }, 5 | dependencies = { 6 | "hrsh7th/cmp-nvim-lsp", 7 | "hrsh7th/cmp-buffer", 8 | "hrsh7th/cmp-path", 9 | "hrsh7th/cmp-nvim-lsp-signature-help", 10 | "saadparwaiz1/cmp_luasnip", 11 | "onsails/lspkind.nvim", 12 | "L3MON4D3/LuaSnip", 13 | }, 14 | config = function() 15 | local cmp = require("cmp") 16 | local luasnip = require("luasnip") 17 | local format_item_with_lspkind = require("lspkind").cmp_format({ 18 | mode = "symbol_text", 19 | maxwidth = 50, 20 | ellipsis_char = "...", 21 | menu = { 22 | nvim_lsp = "[LSP]", 23 | buffer = "[Buffer]", 24 | path = "[Path]", 25 | luasnip = "[Snippet]", 26 | nvim_lsp_signature_help = "[Signature]", 27 | }, 28 | }) 29 | 30 | luasnip.config.setup({}) 31 | 32 | cmp.setup({ 33 | snippet = { 34 | expand = function(args) 35 | luasnip.lsp_expand(args.body) 36 | end, 37 | }, 38 | window = { 39 | completion = cmp.config.window.bordered(), 40 | documentation = cmp.config.window.bordered(), 41 | }, 42 | completion = { completeopt = "menu,menuone,noinsert" }, 43 | mapping = cmp.mapping.preset.insert({ 44 | [""] = cmp.mapping.select_prev_item(), -- previous suggestion 45 | [""] = cmp.mapping.select_next_item(), -- next suggestion 46 | [""] = cmp.mapping(function(fallback) 47 | if cmp.visible() then 48 | cmp.select_next_item() 49 | elseif luasnip.expand_or_jumpable(1) then 50 | luasnip.expand_or_jump(1) 51 | else 52 | fallback() 53 | end 54 | end, { "i", "s" }), 55 | [""] = cmp.mapping(function(fallback) 56 | if cmp.visible() then 57 | cmp.select_prev_item() 58 | elseif luasnip.jumpable(-1) then 59 | luasnip.jump(-1) 60 | else 61 | fallback() 62 | end 63 | end, { "i", "s" }), 64 | [""] = cmp.mapping.scroll_docs(-4), -- scroll up preview 65 | [""] = cmp.mapping.scroll_docs(4), -- scroll down preview 66 | [""] = cmp.mapping.complete({}), -- show completion suggestions 67 | [""] = cmp.mapping.abort(), -- close completion window 68 | [""] = cmp.mapping.confirm({ select = true }), 69 | }), 70 | 71 | -- sources for autocompletion 72 | sources = cmp.config.sources({ 73 | { name = "nvim_lsp", group_index = 1 }, -- lsp 74 | { name = "buffer", max_item_count = 5, group_index = 2 }, -- text within current buffer 75 | { name = "path", max_item_count = 3, group_index = 3 }, -- file system paths 76 | { name = "luasnip", max_item_count = 3, group_index = 5 }, -- snippets 77 | { name = "nvim-lsp-signature-help" }, 78 | }), 79 | -- Enable pictogram icons for lsp/autocompletion 80 | formatting = { 81 | expandable_indicator = true, 82 | format = function(entry, item) 83 | local color_item = require("nvim-highlight-colors").format(entry, { kind = item.kind }) 84 | item = format_item_with_lspkind(entry, item) 85 | 86 | if color_item.abbr_hl_group then 87 | item.kind_hl_group = color_item.abbr_hl_group 88 | item.kind = color_item.abbr 89 | end 90 | 91 | return item 92 | end, 93 | }, 94 | experimental = { 95 | ghost_text = true, 96 | }, 97 | }) 98 | end, 99 | }, 100 | } 101 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-highlight-colors.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "brenoprata10/nvim-highlight-colors", 4 | event = { "BufReadPre", "BufNewFile" }, 5 | opts = { 6 | ---Render style 7 | ---@usage 'background'|'foreground'|'virtual' 8 | render = "background", 9 | 10 | ---Highlight hex colors, e.g. '#FFFFFF' 11 | enable_hex = true, 12 | 13 | ---Highlight short hex colors e.g. '#fff' 14 | enable_short_hex = true, 15 | 16 | ---Highlight rgb colors, e.g. 'rgb(0 0 0)' 17 | enable_rgb = true, 18 | 19 | ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' 20 | enable_hsl = true, 21 | 22 | ---Highlight CSS variables, e.g. 'var(--testing-color)' 23 | enable_var_usage = true, 24 | 25 | ---Highlight named colors, e.g. 'green' 26 | enable_named_colors = true, 27 | 28 | ---Highlight tailwind colors, e.g. 'bg-blue-500' 29 | enable_tailwind = true, 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-tmux-navigator.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "alexghergh/nvim-tmux-navigation", 4 | config = function() 5 | require("nvim-tmux-navigation").setup({ 6 | disable_when_zoomed = true, 7 | }) 8 | end, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-ts-autotag.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "windwp/nvim-ts-autotag", 3 | } 4 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/nvim-web-devicons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-tree/nvim-web-devicons", 4 | opts = {}, 5 | config = function() 6 | require("nvim-web-devicons").setup({ 7 | override = { 8 | gleam = { 9 | icon = "", 10 | color = "#ffaff3", 11 | name = "Gleam", 12 | }, 13 | }, 14 | }) 15 | end, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/oil.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd("FileType", { 2 | pattern = "oil", 3 | callback = function() 4 | vim.opt_local.colorcolumn = "" 5 | end, 6 | }) 7 | 8 | return { 9 | { 10 | "stevearc/oil.nvim", 11 | opts = {}, 12 | -- Optional dependencies 13 | dependencies = { "nvim-tree/nvim-web-devicons" }, 14 | config = function() 15 | require("oil").setup({ 16 | -- use_default_keymaps = false, 17 | keymaps = { 18 | [""] = { "actions.select", opts = { vertical = true } }, 19 | }, 20 | view_options = { 21 | show_hidden = true, 22 | }, 23 | }) 24 | end, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/render-markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "MeanderingProgrammer/render-markdown.nvim", 4 | dependencies = { "nvim-treesitter/nvim-treesitter" }, -- if you use the mini.nvim suite 5 | opts = { 6 | code = { 7 | sign = false, 8 | width = "block", 9 | right_pad = 1, 10 | }, 11 | heading = { 12 | sign = false, 13 | icons = {}, 14 | }, 15 | }, 16 | ft = { "markdown", "norg", "rmd", "org" }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/snacks.lua: -------------------------------------------------------------------------------- 1 | local filtered_message = { "No information available" } 2 | 3 | return { 4 | { 5 | "folke/snacks.nvim", 6 | priority = 1000, 7 | lazy = false, 8 | 9 | ---@type snacks.Config 10 | opts = { 11 | bigfile = { enabled = true }, 12 | bufdelete = { enabled = true }, 13 | dim = { enabled = true }, 14 | gitbrowse = { enabled = true }, 15 | indent = { enabled = true }, 16 | input = { enabled = true }, 17 | notifier = { 18 | enabled = true, 19 | timeout = 3000, 20 | style = "fancy", 21 | }, 22 | toggle = { enabled = true }, 23 | scratch = { enabled = true }, 24 | statuscolumn = { enabled = true }, 25 | words = { enabled = true }, 26 | }, 27 | 28 | init = function() 29 | vim.api.nvim_create_autocmd("User", { 30 | pattern = "VeryLazy", 31 | callback = function() 32 | local notify = Snacks.notifier.notify 33 | ---@diagnostic disable-next-line: duplicate-set-field 34 | Snacks.notifier.notify = function(message, level, opts) 35 | for _, msg in ipairs(filtered_message) do 36 | if message == msg then 37 | return nil 38 | end 39 | end 40 | return notify(message, level, opts) 41 | end 42 | end, 43 | }) 44 | 45 | vim.api.nvim_create_autocmd("User", { 46 | pattern = "OilActionsPost", 47 | callback = function(event) 48 | if event.data.actions.type == "move" then 49 | Snacks.rename.on_rename_file(event.data.actions.src_url, event.data.actions.dest_url) 50 | end 51 | end, 52 | }) 53 | end, 54 | keys = { 55 | { 56 | "bd", 57 | function() 58 | Snacks.bufdelete() 59 | end, 60 | desc = "[B]uffer [D]elete", 61 | }, 62 | { 63 | "og", 64 | function() 65 | Snacks.gitbrowse() 66 | end, 67 | desc = "[O]pen [G]it", 68 | mode = { "n", "v" }, 69 | }, 70 | { 71 | "nh", 72 | function() 73 | Snacks.notifier.show_history() 74 | end, 75 | desc = "[N]otification [H]istory", 76 | }, 77 | { 78 | "nd", 79 | function() 80 | Snacks.notifier.hide() 81 | end, 82 | desc = "[N]otifications [D]ismiss", 83 | }, 84 | { 85 | "nh", 86 | function() 87 | Snacks.notifier.show_history() 88 | end, 89 | desc = "[N]otification [H]istory", 90 | }, 91 | { 92 | "ln", 93 | function() 94 | Snacks.toggle.option("relativenumber", { name = "Relative Number" }):toggle() 95 | end, 96 | desc = "Toggle Relative [L]ine [N]umbers", 97 | }, 98 | { 99 | "cl", 100 | function() 101 | Snacks.toggle.option("cursorline", { name = "Cursor Line" }):toggle() 102 | end, 103 | desc = "Toggle [C]ursor [L]ine", 104 | }, 105 | { 106 | "td", 107 | function() 108 | Snacks.toggle.diagnostics():toggle() 109 | end, 110 | desc = "[T]oggle [D]iagnostics", 111 | }, 112 | { 113 | "zm", 114 | function() 115 | Snacks.toggle.dim():toggle() 116 | end, 117 | desc = "Toggle Dim Mode", 118 | }, 119 | { 120 | "tw", 121 | function() 122 | Snacks.toggle.option("wrap"):toggle() 123 | end, 124 | desc = "[T]oggle line [W]rap", 125 | }, 126 | { 127 | "tx", 128 | function() 129 | local tsc = require("treesitter-context") 130 | Snacks.toggle({ 131 | name = "Treesitter Context", 132 | get = tsc.enabled, 133 | set = function(state) 134 | if state then 135 | tsc.enable() 136 | else 137 | tsc.disable() 138 | end 139 | end, 140 | }):toggle() 141 | end, 142 | desc = "Toggle [T]reesitter Conte[x]t", 143 | }, 144 | { 145 | "ih", 146 | function() 147 | Snacks.toggle({ 148 | name = "Inlay Hints", 149 | get = function() 150 | return vim.lsp.inlay_hint.is_enabled() 151 | end, 152 | set = function(state) 153 | if state then 154 | vim.lsp.inlay_hint.enable(true) 155 | else 156 | vim.lsp.inlay_hint.enable(false) 157 | end 158 | end, 159 | }):toggle() 160 | end, 161 | desc = "Toggle [I]nlay [H]ints", 162 | }, 163 | { 164 | "hl", 165 | function() 166 | local hc = require("nvim-highlight-colors") 167 | Snacks.toggle({ 168 | name = "Highlight Colors", 169 | get = function() 170 | return hc.is_active() 171 | end, 172 | set = function(state) 173 | if state then 174 | hc.turnOn() 175 | else 176 | hc.turnOff() 177 | end 178 | end, 179 | }):toggle() 180 | end, 181 | desc = "Toggle [H]igh[L]ight Colors", 182 | }, 183 | { 184 | ".", 185 | function() 186 | Snacks.scratch() 187 | end, 188 | desc = "Toggle Scratch Buffer", 189 | }, 190 | { 191 | "s.", 192 | function() 193 | Snacks.scratch.select() 194 | end, 195 | 196 | desc = "Search Scratch Buffers", 197 | }, 198 | }, 199 | }, 200 | } 201 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/spectre.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-pack/nvim-spectre", 4 | lazy = true, 5 | cmd = { "Spectre" }, 6 | dependencies = { 7 | "nvim-lua/plenary.nvim", 8 | "catppuccin/nvim", 9 | }, 10 | config = function() 11 | local theme = require("catppuccin.palettes").get_palette("macchiato") 12 | 13 | vim.api.nvim_set_hl(0, "SpectreSearch", { bg = theme.red, fg = theme.base }) 14 | vim.api.nvim_set_hl(0, "SpectreReplace", { bg = theme.green, fg = theme.base }) 15 | 16 | require("spectre").setup({ 17 | highlight = { 18 | search = "SpectreSearch", 19 | replace = "SpectreReplace", 20 | }, 21 | mapping = { 22 | ["send_to_qf"] = { 23 | map = "", 24 | cmd = "lua require('spectre.actions').send_to_qf()", 25 | desc = "send all items to quickfix", 26 | }, 27 | }, 28 | -- replace_engine = { 29 | -- sed = { 30 | -- cmd = "sed", 31 | -- args = { 32 | -- "-i", 33 | -- "", 34 | -- "-E", 35 | -- }, 36 | -- }, 37 | -- }, 38 | }) 39 | end, 40 | }, 41 | } 42 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/symbols-outline.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "simrat39/symbols-outline.nvim", 4 | cmd = { "SymbolsOutline", "SymbolsOutlineOpen", "SymbolsOutlineClose" }, 5 | config = function() 6 | require("symbols-outline").setup({ 7 | symbols = { 8 | File = { icon = "", hl = "@text.uri" }, 9 | Module = { icon = "", hl = "@namespace" }, 10 | Namespace = { icon = "", hl = "@namespace" }, 11 | Package = { icon = "", hl = "@namespace" }, 12 | Class = { icon = "", hl = "@type" }, 13 | Method = { icon = "ƒ", hl = "@method" }, 14 | Property = { icon = "", hl = "@method" }, 15 | Field = { icon = "", hl = "@field" }, 16 | Constructor = { icon = "", hl = "@constructor" }, 17 | Enum = { icon = "", hl = "@type" }, 18 | Interface = { icon = "", hl = "@type" }, 19 | Function = { icon = "", hl = "@function" }, 20 | Variable = { icon = "", hl = "@constant" }, 21 | Constant = { icon = "", hl = "@constant" }, 22 | String = { icon = "", hl = "@string" }, 23 | Number = { icon = "#", hl = "@number" }, 24 | Boolean = { icon = "", hl = "@boolean" }, 25 | Array = { icon = "", hl = "@constant" }, 26 | Object = { icon = "", hl = "@type" }, 27 | Key = { icon = "", hl = "@type" }, 28 | Null = { icon = "", hl = "@type" }, 29 | EnumMember = { icon = "", hl = "@field" }, 30 | Struct = { icon = "", hl = "@type" }, 31 | Event = { icon = "", hl = "@type" }, 32 | Operator = { icon = "", hl = "@operator" }, 33 | TypeParameter = { icon = "", hl = "@parameter" }, 34 | Component = { icon = "", hl = "@function" }, 35 | Fragment = { icon = "", hl = "@constant" }, 36 | }, 37 | }) 38 | end, 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-telescope/telescope.nvim", 4 | branch = "master", 5 | dependencies = { 6 | "nvim-lua/plenary.nvim", 7 | { 8 | "nvim-telescope/telescope-fzf-native.nvim", 9 | build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", 10 | cond = vim.fn.executable("cmake") == 1, 11 | }, 12 | }, 13 | config = function() 14 | local actions = require("telescope.actions") 15 | 16 | require("telescope").setup({ 17 | defaults = { 18 | mappings = { 19 | i = { 20 | [""] = actions.move_selection_previous, 21 | [""] = actions.move_selection_next, 22 | [""] = actions.send_selected_to_qflist + actions.open_qflist, 23 | [""] = actions.delete_buffer, 24 | }, 25 | }, 26 | file_ignore_patterns = { 27 | "node_modules", 28 | "yarn.lock", 29 | ".git", 30 | ".sl", 31 | "_build", 32 | ".next", 33 | }, 34 | hidden = true, 35 | path_display = { 36 | "filename_first", 37 | }, 38 | }, 39 | }) 40 | 41 | -- Enable telescope fzf native, if installed 42 | pcall(require("telescope").load_extension, "fzf") 43 | end, 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | build = function() 5 | require("nvim-treesitter.install").update({ with_sync = true }) 6 | end, 7 | event = { "BufEnter" }, 8 | config = function() 9 | ---@diagnostic disable: missing-fields 10 | require("nvim-treesitter.configs").setup({ 11 | ensure_installed = { 12 | "bash", 13 | "css", 14 | "gleam", 15 | "go", 16 | "html", 17 | "javascript", 18 | "json", 19 | "lua", 20 | "markdown", 21 | "markdown_inline", 22 | "ocaml", 23 | "ocaml_interface", 24 | "rust", 25 | "svelte", 26 | "terraform", 27 | "tsx", 28 | "typescript", 29 | "vimdoc", 30 | "yaml", 31 | }, 32 | sync_install = false, 33 | highlight = { 34 | enable = true, 35 | }, 36 | indent = { 37 | enable = true, 38 | disable = { "ocaml", "ocaml_interface" }, 39 | }, 40 | autopairs = { 41 | enable = true, 42 | }, 43 | autotag = { 44 | enable = true, 45 | }, 46 | incremental_selection = { 47 | enable = true, 48 | keymaps = { 49 | init_selection = "", 50 | node_incremental = "", 51 | scope_incremental = "", 52 | node_decremental = "", 53 | }, 54 | }, 55 | textobjects = { 56 | select = { 57 | enable = true, 58 | lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim 59 | keymaps = { 60 | -- You can use the capture groups defined in textobjects.scm 61 | ["aa"] = "@parameter.outer", 62 | ["ia"] = "@parameter.inner", 63 | ["af"] = "@function.outer", 64 | ["if"] = "@function.inner", 65 | ["ac"] = "@class.outer", 66 | ["ic"] = "@class.inner", 67 | }, 68 | }, 69 | move = { 70 | enable = true, 71 | set_jumps = true, -- whether to set jumps in the jumplist 72 | goto_next_start = { 73 | ["]m"] = "@function.outer", 74 | ["]]"] = "@class.outer", 75 | }, 76 | goto_next_end = { 77 | ["]M"] = "@function.outer", 78 | ["]["] = "@class.outer", 79 | }, 80 | goto_previous_start = { 81 | ["[m"] = "@function.outer", 82 | ["[["] = "@class.outer", 83 | }, 84 | goto_previous_end = { 85 | ["[M"] = "@function.outer", 86 | ["[]"] = "@class.outer", 87 | }, 88 | }, 89 | }, 90 | }) 91 | end, 92 | }, 93 | { 94 | -- Additional text objects for treesitter 95 | "nvim-treesitter/nvim-treesitter-textobjects", 96 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 97 | }, 98 | { 99 | "nvim-treesitter/nvim-treesitter-context", 100 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 101 | config = function() 102 | local tsc = require("treesitter-context") 103 | 104 | tsc.setup({ 105 | enable = false, 106 | max_lines = 1, 107 | trim_scope = "inner", 108 | }) 109 | end, 110 | }, 111 | } 112 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/tsc.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "dmmulroy/tsc.nvim", 4 | lazy = true, 5 | ft = { "typescript", "typescriptreact" }, 6 | config = function() 7 | require("tsc").setup({ 8 | auto_open_qflist = true, 9 | pretty_errors = false, 10 | }) 11 | end, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/two-slash.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "marilari88/twoslash-queries.nvim", 4 | event = "VeryLazy", 5 | config = function() 6 | require("twoslash-queries").setup({ 7 | multi_line = true, 8 | is_enabled = false, 9 | highlight = "Comment", 10 | }) 11 | end, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/ufo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "kevinhwang91/nvim-ufo", 4 | event = "BufEnter", 5 | dependencies = { 6 | "kevinhwang91/promise-async", 7 | }, 8 | config = function() 9 | --- @diagnostic disable: unused-local 10 | require("ufo").setup({ 11 | provider_selector = function(_bufnr, _filetype, _buftype) 12 | return { "treesitter", "indent" } 13 | end, 14 | }) 15 | end, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/undotree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mbbill/undotree", 4 | event = { "BufReadPost" }, 5 | lazy = true, 6 | config = function() 7 | if vim.fn.has("persistent_undo") == 1 then 8 | local target_path = vim.fn.expand("~/.config/nvim/.undodir") 9 | vim.opt.undodir = target_path 10 | vim.opt.undofile = true 11 | end 12 | end, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/vim-maximizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "szw/vim-maximizer", 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/vim-surround.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "tpope/vim-surround", 4 | event = "VeryLazy", 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/which-key.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/which-key.nvim", 4 | event = "VeryLazy", 5 | opts = { 6 | delay = 400, 7 | filter = function(mapping) 8 | return mapping.desc ~= "Disable space (leader) in normal mode" 9 | end, 10 | }, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /home/.config/nvim/lua/plugins/wilder.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "gelguy/wilder.nvim", 4 | keys = { 5 | ":", 6 | "/", 7 | "?", 8 | }, 9 | dependencies = { 10 | "catppuccin/nvim", 11 | }, 12 | build = function() 13 | vim.fn["UpdateRemotePlugins"]() 14 | end, 15 | config = function() 16 | local wilder = require("wilder") 17 | local macchiato = require("catppuccin.palettes").get_palette("macchiato") 18 | 19 | -- Create a highlight group for the popup menu 20 | local text_highlight = 21 | wilder.make_hl("WilderText", { { a = 1 }, { a = 1 }, { foreground = macchiato.text } }) 22 | local mauve_highlight = 23 | wilder.make_hl("WilderMauve", { { a = 1 }, { a = 1 }, { foreground = macchiato.mauve } }) 24 | 25 | -- Enable wilder when pressing :, / or ? 26 | wilder.setup({ modes = { ":", "/", "?" } }) 27 | 28 | -- Enable fuzzy matching for commands and buffers 29 | wilder.set_option("pipeline", { 30 | wilder.branch( 31 | wilder.cmdline_pipeline({ 32 | fuzzy = 1, 33 | }), 34 | wilder.vim_search_pipeline({ 35 | fuzzy = 1, 36 | }) 37 | ), 38 | }) 39 | 40 | wilder.set_option( 41 | "renderer", 42 | wilder.popupmenu_renderer(wilder.popupmenu_border_theme({ 43 | highlighter = wilder.basic_highlighter(), 44 | highlights = { 45 | default = text_highlight, 46 | border = mauve_highlight, 47 | accent = mauve_highlight, 48 | }, 49 | pumblend = 5, 50 | min_width = "100%", 51 | min_height = "25%", 52 | max_height = "25%", 53 | border = "rounded", 54 | left = { " ", wilder.popupmenu_devicons() }, 55 | right = { " ", wilder.popupmenu_scrollbar() }, 56 | })) 57 | ) 58 | end, 59 | }, 60 | } 61 | -------------------------------------------------------------------------------- /home/.config/nvim/snippets/effect.ts.json: -------------------------------------------------------------------------------- 1 | { 2 | "Effect.gen": { 3 | "prefix": "gen", 4 | "body": [ 5 | "Effect.gen(function* () {", 6 | " $0", 7 | "}).pipe(Effect.withSpan($1));" 8 | ], 9 | "description": "Effect.gen" 10 | }, 11 | "Effect.fn": { 12 | "prefix": "fn", 13 | "body": [ 14 | "Effect.fn($1)(function* ($2) {", 15 | " $0", 16 | "});" 17 | ], 18 | "description": "Effect.fn" 19 | }, 20 | "Effect.fnUntraced": { 21 | "prefix": "fn", 22 | "body": [ 23 | "Effect.fnUntraced(function* ($1) {", 24 | " $0", 25 | "});" 26 | ], 27 | "description": "Effect.fnUntraced" 28 | }, 29 | "Context.Tag": { 30 | "prefix": "Tag", 31 | "body": [ 32 | "class $1 extends Context.Tag($2)<$1, $3>() {}", 33 | "$0" 34 | ], 35 | "description": "Context.Tag" 36 | }, 37 | "Schema.TaggerError": { 38 | "prefix": "Err", 39 | "body": [ 40 | "class $1 extends Schema.TaggedError<$1>()($1, {", 41 | "$0", 42 | "}) {}" 43 | ], 44 | "description": "Schema.TaggerError" 45 | }, 46 | "Generic Effect fn": { 47 | "prefix": "(effect: Effect.Effect) => {", 50 | " $0", 51 | "}" 52 | ], 53 | "description": "Generic Effect fn" 54 | }, 55 | "Effect.Effect": { 56 | "prefix": "Effect.E", 57 | "body": [ 58 | "Effect.Effect<$1, $2, $3>" 59 | ], 60 | "description": "Effect.Effect" 61 | }, 62 | "Option.Option": { 63 | "prefix": "Option.O", 64 | "body": [ 65 | "Option.Option<$1>" 66 | ], 67 | "description": "Option.Option" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /home/.config/nvim/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dmmulroy-snippets", 3 | "engines": { 4 | "vscode": "^1.0.0" 5 | }, 6 | "contributes": { 7 | "snippets": [ 8 | { 9 | "language": "typescript", 10 | "path": "./effect.ts.json" 11 | }, 12 | { 13 | "language": "javascript", 14 | "path": "./effect.ts.json" 15 | }, 16 | { 17 | "language": "typescript", 18 | "path": "./typescript.json" 19 | } 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /home/.config/nvim/snippets/typescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "Readonly<{}>": { 3 | "prefix": "type", 4 | "body": [ 5 | "type $1 = Readonly<{", 6 | " $0", 7 | "}>;" 8 | ], 9 | "description": "Readonly<{}>" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /home/.config/starship.toml: -------------------------------------------------------------------------------- 1 | [buf] 2 | disabled = true 3 | 4 | [character] 5 | error_symbol = "[󰘧](bold red)" 6 | success_symbol = "[󰘧](bold green)" 7 | 8 | [directory] 9 | truncate_to_repo = false 10 | 11 | [dotnet] 12 | detect_files = ["global.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"] 13 | 14 | [git_branch] 15 | symbol = " " 16 | truncation_length = 18 17 | 18 | [golang] 19 | symbol = " " 20 | 21 | [lua] 22 | symbol = " " 23 | 24 | [nix_shell] 25 | symbol = " " 26 | 27 | [package] 28 | disabled = true 29 | -------------------------------------------------------------------------------- /home/.config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # vim: set ft=tmux: 2 | 3 | # tmux sensible see: https://github.com/tmux-plugins/tmux-sensible?tab=readme-ov-file#options 4 | # Address vim mode switching delay (http://superuser.com/a/252717/65504) 5 | set -s escape-time 0 6 | 7 | # Increase scrollback buffer size from 2000 to 50000 lines 8 | set -g history-limit 50000 9 | 10 | # Increase tmux messages display duration from 750ms to 4s 11 | set -g display-time 4000 12 | 13 | # Refresh 'status-left' and 'status-right' more often, from every 15s to 5s 14 | set -g status-interval 5 15 | 16 | # Upgrade $TERM 17 | set -g default-terminal "tmux-256color" 18 | 19 | # Emacs key bindings in tmux command prompt (prefix + :) are better than 20 | # vi keys, even for vim users 21 | set -g status-keys emacs 22 | 23 | # Focus events enabled for terminals that support them 24 | set -g focus-events on 25 | 26 | # Super useful when using "grouped sessions" and multi-monitor setup 27 | setw -g aggressive-resize on 28 | 29 | 30 | # Config 31 | 32 | # Set shell to fish 33 | set-option -g default-shell /opt/homebrew/bin/fish 34 | 35 | # Unbind as the prefix key 36 | unbind C-b 37 | 38 | # Bind as the prefix key 39 | unbind C-\; 40 | set -g prefix C-\; 41 | bind \; send-prefix 42 | 43 | # Enable mouse support 44 | set -g mouse on 45 | 46 | # Bind kim keys to resizing panes 47 | bind -r - resize-pane -D 2 48 | bind -r = resize-pane -U 2 49 | bind -r 0 resize-pane -R 2 50 | bind -r 9 resize-pane -L 2 51 | 52 | # Unbind + Rebind window splits 53 | unbind % 54 | unbind '"' 55 | bind \\ split-window -h -c "#{pane_current_path}" 56 | bind Enter split-window -v -c "#{pane_current_path}" 57 | bind c new-window -c "#{pane_current_path}" 58 | 59 | # Bind x to kill current pane 60 | bind x kill-pane 61 | 62 | # Bind m to maximize the current pane 63 | unbind z 64 | unbind m 65 | bind m resize-pane -Z 66 | 67 | # Bind r to reload tmux config 68 | unbind k 69 | bind r source-file ~/.config/tmux/tmux.conf \; display "Config reloaded 🚀" 70 | 71 | # Enable vim keys for copy mode 72 | set-window-option -g mode-keys vi 73 | 74 | bind V copy-mode 75 | 76 | bind -T copy-mode-vi V send-keys -X cancel 77 | 78 | unbind -T copy-mode-vi v 79 | 80 | bind -T copy-mode-vi v send-keys -X begin-selection 81 | 82 | bind -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle 83 | 84 | bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" 85 | 86 | bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" 87 | 88 | # make status bar on top 89 | set-option -g status-position top 90 | 91 | # start index from 1 92 | # Start windows and panes at 1, not 0 93 | set -g base-index 1 94 | set -g pane-base-index 1 95 | set-window-option -g pane-base-index 1 96 | set-option -g renumber-windows on 97 | 98 | # Enable switching panes while in copy-mode-vi 99 | bind -T copy-mode-vi 'C-h' select-pane -L 100 | bind -T copy-mode-vi 'C-j' select-pane -D 101 | bind -T copy-mode-vi 'C-k' select-pane -U 102 | bind -T copy-mode-vi 'C-l' select-pane -R 103 | bind -T copy-mode-vi 'C-\' select-pane -l 104 | bind -T copy-mode-vi 'C-Space' select-pane -t:.+ 105 | 106 | 107 | # Plugins 108 | set -g @plugin 'tmux-plugins/tpm' 109 | 110 | set -g @plugin 'christoomey/vim-tmux-navigator' 111 | 112 | set -g @plugin 'tmux-plugins/tmux-resurrect' 113 | set -g @resurrect-strategy-vim 'session' 114 | set -g @resurrect-strategy-nvim 'session' 115 | set -g @resurrect-capture-pane-contents 'on' 116 | 117 | set -g @plugin 'tmux-plugins/tmux-continuum' 118 | set -g @continuum-restore 'on' 119 | set -g @continuum-boot 'on' 120 | set -g @continuum-save-interval '10' 121 | 122 | # Theme 123 | 124 | set -g @plugin 'dmmulroy/catppuccin-tmux' 125 | set -g @catppuccin_flavour 'macchiato' 126 | 127 | set -g @catppuccin_window_status_enable "yes" 128 | set -g @catppuccin_window_status_icon_enable "yes" 129 | 130 | set -g @catppuccin_icon_window_zoom " " 131 | set -g @catppuccin_icon_window_last "null" 132 | set -g @catppuccin_icon_window_current "null" 133 | set -g @catppuccin_icon_window_mark "null" 134 | set -g @catppuccin_icon_window_silent "null" 135 | set -g @catppuccin_icon_window_activity "null" 136 | set -g @catppuccin_icon_window_bell "null" 137 | 138 | set -g @catppuccin_window_middle_separator "null" 139 | 140 | set -g @catppuccin_window_default_background "#cad3f5" 141 | set -g @catppuccin_window_default_color "#24273a" 142 | set -g @catppuccin_window_default_fill "all" 143 | set -g @catppuccin_window_default_text "#W" 144 | 145 | set -g @catppuccin_window_current_background "#363a4f" 146 | set -g @catppuccin_window_current_color "#c6a0f6" 147 | set -g @catppuccin_window_current_fill "number" 148 | set -g @catppuccin_window_current_text "#W" 149 | 150 | set -g @catppuccin_status_modules_right "directory session" 151 | set -g @catppuccin_maximized_text "null" 152 | set -g @catppuccin_status_left_separator "█" 153 | set -g @catppuccin_status_right_separator "█" 154 | set -g @catppuccin_directory_color "#8aadf4" 155 | 156 | # set -g pane-active-border-style fg="#c6a0f6" 157 | set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins' 158 | 159 | if "test ! -d ~/.config/tmux/plugins/tpm" \ 160 | "run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'" 161 | 162 | # This must be the last line of our config file 163 | run '~/.config/tmux/plugins/tpm/tpm' 164 | -------------------------------------------------------------------------------- /home/.ideavimrc: -------------------------------------------------------------------------------- 1 | " Set leader key to space (Note: Leader key mappings are already defined) 2 | let mapleader=" " 3 | 4 | " -- Normal -- 5 | " Disable Space bar since it'll be used as the leader key 6 | map 7 | 8 | " Save with leader key 9 | map w :w 10 | 11 | " Quit with leader key 12 | map q :q 13 | 14 | " Save and Quit with leader key 15 | map z :wq 16 | 17 | map f :action ReformatCode 18 | 19 | " Center buffer while navigating 20 | nnoremap zz 21 | nnoremap zz 22 | nnoremap { {zz 23 | nnoremap } }zz 24 | nnoremap N Nzz 25 | nnoremap n nzz 26 | nnoremap G Gzz 27 | nnoremap gg ggzz 28 | nnoremap gd gdzz 29 | nnoremap zz 30 | nnoremap zz 31 | nnoremap % %zz 32 | nnoremap * *zz 33 | nnoremap # #zz 34 | 35 | " Press 'H', 'L' to jump to start/end of a line (first/last char) 36 | nnoremap L $ 37 | nnoremap H ^ 38 | 39 | " Press 'U' for redo 40 | nnoremap U 41 | 42 | " Turn off highlighted results 43 | map no :noh 44 | 45 | " Diagnostics 46 | " Goto next diagnostic of any severity 47 | nnoremap ]d :call VimNextDiagnostic() 48 | 49 | " Goto previous diagnostic of any severity 50 | nnoremap [d :call VimPrevDiagnostic() 51 | 52 | " Goto next error diagnostic 53 | nnoremap ]e :call VimNextError() 54 | 55 | " Goto previous error diagnostic 56 | nnoremap [e :call VimPrevError() 57 | 58 | " Goto next warning diagnostic 59 | nnoremap ]w :call VimNextWarning() 60 | 61 | " Goto previous warning diagnostic 62 | nnoremap [w :call VimPrevWarning() 63 | 64 | " Open diagnostic under cursor 65 | map d :call VimDiagnosticUnderCursor() 66 | 67 | " -- Insert -- 68 | " Map jj to 69 | inoremap jj 70 | 71 | " -- Visual -- 72 | " Disable Space bar since it'll be used as the leader key 73 | vmap 74 | 75 | " Press 'H', 'L' to jump to start/end of a line (first/last char) 76 | vmap L $h 77 | vmap H ^ 78 | 79 | " Move text up and down 80 | vmap :m '>+1gv=gv 81 | vmap :m '<-2gv=gv 82 | 83 | " Paste without losing the contents of the register 84 | vmap p "_dP 85 | 86 | " Reselect the last visual selection and indent left 87 | xnoremap << :normal! < 88 | 89 | " Reselect the last visual selection and indent right 90 | xnoremap >> :normal! >>gv 91 | 92 | set number 93 | set relativenumber 94 | 95 | " Disable showing the mode below the statusline 96 | set noshowmode 97 | 98 | " Set tabs to 2 spaces 99 | set tabstop=2 100 | set softtabstop=2 101 | set expandtab 102 | 103 | " Enable auto indenting and set it to spaces 104 | set smartindent 105 | set shiftwidth=2 106 | 107 | " Enable smart indenting 108 | set breakindent 109 | 110 | " Enable incremental searching 111 | set incsearch 112 | set hlsearch 113 | 114 | " Disable text wrap 115 | set nowrap 116 | 117 | 118 | " Better splitting 119 | set splitbelow 120 | set splitright 121 | 122 | " Enable mouse mode 123 | set mouse=a 124 | 125 | " Enable ignorecase + smartcase for better searching 126 | set ignorecase 127 | set smartcase 128 | 129 | " Decrease updatetime to 250ms 130 | set updatetime=250 131 | 132 | " Set completeopt for better completion experience 133 | " IdeaVim does not have direct support for 'completeopt', so this may not fully apply. 134 | 135 | " Enable persistent undo history 136 | set undofile 137 | 138 | " Enable 24-bit color 139 | set termguicolors 140 | 141 | " Enable the sign column to prevent the screen from jumping 142 | set signcolumn=yes 143 | 144 | " Enable access to System Clipboard 145 | set clipboard=unnamed,unnamedplus 146 | 147 | " Enable cursor line highlight 148 | set cursorline 149 | 150 | " Set fold settings 151 | set foldlevel=99 152 | set foldlevelstart=99 153 | set foldenable 154 | set foldcolumn=0 155 | set foldnestmax=5 156 | " foldtext cannot be mapped directly in IdeaVim. 157 | 158 | " Always keep 8 lines above/below cursor unless at start/end of file 159 | set scrolloff=8 160 | 161 | " Place a column line at 80 characters 162 | set colorcolumn=80 163 | 164 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Function to check if a command exists 4 | command_exists() { 5 | command -v "$1" >/dev/null 2>&1 6 | } 7 | 8 | Step 1: Install Brew 9 | echo "Step 1: Installing Brew" 10 | if command_exists brew; then 11 | echo "Brew is already installed." 12 | else 13 | echo "Brew is not installed. Installing now..." 14 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 15 | if command_exists brew; then 16 | echo "Brew installation successful!" 17 | # Add brew to PATH for the current script session 18 | echo "Configuring Brew environment for this script session..." 19 | if [[ "$(uname -m)" == "arm64" ]]; then 20 | eval "$(/opt/homebrew/bin/brew shellenv)" 21 | else 22 | eval "$(/usr/local/bin/brew shellenv)" 23 | fi 24 | echo "Brew environment configured." 25 | else 26 | echo "Brew installation failed. Please check the output above for errors." 27 | exit 1 28 | fi 29 | fi 30 | 31 | # Step 2: Install base packages from Brewfile 32 | echo "Step 2: Installing base packages from Brewfile" 33 | if brew bundle --file=./packages/bundle; then 34 | echo "Base packages installed successfully." 35 | read -p "Do you want to install work-specific packages from ./packages/bundle.work? (y/N): " install_work_deps 36 | 37 | if [[ "$install_work_deps" =~ ^[Yy]$ ]]; then 38 | echo "Installing work packages..." 39 | if brew bundle --file=./packages/bundle.work; then 40 | echo "Work packages installed successfully." 41 | else 42 | echo "Failed to install work packages. Please check the output above." 43 | echo "Continuing initialization despite work package installation issues." 44 | fi 45 | else 46 | echo "Skipping work package installation." 47 | fi 48 | else 49 | echo "Failed to install base packages. Please check the output above." 50 | exit 1 51 | fi 52 | 53 | Step 3: Stow configuration files from ./home to ~ 54 | echo "Step 3: Stowing configuration files" 55 | # Ensure stow is available (it should be from the Brewfile) 56 | if command_exists stow; then 57 | echo "Running stow..." 58 | # Stow files from ./home into the HOME directory 59 | # -R: Re-stow, overwriting existing links if necessary 60 | # -v: Verbose output 61 | # -d .: Specifies the directory containing the package directories (stow dir) 62 | # -t $HOME: Specifies the target directory 63 | # home: The package directory within '.' to stow 64 | # We need to be in the parent directory of '.' for stow -d . to work correctly 65 | # Assuming the script is run from the root of the repo where '.' is located. 66 | if stow -R -v -d . -t "$HOME" home; then 67 | echo "Stow completed successfully." 68 | else 69 | echo "Stow command failed. Please check the output above." 70 | # Decide if this should be fatal. Let's allow continuation for now. 71 | echo "Continuing initialization despite stow failure." 72 | fi 73 | else 74 | echo "Stow command not found. Skipping stow step." 75 | echo "Please ensure stow was installed correctly in Step 2." 76 | fi 77 | 78 | # Step 4: Install Bun 79 | echo "Step 4: Installing Bun" 80 | if ! command_exists bun; then 81 | echo "Installing Bun..." && curl -fsSL https://bun.sh/install | bash; 82 | else echo "Bun already installed."; 83 | fi 84 | 85 | # Step 5: Generate GitHub SSH Key 86 | # echo "Step 5: Generating a new SSH key for GitHub" 87 | # echo "This key will be saved to ~/.ssh/id_ed25519_github" 88 | # echo "You will be prompted to enter a passphrase for the key." 89 | # echo "It is recommended to use a strong passphrase." 90 | # 91 | # # Define the key path 92 | # github_key_path="$HOME/.ssh/id_ed25519_github" 93 | # 94 | # # Check if the key already exists 95 | # if [ -f "$github_key_path" ]; then 96 | # echo "SSH key $github_key_path already exists. Skipping generation." 97 | # else 98 | # # Create the .ssh directory if it doesn't exist 99 | # mkdir -p "$HOME/.ssh" 100 | # chmod 700 "$HOME/.ssh" 101 | # 102 | # # Generate the SSH key 103 | # ssh-keygen -t ed25519 -C "dillon.mulroy@gmail.com" -f "$github_key_path" 104 | # 105 | # if [ $? -eq 0 ]; then 106 | # echo "SSH key generated successfully!" 107 | # echo "Please add the public key ($github_key_path.pub) to your GitHub account." 108 | # echo "You can copy the public key using:" 109 | # echo "pbcopy < $github_key_path.pub" 110 | # echo "Then go to GitHub > Settings > SSH and GPG keys > New SSH key." 111 | # else 112 | # echo "SSH key generation failed. Please check the output above." 113 | # # Decide if this should be a fatal error or not. Let's allow continuation. 114 | # echo "Continuing initialization despite SSH key generation failure." 115 | # fi 116 | # fi 117 | # 118 | # 119 | # # Step 6: Install MonoLisa Font 120 | # echo "Step 6: Installing MonoLisa Font" 121 | # 122 | # # Check if the key file exists before prompting 123 | # if [ ! -f "$github_key_path" ]; then 124 | # echo "GitHub SSH key ($github_key_path) not found. Skipping font installation." 125 | # echo "Please ensure Step 5 (SSH Key Generation) completed successfully or create the key manually." 126 | # else 127 | # read -p "Have you added the SSH public key ($github_key_path.pub) to your GitHub account? (y/N): " key_added_to_github 128 | # 129 | # if [[ "$key_added_to_github" =~ ^[Yy]$ ]]; then 130 | # echo "Attempting to clone the MonoLisa font repository..." 131 | # font_repo_url="git@github.com:dmmulroy/mono-lisa.git" 132 | # # Use a temporary directory for cloning 133 | # font_temp_dir=$(mktemp -d) 134 | # 135 | # # Clone using the specific SSH key 136 | # if GIT_SSH_COMMAND="ssh -i $github_key_path -o IdentitiesOnly=yes" git clone "$font_repo_url" "$font_temp_dir"; then 137 | # echo "Repository cloned successfully." 138 | # 139 | # # Define the macOS font directory 140 | # font_install_dir="$HOME/Library/Fonts" 141 | # mkdir -p "$font_install_dir" # Ensure the directory exists 142 | # 143 | # echo "Installing font files to $font_install_dir..." 144 | # # Find and copy font files (adjust pattern if needed, e.g., *.ttf) 145 | # find "$font_temp_dir" -name '*.otf' -exec cp {} "$font_install_dir/" \; 146 | # 147 | # if [ $? -eq 0 ]; then 148 | # echo "MonoLisa font files installed successfully." 149 | # echo "You may need to restart applications or log out/in for the font to be available everywhere." 150 | # else 151 | # echo "Failed to copy font files. Please check permissions for $font_install_dir." 152 | # fi 153 | # 154 | # # Clean up the temporary directory 155 | # echo "Cleaning up temporary directory..." 156 | # rm -rf "$font_temp_dir" 157 | # else 158 | # echo "Failed to clone the font repository. Please ensure:" 159 | # echo "1. The SSH key ($github_key_path) is correct and has been added to GitHub." 160 | # echo "2. You have access permissions to the repository: $font_repo_url" 161 | # echo "3. Git is installed and configured correctly." 162 | # # Clean up the potentially partially created temp directory 163 | # rm -rf "$font_temp_dir" 164 | # echo "Skipping font installation due to clone failure." 165 | # fi 166 | # else 167 | # echo "Skipping MonoLisa font installation because the SSH key was not confirmed to be added to GitHub." 168 | # fi 169 | # fi 170 | 171 | # Step 7: Set fish as the default and login shell 172 | 173 | echo "Step 7: Setting fish as the default and login shell" 174 | 175 | # Check if fish is installed 176 | if command_exists fish; then 177 | echo "Fish shell is installed." 178 | 179 | # Get the path to the fish binary 180 | fish_path=$(command -v fish) 181 | 182 | # Check if fish is already in /etc/shells 183 | if ! grep -q "$fish_path" /etc/shells; then 184 | echo "Adding $fish_path to /etc/shells" 185 | echo "$fish_path" | sudo tee -a /etc/shells 186 | else 187 | echo "Fish shell is already listed in /etc/shells." 188 | fi 189 | 190 | # Set fish as the default shell for the current user 191 | if [ "$SHELL" != "$fish_path" ]; then 192 | echo "Changing the default shell to fish for user $USER" 193 | chsh -s "$fish_path" 194 | echo "Default shell changed to fish. Please log out and log back in for changes to take effect." 195 | else 196 | echo "Fish is already the default shell." 197 | fi 198 | 199 | # Install jhillyerd/plugin-git using fisher 200 | echo "Installing jhillyerd/plugin-git with fisher" 201 | fish -c "fisher install jhillyerd/plugin-git" 202 | else 203 | echo "Fish shell is not installed. Please install it first using your package manager." 204 | fi 205 | 206 | 207 | 208 | echo "Initialization complete!" 209 | 210 | exit 0 211 | -------------------------------------------------------------------------------- /packages/bundle: -------------------------------------------------------------------------------- 1 | # set arguments for all 'brew install --cask' commands 2 | cask_args appdir: "~/Applications", require_sha: true 3 | 4 | brew "aider" 5 | brew "awscli" 6 | brew "cmake" 7 | brew "direnv" 8 | brew "doggo" 9 | brew "doppler" 10 | brew "fd" 11 | brew "fish" 12 | brew "fisher" 13 | brew "fzf" 14 | brew "fnm" 15 | brew "gnu-sed" 16 | brew "gpg2" 17 | brew "jq" 18 | brew "neovim" 19 | brew "ripgrep" 20 | brew "starship" 21 | brew "stow" 22 | brew "tmux" 23 | brew "tree" 24 | brew "wget" 25 | brew "zoxide" 26 | 27 | cask "arc" 28 | cask "cleanshot" 29 | cask "datagrip" 30 | cask "discord" 31 | cask "elgato-camera-hub" 32 | cask "elgato-control-center" 33 | cask "elgato-stream-deck" 34 | # cask "linear" 35 | cask "notion" 36 | cask "obs" 37 | cask "orbstack" 38 | cask "raycast" 39 | cask "scroll-reverser" 40 | cask "slack" 41 | # cask "spotify" 42 | cask "yaak@beta" 43 | 44 | -------------------------------------------------------------------------------- /packages/bundle.work: -------------------------------------------------------------------------------- 1 | brew "aws-iam-authenticator" 2 | brew "kubernetes-cli" 3 | --------------------------------------------------------------------------------