this repo has no description

initial dotfiles: zsh, nvim, tmux, wezterm, oh-my-posh

nix flakes + home-manager for portable shell experience.
strips homebrew/nvm/bun hardcoded paths in favor of nix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+2118
+2
.gitignore
··· 1 + result 2 + .direnv
+55
README.md
··· 1 + # dotfiles 2 + 3 + nix flakes + home-manager. portable across mac and linux. 4 + 5 + ## bootstrap 6 + 7 + ```bash 8 + # 1. install nix (if not present) 9 + curl -L https://nixos.org/nix/install | sh 10 + 11 + # 2. clone 12 + git clone https://tangled.sh/@zzstoatzz/dotfiles ~/dotfiles 13 + cd ~/dotfiles 14 + 15 + # 3. apply (detects system automatically) 16 + SYSTEM=$(nix eval --raw nixpkgs#system) 17 + nix run home-manager -- switch --flake ".#nate@${SYSTEM}" 18 + 19 + # 4. set zsh as default shell 20 + chsh -s $(which zsh) 21 + ``` 22 + 23 + ## what's included 24 + 25 + **shell**: zsh, oh-my-posh (zen theme), tmux, neovim (kickstart.nvim) 26 + **search/nav**: ripgrep, fd, fzf, jq, bat, eza, autojump 27 + **dev**: git, gh, curl, wget, tree, dust 28 + **languages**: uv (python), rustup (rust), go, node 22, deno, bun 29 + **terminal**: wezterm (linux only — on mac install via .dmg) 30 + **fonts**: fira code nerd font 31 + 32 + ## layout 33 + 34 + ``` 35 + flake.nix — nix entry point 36 + home.nix — packages + config symlinks 37 + config/ 38 + zsh/ — zshrc, aliases, utils 39 + nvim/ — kickstart.nvim config 40 + tmux/ — tmux.conf (prefix: ctrl-a) 41 + wezterm/ — wezterm.lua 42 + ohmyposh/ — zen.toml prompt theme 43 + atuin/ — shell history config 44 + git/ — portable gitconfig 45 + bin/ 46 + disk-breakdown — disk usage visualizer (macOS) 47 + ``` 48 + 49 + ## updating 50 + 51 + edit files in this repo, then: 52 + 53 + ```bash 54 + home-manager switch --flake . 55 + ```
+85
bin/disk-breakdown
··· 1 + #!/bin/bash 2 + # disk-breakdown: generate a visual breakdown of disk usage 3 + 4 + set -e 5 + 6 + # colors 7 + BOLD='\033[1m' 8 + DIM='\033[2m' 9 + RESET='\033[0m' 10 + GREEN='\033[32m' 11 + YELLOW='\033[33m' 12 + RED='\033[31m' 13 + 14 + # get disk info 15 + read -r SIZE USED AVAIL PERCENT <<< $(df -h /System/Volumes/Data | tail -1 | awk '{print $2, $3, $4, $5}') 16 + 17 + # color based on usage 18 + if [[ ${PERCENT%\%} -gt 90 ]]; then 19 + COLOR=$RED 20 + elif [[ ${PERCENT%\%} -gt 75 ]]; then 21 + COLOR=$YELLOW 22 + else 23 + COLOR=$GREEN 24 + fi 25 + 26 + echo "" 27 + echo -e "${BOLD}DISK: ${SIZE} total | ${COLOR}${USED} used${RESET} ${BOLD}| ${AVAIL} free (${PERCENT})${RESET}" 28 + echo "" 29 + 30 + # bar chart 31 + BAR_WIDTH=50 32 + USED_PCT=${PERCENT%\%} 33 + USED_BARS=$((USED_PCT * BAR_WIDTH / 100)) 34 + FREE_BARS=$((BAR_WIDTH - USED_BARS)) 35 + echo -n "[" 36 + printf "${COLOR}%0.s█${RESET}" $(seq 1 $USED_BARS) 2>/dev/null || true 37 + printf "${DIM}%0.s░${RESET}" $(seq 1 $FREE_BARS) 2>/dev/null || true 38 + echo "]" 39 + echo "" 40 + 41 + # home breakdown 42 + echo -e "${BOLD}~ breakdown:${RESET}" 43 + dust -d 1 ~ 2>/dev/null | grep -E "^\s*[0-9]+(\.[0-9]+)?[KMGT]?\s" | tail -20 44 + 45 + echo "" 46 + echo -e "${BOLD}other:${RESET}" 47 + echo " /Applications: $(dust -d 0 /Applications 2>/dev/null | awk '{print $1}')" 48 + echo " /opt: $(dust -d 0 /opt 2>/dev/null | awk '{print $1}')" 49 + 50 + # snapshots 51 + SNAPS=$(tmutil listlocalsnapshots / 2>/dev/null | grep -c "com.apple" || true) 52 + if [[ -n "$SNAPS" && "$SNAPS" -gt 0 ]]; then 53 + echo "" 54 + echo -e "${YELLOW}⚠ $SNAPS APFS snapshot(s) may be holding space${RESET}" 55 + fi 56 + 57 + # pending updates (skip if slow) 58 + if [[ "${1:-}" != "-q" ]]; then 59 + UPDATES=$(timeout 5 softwareupdate -l 2>&1 | grep -c "Label:" || true) 60 + if [[ -n "$UPDATES" && "$UPDATES" -gt 0 ]]; then 61 + echo -e "${YELLOW}⚠ $UPDATES pending update(s) - install to clear snapshots${RESET}" 62 + fi 63 + fi 64 + 65 + # docker check 66 + DOCKER_RAW="$HOME/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw" 67 + if [[ -f "$DOCKER_RAW" ]]; then 68 + ACTUAL=$(du -sh "$DOCKER_RAW" 2>/dev/null | awk '{print $1}') 69 + ALLOC=$(ls -lh "$DOCKER_RAW" 2>/dev/null | awk '{print $5}') 70 + echo "" 71 + echo -e "${DIM}docker: ${ACTUAL} actual / ${ALLOC} allocated${RESET}" 72 + fi 73 + 74 + # summary 75 + echo "" 76 + echo -e "${BOLD}totals:${RESET}" 77 + APFS_USED=$(diskutil apfs list 2>/dev/null | grep "Capacity In Use" | head -1 | grep -oE '[0-9.]+ GB' | head -1) 78 + APFS_FREE=$(diskutil apfs list 2>/dev/null | grep "Not Allocated" | head -1 | grep -oE '[0-9.]+ GB' | head -1) 79 + DATA_VOL=$(diskutil apfs list 2>/dev/null | grep -A3 "Role.*Data" | grep "Capacity Consumed" | grep -oE '[0-9.]+ GB') 80 + echo " APFS used: $APFS_USED" 81 + echo " APFS free: $APFS_FREE" 82 + echo " Data volume: $DATA_VOL" 83 + 84 + echo "" 85 + echo -e "${DIM}$(date '+%Y-%m-%d %H:%M')${RESET}"
+267
config/atuin/config.toml
··· 1 + ## where to store your database, default is your system data directory 2 + ## linux/mac: ~/.local/share/atuin/history.db 3 + ## windows: %USERPROFILE%/.local/share/atuin/history.db 4 + # db_path = "~/.history.db" 5 + 6 + ## where to store your encryption key, default is your system data directory 7 + ## linux/mac: ~/.local/share/atuin/key 8 + ## windows: %USERPROFILE%/.local/share/atuin/key 9 + # key_path = "~/.key" 10 + 11 + ## where to store your auth session token, default is your system data directory 12 + ## linux/mac: ~/.local/share/atuin/session 13 + ## windows: %USERPROFILE%/.local/share/atuin/session 14 + # session_path = "~/.session" 15 + 16 + ## date format used, either "us" or "uk" 17 + # dialect = "us" 18 + 19 + ## default timezone to use when displaying time 20 + ## either "l", "local" to use the system's current local timezone, or an offset 21 + ## from UTC in the format of "<+|->H[H][:M[M][:S[S]]]" 22 + ## for example: "+9", "-05", "+03:30", "-01:23:45", etc. 23 + # timezone = "local" 24 + 25 + ## enable or disable automatic sync 26 + # auto_sync = true 27 + 28 + ## enable or disable automatic update checks 29 + # update_check = true 30 + 31 + ## address of the sync server 32 + # sync_address = "https://api.atuin.sh" 33 + 34 + ## how often to sync history. note that this is only triggered when a command 35 + ## is ran, so sync intervals may well be longer 36 + ## set it to 0 to sync after every command 37 + # sync_frequency = "10m" 38 + 39 + ## which search mode to use 40 + ## possible values: prefix, fulltext, fuzzy, skim 41 + # search_mode = "fuzzy" 42 + 43 + ## which filter mode to use by default 44 + ## possible values: "global", "host", "session", "directory", "workspace" 45 + ## consider using search.filters to customize the enablement and order of filter modes 46 + # filter_mode = "global" 47 + 48 + ## With workspace filtering enabled, Atuin will filter for commands executed 49 + ## in any directory within a git repository tree (default: false). 50 + ## 51 + ## To use workspace mode by default when available, set this to true and 52 + ## set filter_mode to "workspace" or leave it unspecified and 53 + ## set search.filters to include "workspace" before other filter modes. 54 + # workspaces = false 55 + 56 + ## which filter mode to use when atuin is invoked from a shell up-key binding 57 + ## the accepted values are identical to those of "filter_mode" 58 + ## leave unspecified to use same mode set in "filter_mode" 59 + # filter_mode_shell_up_key_binding = "global" 60 + 61 + ## which search mode to use when atuin is invoked from a shell up-key binding 62 + ## the accepted values are identical to those of "search_mode" 63 + ## leave unspecified to use same mode set in "search_mode" 64 + # search_mode_shell_up_key_binding = "fuzzy" 65 + 66 + ## which style to use 67 + ## possible values: auto, full, compact 68 + # style = "auto" 69 + 70 + ## the maximum number of lines the interface should take up 71 + ## set it to 0 to always go full screen 72 + # inline_height = 0 73 + 74 + ## Invert the UI - put the search bar at the top , Default to `false` 75 + # invert = false 76 + 77 + ## enable or disable showing a preview of the selected command 78 + ## useful when the command is longer than the terminal width and is cut off 79 + # show_preview = true 80 + 81 + ## what to do when the escape key is pressed when searching 82 + ## possible values: return-original, return-query 83 + # exit_mode = "return-original" 84 + 85 + ## possible values: emacs, subl 86 + # word_jump_mode = "emacs" 87 + 88 + ## characters that count as a part of a word 89 + # word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 90 + 91 + ## number of context lines to show when scrolling by pages 92 + # scroll_context_lines = 1 93 + 94 + ## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts 95 + ## alt-0 .. alt-9 96 + # ctrl_n_shortcuts = false 97 + 98 + ## default history list format - can also be specified with the --format arg 99 + # history_format = "{time}\t{command}\t{duration}" 100 + 101 + ## prevent commands matching any of these regexes from being written to history. 102 + ## Note that these regular expressions are unanchored, i.e. if they don't start 103 + ## with ^ or end with $, they'll match anywhere in the command. 104 + ## For details on the supported regular expression syntax, see 105 + ## https://docs.rs/regex/latest/regex/#syntax 106 + # history_filter = [ 107 + # "^secret-cmd", 108 + # "^innocuous-cmd .*--secret=.+", 109 + # ] 110 + 111 + ## prevent commands run with cwd matching any of these regexes from being written 112 + ## to history. Note that these regular expressions are unanchored, i.e. if they don't 113 + ## start with ^ or end with $, they'll match anywhere in CWD. 114 + ## For details on the supported regular expression syntax, see 115 + ## https://docs.rs/regex/latest/regex/#syntax 116 + # cwd_filter = [ 117 + # "^/very/secret/area", 118 + # ] 119 + 120 + ## Configure the maximum height of the preview to show. 121 + ## Useful when you have long scripts in your history that you want to distinguish 122 + ## by more than the first few lines. 123 + # max_preview_height = 4 124 + 125 + ## Configure whether or not to show the help row, which includes the current Atuin 126 + ## version (and whether an update is available), a keymap hint, and the total 127 + ## amount of commands in your history. 128 + # show_help = true 129 + 130 + ## Configure whether or not to show tabs for search and inspect 131 + # show_tabs = true 132 + 133 + ## Configure whether or not the tabs row may be auto-hidden, which includes the current Atuin 134 + ## tab, such as Search or Inspector, and other tabs you may wish to see. This will 135 + ## only be hidden if there are fewer than this count of lines available, and does not affect the use 136 + ## of keyboard shortcuts to switch tab. 0 to never auto-hide, default is 8 (lines). 137 + ## This is ignored except in `compact` mode. 138 + # auto_hide_height = 8 139 + 140 + ## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include 141 + ## 1. AWS key id 142 + ## 2. Github pat (old and new) 143 + ## 3. Slack oauth tokens (bot, user) 144 + ## 4. Slack webhooks 145 + ## 5. Stripe live/test keys 146 + # secrets_filter = true 147 + 148 + ## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit. 149 + # This applies for new installs. Old installs will keep the old behaviour unless configured otherwise. 150 + enter_accept = true 151 + 152 + ## Defaults to "emacs". This specifies the keymap on the startup of `atuin 153 + ## search`. If this is set to "auto", the startup keymap mode in the Atuin 154 + ## search is automatically selected based on the shell's keymap where the 155 + ## keybinding is defined. If this is set to "emacs", "vim-insert", or 156 + ## "vim-normal", the startup keymap mode in the Atuin search is forced to be 157 + ## the specified one. 158 + # keymap_mode = "auto" 159 + 160 + ## Cursor style in each keymap mode. If specified, the cursor style is changed 161 + ## in entering the cursor shape. Available values are "default" and 162 + ## "{blink,steady}-{block,underline,bar}". 163 + # keymap_cursor = { emacs = "blink-block", vim_insert = "blink-block", vim_normal = "steady-block" } 164 + 165 + # network_connect_timeout = 5 166 + # network_timeout = 5 167 + 168 + ## Timeout (in seconds) for acquiring a local database connection (sqlite) 169 + # local_timeout = 5 170 + 171 + ## Set this to true and Atuin will minimize motion in the UI - timers will not update live, etc. 172 + ## Alternatively, set env NO_MOTION=true 173 + # prefers_reduced_motion = false 174 + 175 + [stats] 176 + ## Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl 177 + # common_subcommands = [ 178 + # "apt", 179 + # "cargo", 180 + # "composer", 181 + # "dnf", 182 + # "docker", 183 + # "git", 184 + # "go", 185 + # "ip", 186 + # "kubectl", 187 + # "nix", 188 + # "nmcli", 189 + # "npm", 190 + # "pecl", 191 + # "pnpm", 192 + # "podman", 193 + # "port", 194 + # "systemctl", 195 + # "tmux", 196 + # "yarn", 197 + # ] 198 + 199 + ## Set commands that should be totally stripped and ignored from stats 200 + # common_prefix = ["sudo"] 201 + 202 + ## Set commands that will be completely ignored from stats 203 + # ignored_commands = [ 204 + # "cd", 205 + # "ls", 206 + # "vi" 207 + # ] 208 + 209 + [keys] 210 + # Defaults to true. If disabled, using the up/down key won't exit the TUI when scrolled past the first/last entry. 211 + # scroll_exits = true 212 + 213 + [sync] 214 + # Enable sync v2 by default 215 + # This ensures that sync v2 is enabled for new installs only 216 + # In a later release it will become the default across the board 217 + records = true 218 + 219 + [preview] 220 + ## which preview strategy to use to calculate the preview height (respects max_preview_height). 221 + ## possible values: auto, static 222 + ## auto: length of the selected command. 223 + ## static: length of the longest command stored in the history. 224 + ## fixed: use max_preview_height as fixed height. 225 + # strategy = "auto" 226 + 227 + [daemon] 228 + ## Enables using the daemon to sync. Requires the daemon to be running in the background. Start it with `atuin daemon` 229 + # enabled = false 230 + 231 + ## How often the daemon should sync in seconds 232 + # sync_frequency = 300 233 + 234 + ## The path to the unix socket used by the daemon (on unix systems) 235 + ## linux/mac: ~/.local/share/atuin/atuin.sock 236 + ## windows: Not Supported 237 + # socket_path = "~/.local/share/atuin/atuin.sock" 238 + 239 + ## Use systemd socket activation rather than opening the given path (the path must still be correct for the client) 240 + ## linux: false 241 + ## mac/windows: Not Supported 242 + # systemd_socket = false 243 + 244 + ## The port that should be used for TCP on non unix systems 245 + # tcp_port = 8889 246 + 247 + # [theme] 248 + ## Color theme to use for rendering in the terminal. 249 + ## There are some built-in themes, including the base theme ("default"), 250 + ## "autumn" and "marine". You can add your own themes to the "./themes" subdirectory of your 251 + ## Atuin config (or ATUIN_THEME_DIR, if provided) as TOML files whose keys should be one or 252 + ## more of AlertInfo, AlertWarn, AlertError, Annotation, Base, Guidance, Important, and 253 + ## the string values as lowercase entries from this list: 254 + ## https://ogeon.github.io/docs/palette/master/palette/named/index.html 255 + ## If you provide a custom theme file, it should be called "NAME.toml" and the theme below 256 + ## should be the stem, i.e. `theme = "NAME"` for your chosen NAME. 257 + # name = "autumn" 258 + 259 + ## Whether the theme manager should output normal or extra information to help fix themes. 260 + ## Boolean, true or false. If unset, left up to the theme manager. 261 + # debug = true 262 + 263 + [search] 264 + ## The list of enabled filter modes, in order of priority. 265 + ## The "workspace" mode is skipped when not in a workspace or workspaces = false. 266 + ## Default filter mode can be overridden with the filter_mode setting. 267 + # filters = [ "global", "host", "session", "workspace", "directory" ]
+11
config/git/config
··· 1 + [user] 2 + email = thrast36@gmail.com 3 + name = zzstoatzz 4 + [http] 5 + postBuffer = 524288000 6 + [push] 7 + autoSetupRemote = true 8 + [core] 9 + editor = nvim 10 + [sequence] 11 + editor = nvim
+6
config/nvim/.stylua.toml
··· 1 + column_width = 160 2 + line_endings = "Unix" 3 + indent_type = "Spaces" 4 + indent_width = 2 5 + quote_style = "AutoPreferSingle" 6 + call_parentheses = "None"
+24
config/nvim/doc/kickstart.txt
··· 1 + ================================================================================ 2 + INTRODUCTION *kickstart.nvim* 3 + 4 + Kickstart.nvim is a project to help you get started on your neovim journey. 5 + 6 + *kickstart-is-not* 7 + It is not: 8 + - Complete framework for every plugin under the sun 9 + - Place to add every plugin that could ever be useful 10 + 11 + *kickstart-is* 12 + It is: 13 + - Somewhere that has a good start for the most common "IDE" type features: 14 + - autocompletion 15 + - goto-definition 16 + - find references 17 + - fuzzy finding 18 + - and hinting at what more can be done :) 19 + - A place to _kickstart_ your journey. 20 + - You should fork this project and use/modify it so that it matches your 21 + style and preferences. If you don't want to do that, there are probably 22 + other projects that would fit much better for you (and that's great!)! 23 + 24 + vim:tw=78:ts=8:ft=help:norl:
+869
config/nvim/init.lua
··· 1 + --[[ 2 + 3 + ===================================================================== 4 + ==================== READ THIS BEFORE CONTINUING ==================== 5 + ===================================================================== 6 + ======== .-----. ======== 7 + ======== .----------------------. | === | ======== 8 + ======== |.-""""""""""""""""""-.| |-----| ======== 9 + ======== || || | === | ======== 10 + ======== || KICKSTART.NVIM || |-----| ======== 11 + ======== || || | === | ======== 12 + ======== || || |-----| ======== 13 + ======== ||:Tutor || |:::::| ======== 14 + ======== |'-..................-'| |____o| ======== 15 + ======== `"")----------------(""` ___________ ======== 16 + ======== /::::::::::| |::::::::::\ \ no mouse \ ======== 17 + ======== /:::========| |==hjkl==:::\ \ required \ ======== 18 + ======== '""""""""""""' '""""""""""""' '""""""""""' ======== 19 + ======== ======== 20 + ===================================================================== 21 + ===================================================================== 22 + 23 + What is Kickstart? 24 + 25 + Kickstart.nvim is *not* a distribution. 26 + 27 + Kickstart.nvim is a starting point for your own configuration. 28 + The goal is that you can read every line of code, top-to-bottom, understand 29 + what your configuration is doing, and modify it to suit your needs. 30 + 31 + Once you've done that, you can start exploring, configuring and tinkering to 32 + make Neovim your own! That might mean leaving kickstart just the way it is for a while 33 + or immediately breaking it into modular pieces. It's up to you! 34 + 35 + If you don't know anything about Lua, I recommend taking some time to read through 36 + a guide. One possible example which will only take 10-15 minutes: 37 + - https://learnxinyminutes.com/docs/lua/ 38 + 39 + After understanding a bit more about Lua, you can use `:help lua-guide` as a 40 + reference for how Neovim integrates Lua. 41 + - :help lua-guide 42 + - (or HTML version): https://neovim.io/doc/user/lua-guide.html 43 + 44 + Kickstart Guide: 45 + 46 + TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. 47 + 48 + If you don't know what this means, type the following: 49 + - <escape key> 50 + - : 51 + - Tutor 52 + - <enter key> 53 + 54 + (If you already know how the Neovim basics, you can skip this step) 55 + 56 + Once you've completed that, you can continue working through **AND READING** the rest 57 + of the kickstart init.lua 58 + 59 + Next, run AND READ `:help`. 60 + This will open up a help window with some basic information 61 + about reading, navigating and searching the builtin help documentation. 62 + 63 + This should be the first place you go to look when you're stuck or confused 64 + with something. It's one of my favorite neovim features. 65 + 66 + MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation, 67 + which is very useful when you're not sure exactly what you're looking for. 68 + 69 + I have left several `:help X` comments throughout the init.lua 70 + These are hints about where to find more information about the relevant settings, 71 + plugins or neovim features used in kickstart. 72 + 73 + NOTE: Look for lines like this 74 + 75 + Throughout the file. These are for you, the reader, to help understand what is happening. 76 + Feel free to delete them once you know what you're doing, but they should serve as a guide 77 + for when you are first encountering a few different constructs in your nvim config. 78 + 79 + If you experience any errors while trying to install kickstart, run `:checkhealth` for more info 80 + 81 + I hope you enjoy your Neovim journey, 82 + - TJ 83 + 84 + P.S. You can delete this when you're done too. It's your config now! :) 85 + --]] 86 + 87 + -- Set <space> as the leader key 88 + -- See `:help mapleader` 89 + -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) 90 + vim.g.mapleader = ' ' 91 + vim.g.maplocalleader = ' ' 92 + 93 + -- Set to true if you have a Nerd Font installed 94 + vim.g.have_nerd_font = true 95 + 96 + -- [[ Setting options ]] 97 + -- See `:help vim.opt` 98 + -- NOTE: You can change these options as you wish! 99 + -- For more options, you can see `:help option-list` 100 + 101 + -- Make line numbers default 102 + vim.opt.number = true 103 + -- You can also add relative line numbers, for help with jumping. 104 + -- Experiment for yourself to see if you like it! 105 + -- vim.opt.relativenumber = true 106 + 107 + -- Enable mouse mode, can be useful for resizing splits for example! 108 + vim.opt.mouse = 'a' 109 + 110 + -- Don't show the mode, since it's already in status line 111 + vim.opt.showmode = false 112 + 113 + -- Sync clipboard between OS and Neovim. 114 + -- Remove this option if you want your OS clipboard to remain independent. 115 + -- See `:help 'clipboard'` 116 + vim.opt.clipboard = 'unnamedplus' 117 + 118 + -- Enable break indent 119 + vim.opt.breakindent = true 120 + 121 + -- Save undo history 122 + vim.opt.undofile = true 123 + 124 + -- Case-insensitive searching UNLESS \C or capital in search 125 + vim.opt.ignorecase = true 126 + vim.opt.smartcase = true 127 + 128 + -- Keep signcolumn on by default 129 + vim.opt.signcolumn = 'yes' 130 + 131 + -- Decrease update time 132 + vim.opt.updatetime = 250 133 + vim.opt.timeoutlen = 300 134 + 135 + -- Configure how new splits should be opened 136 + vim.opt.splitright = true 137 + vim.opt.splitbelow = true 138 + 139 + -- Sets how neovim will display certain whitespace in the editor. 140 + -- See `:help 'list'` 141 + -- and `:help 'listchars'` 142 + vim.opt.list = true 143 + vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } 144 + 145 + -- Preview substitutions live, as you type! 146 + vim.opt.inccommand = 'split' 147 + 148 + -- Show which line your cursor is on 149 + vim.opt.cursorline = true 150 + 151 + -- Minimal number of screen lines to keep above and below the cursor. 152 + vim.opt.scrolloff = 10 153 + 154 + -- [[ Basic Keymaps ]] 155 + -- See `:help vim.keymap.set()` 156 + 157 + -- Set highlight on search, but clear on pressing <Esc> in normal mode 158 + vim.opt.hlsearch = true 159 + vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') 160 + 161 + -- Diagnostic keymaps 162 + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) 163 + vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) 164 + vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) 165 + vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) 166 + 167 + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier 168 + -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which 169 + -- is not what someone will guess without a bit more experience. 170 + -- 171 + -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping 172 + -- or just use <C-\><C-n> to exit terminal mode 173 + vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) 174 + 175 + -- TIP: Disable arrow keys in normal mode 176 + -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') 177 + -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') 178 + -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') 179 + -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') 180 + 181 + -- Keybinds to make split navigation easier. 182 + -- Use CTRL+<hjkl> to switch between windows 183 + -- 184 + -- See `:help wincmd` for a list of all window commands 185 + vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' }) 186 + vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' }) 187 + vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) 188 + vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) 189 + 190 + -- [[ Basic Autocommands ]] 191 + -- See `:help lua-guide-autocommands` 192 + 193 + -- Highlight when yanking (copying) text 194 + -- Try it with `yap` in normal mode 195 + -- See `:help vim.highlight.on_yank()` 196 + vim.api.nvim_create_autocmd('TextYankPost', { 197 + desc = 'Highlight when yanking (copying) text', 198 + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), 199 + callback = function() 200 + vim.highlight.on_yank() 201 + end, 202 + }) 203 + 204 + -- [[ Install `lazy.nvim` plugin manager ]] 205 + -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info 206 + local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' 207 + if not vim.loop.fs_stat(lazypath) then 208 + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' 209 + vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } 210 + end ---@diagnostic disable-next-line: undefined-field 211 + vim.opt.rtp:prepend(lazypath) 212 + 213 + -- [[ Configure and install plugins ]] 214 + -- 215 + -- To check the current status of your plugins, run 216 + -- :Lazy 217 + -- 218 + -- You can press `?` in this menu for help. Use `:q` to close the window 219 + -- 220 + -- To update plugins, you can run 221 + -- :Lazy update 222 + -- 223 + -- NOTE: Here is where you install your plugins. 224 + 225 + require('lazy').setup({ 226 + -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 227 + 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically 228 + 229 + { 230 + 'supermaven-inc/supermaven-nvim', 231 + config = function() 232 + require('supermaven-nvim').setup {} 233 + end, 234 + }, 235 + 236 + -- NOTE: Plugins can also be added by using a table, 237 + -- with the first argument being the link and the following 238 + -- keys can be used to configure plugin behavior/loading/etc. 239 + -- 240 + -- Use `opts = {}` to force a plugin to be loaded. 241 + -- 242 + -- This is equivalent to: 243 + -- require('Comment').setup({}) 244 + 245 + -- "gc" to comment visual regions/lines 246 + { 'numToStr/Comment.nvim', opts = {} }, 247 + 248 + -- Here is a more advanced example where we pass configuration 249 + -- options to `gitsigns.nvim`. This is equivalent to the following lua: 250 + -- require('gitsigns').setup({ ... }) 251 + -- 252 + -- See `:help gitsigns` to understand what the configuration keys do 253 + { -- Adds git related signs to the gutter, as well as utilities for managing changes 254 + 'lewis6991/gitsigns.nvim', 255 + opts = { 256 + signs = { 257 + add = { text = '+' }, 258 + change = { text = '~' }, 259 + delete = { text = '_' }, 260 + topdelete = { text = '‾' }, 261 + changedelete = { text = '~' }, 262 + }, 263 + }, 264 + }, 265 + 266 + -- NOTE: Plugins can also be configured to run lua code when they are loaded. 267 + -- 268 + -- This is often very useful to both group configuration, as well as handle 269 + -- lazy loading plugins that don't need to be loaded immediately at startup. 270 + -- 271 + -- For example, in the following configuration, we use: 272 + -- event = 'VimEnter' 273 + -- 274 + -- which loads which-key before all the UI elements are loaded. Events can be 275 + -- normal autocommands events (`:help autocmd-events`). 276 + -- 277 + -- Then, because we use the `config` key, the configuration only runs 278 + -- after the plugin has been loaded: 279 + -- config = function() ... end 280 + 281 + -- { -- Useful plugin to show you pending keybinds. 282 + -- 'folke/which-key.nvim', 283 + -- event = 'VimEnter', -- Sets the loading event to 'VimEnter' 284 + -- config = function() -- This is the function that runs, AFTER loading 285 + -- require('which-key').setup() 286 + -- require('which-key').register { 287 + -- ['<leader>'] = { 288 + -- c = { name = '[C]ode' }, 289 + -- d = { name = '[D]ocument' }, 290 + -- r = { name = '[R]ename' }, 291 + -- s = { name = '[S]earch' }, 292 + -- w = { name = '[W]orkspace' }, 293 + -- } 294 + -- } 295 + -- end, 296 + -- }, 297 + 298 + -- NOTE: Plugins can specify dependencies. 299 + -- 300 + -- The dependencies are proper plugin specifications as well - anything 301 + -- you do for a plugin at the top level, you can do for a dependency. 302 + -- 303 + -- Use the `dependencies` key to specify the dependencies of a particular plugin 304 + -- Use the `dependencies` key to specify the dependencies of a particular plugin 305 + 306 + { -- Fuzzy Finder (files, lsp, etc) 307 + 'nvim-telescope/telescope.nvim', 308 + event = 'VimEnter', 309 + branch = '0.1.x', 310 + dependencies = { 311 + 'nvim-lua/plenary.nvim', 312 + { -- If encountering errors, see telescope-fzf-native README for install instructions 313 + 'nvim-telescope/telescope-fzf-native.nvim', 314 + 315 + -- `build` is used to run some command when the plugin is installed/updated. 316 + -- This is only run then, not every time Neovim starts up. 317 + build = 'make', 318 + 319 + -- `cond` is a condition used to determine whether this plugin should be 320 + -- installed and loaded. 321 + cond = function() 322 + return vim.fn.executable 'make' == 1 323 + end, 324 + }, 325 + { 'nvim-telescope/telescope-ui-select.nvim' }, 326 + 327 + -- Useful for getting pretty icons, but requires a Nerd Font. 328 + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, 329 + }, 330 + config = function() 331 + -- Telescope is a fuzzy finder that comes with a lot of different things that 332 + -- it can fuzzy find! It's more than just a "file finder", it can search 333 + -- many different aspects of Neovim, your workspace, LSP, and more! 334 + -- 335 + -- The easiest way to use telescope, is to start by doing something like: 336 + -- :Telescope help_tags 337 + -- 338 + -- After running this command, a window will open up and you're able to 339 + -- type in the prompt window. You'll see a list of help_tags options and 340 + -- a corresponding preview of the help. 341 + -- 342 + -- Two important keymaps to use while in telescope are: 343 + -- - Insert mode: <c-/> 344 + -- - Normal mode: ? 345 + -- 346 + -- This opens a window that shows you all of the keymaps for the current 347 + -- telescope picker. This is really useful to discover what Telescope can 348 + -- do as well as how to actually do it! 349 + 350 + -- [[ Configure Telescope ]] 351 + -- See `:help telescope` and `:help telescope.setup()` 352 + require('telescope').setup { 353 + -- You can put your default mappings / updates / etc. in here 354 + -- All the info you're looking for is in `:help telescope.setup()` 355 + -- 356 + -- defaults = { 357 + -- mappings = { 358 + -- i = { ['<c-enter>'] = 'to_fuzzy_refine' }, 359 + -- }, 360 + -- }, 361 + -- pickers = {} 362 + extensions = { 363 + ['ui-select'] = { 364 + require('telescope.themes').get_dropdown(), 365 + }, 366 + }, 367 + } 368 + 369 + -- Enable telescope extensions, if they are installed 370 + pcall(require('telescope').load_extension, 'fzf') 371 + pcall(require('telescope').load_extension, 'ui-select') 372 + 373 + -- See `:help telescope.builtin` 374 + local builtin = require 'telescope.builtin' 375 + vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) 376 + vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) 377 + vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' }) 378 + vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) 379 + vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) 380 + vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) 381 + vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) 382 + vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) 383 + vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) 384 + vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) 385 + 386 + -- Slightly advanced example of overriding default behavior and theme 387 + vim.keymap.set('n', '<leader>/', function() 388 + -- You can pass additional configuration to telescope to change theme, layout, etc. 389 + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { 390 + winblend = 10, 391 + previewer = false, 392 + }) 393 + end, { desc = '[/] Fuzzily search in current buffer' }) 394 + 395 + -- Also possible to pass additional configuration options. 396 + -- See `:help telescope.builtin.live_grep()` for information about particular keys 397 + vim.keymap.set('n', '<leader>s/', function() 398 + builtin.live_grep { 399 + grep_open_files = true, 400 + prompt_title = 'Live Grep in Open Files', 401 + } 402 + end, { desc = '[S]earch [/] in Open Files' }) 403 + 404 + -- Shortcut for searching your neovim configuration files 405 + vim.keymap.set('n', '<leader>sn', function() 406 + builtin.find_files { cwd = vim.fn.stdpath 'config' } 407 + end, { desc = '[S]earch [N]eovim files' }) 408 + end, 409 + }, 410 + 411 + { -- LSP Configuration & Plugins 412 + 'neovim/nvim-lspconfig', 413 + dependencies = { 414 + -- Automatically install LSPs and related tools to stdpath for neovim 415 + 'williamboman/mason.nvim', 416 + 'williamboman/mason-lspconfig.nvim', 417 + 'WhoIsSethDaniel/mason-tool-installer.nvim', 418 + 419 + -- Useful status updates for LSP. 420 + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` 421 + { 'j-hui/fidget.nvim', opts = {} }, 422 + }, 423 + config = function() 424 + -- Brief Aside: **What is LSP?** 425 + -- 426 + -- LSP is an acronym you've probably heard, but might not understand what it is. 427 + -- 428 + -- LSP stands for Language Server Protocol. It's a protocol that helps editors 429 + -- and language tooling communicate in a standardized fashion. 430 + -- 431 + -- In general, you have a "server" which is some tool built to understand a particular 432 + -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc). These Language Servers 433 + -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone 434 + -- processes that communicate with some "client" - in this case, Neovim! 435 + -- 436 + -- LSP provides Neovim with features like: 437 + -- - Go to definition 438 + -- - Find references 439 + -- - Autocompletion 440 + -- - Symbol Search 441 + -- - and more! 442 + -- 443 + -- Thus, Language Servers are external tools that must be installed separately from 444 + -- Neovim. This is where `mason` and related plugins come into play. 445 + -- 446 + -- If you're wondering about lsp vs treesitter, you can check out the wonderfully 447 + -- and elegantly composed help section, `:help lsp-vs-treesitter` 448 + 449 + -- This function gets run when an LSP attaches to a particular buffer. 450 + -- That is to say, every time a new file is opened that is associated with 451 + -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this 452 + -- function will be executed to configure the current buffer 453 + vim.api.nvim_create_autocmd('LspAttach', { 454 + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), 455 + callback = function(event) 456 + -- NOTE: Remember that lua is a real programming language, and as such it is possible 457 + -- to define small helper and utility functions so you don't have to repeat yourself 458 + -- many times. 459 + -- 460 + -- In this case, we create a function that lets us more easily define mappings specific 461 + -- for LSP related items. It sets the mode, buffer and description for us each time. 462 + local map = function(keys, func, desc) 463 + vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) 464 + end 465 + 466 + -- Jump to the definition of the word under your cursor. 467 + -- This is where a variable was first declared, or where a function is defined, etc. 468 + -- To jump back, press <C-t>. 469 + map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') 470 + 471 + -- Find references for the word under your cursor. 472 + map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') 473 + 474 + -- Jump to the implementation of the word under your cursor. 475 + -- Useful when your language has ways of declaring types without an actual implementation. 476 + map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') 477 + 478 + -- Jump to the type of the word under your cursor. 479 + -- Useful when you're not sure what type a variable is and you want to see 480 + -- the definition of its *type*, not where it was *defined*. 481 + map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') 482 + 483 + -- Fuzzy find all the symbols in your current document. 484 + -- Symbols are things like variables, functions, types, etc. 485 + map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') 486 + 487 + -- Fuzzy find all the symbols in your current workspace 488 + -- Similar to document symbols, except searches over your whole project. 489 + map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') 490 + 491 + -- Rename the variable under your cursor 492 + -- Most Language Servers support renaming across files, etc. 493 + map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') 494 + 495 + -- Execute a code action, usually your cursor needs to be on top of an error 496 + -- or a suggestion from your LSP for this to activate. 497 + map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') 498 + 499 + -- Opens a popup that displays documentation about the word under your cursor 500 + -- See `:help K` for why this keymap 501 + map('K', vim.lsp.buf.hover, 'Hover Documentation') 502 + 503 + -- WARN: This is not Goto Definition, this is Goto Declaration. 504 + -- For example, in C this would take you to the header 505 + map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') 506 + 507 + -- The following two autocommands are used to highlight references of the 508 + -- word under your cursor when your cursor rests there for a little while. 509 + -- See `:help CursorHold` for information about when this is executed 510 + -- 511 + -- When you move your cursor, the highlights will be cleared (the second autocommand). 512 + local client = vim.lsp.get_client_by_id(event.data.client_id) 513 + if client and client.server_capabilities.documentHighlightProvider then 514 + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { 515 + buffer = event.buf, 516 + callback = vim.lsp.buf.document_highlight, 517 + }) 518 + 519 + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { 520 + buffer = event.buf, 521 + callback = vim.lsp.buf.clear_references, 522 + }) 523 + end 524 + end, 525 + }) 526 + 527 + -- LSP servers and clients are able to communicate to each other what features they support. 528 + -- By default, Neovim doesn't support everything that is in the LSP Specification. 529 + -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. 530 + -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. 531 + local capabilities = vim.lsp.protocol.make_client_capabilities() 532 + capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) 533 + 534 + -- Enable the following language servers 535 + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. 536 + -- 537 + -- Add any additional override configuration in the following tables. Available keys are: 538 + -- - cmd (table): Override the default command used to start the server 539 + -- - filetypes (table): Override the default list of associated filetypes for the server 540 + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. 541 + -- - settings (table): Override the default settings passed when initializing the server. 542 + -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ 543 + local servers = { 544 + -- clangd = {}, 545 + -- gopls = {}, 546 + -- pyright = {}, 547 + -- rust_analyzer = {}, 548 + -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs 549 + -- 550 + -- Some languages (like typescript) have entire language plugins that can be useful: 551 + -- https://github.com/pmizio/typescript-tools.nvim 552 + -- 553 + -- But for many setups, the LSP (`tsserver`) will work just fine 554 + -- tsserver = {}, 555 + -- 556 + 557 + lua_ls = { 558 + -- cmd = {...}, 559 + -- filetypes { ...}, 560 + -- capabilities = {}, 561 + settings = { 562 + Lua = { 563 + runtime = { version = 'LuaJIT' }, 564 + workspace = { 565 + checkThirdParty = false, 566 + -- Tells lua_ls where to find all the Lua files that you have loaded 567 + -- for your neovim configuration. 568 + library = { 569 + '${3rd}/luv/library', 570 + unpack(vim.api.nvim_get_runtime_file('', true)), 571 + }, 572 + -- If lua_ls is really slow on your computer, you can try this instead: 573 + -- library = { vim.env.VIMRUNTIME }, 574 + }, 575 + completion = { 576 + callSnippet = 'Replace', 577 + }, 578 + -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings 579 + -- diagnostics = { disable = { 'missing-fields' } }, 580 + }, 581 + }, 582 + }, 583 + 584 + ruff = { 585 + init_options = { 586 + settings = { 587 + -- Any extra CLI arguments for `ruff` go here. 588 + args = {}, 589 + }, 590 + }, 591 + }, 592 + } 593 + 594 + -- Ensure the servers and tools above are installed 595 + -- To check the current status of installed tools and/or manually install 596 + -- other tools, you can run 597 + -- :Mason 598 + -- 599 + -- You can press `g?` for help in this menu 600 + require('mason').setup() 601 + 602 + -- You can add other tools here that you want Mason to install 603 + -- for you, so that they are available from within Neovim. 604 + local ensure_installed = vim.tbl_keys(servers or {}) 605 + vim.list_extend(ensure_installed, { 606 + 'stylua', -- Used to format lua code 607 + 'ruff', -- Python linter (new integrated server) 608 + 'pyright', -- Python type checker 609 + }) 610 + require('mason-tool-installer').setup { ensure_installed = ensure_installed } 611 + 612 + require('mason-lspconfig').setup { 613 + handlers = { 614 + function(server_name) 615 + local server = servers[server_name] or {} 616 + -- This handles overriding only values explicitly passed 617 + -- by the server configuration above. Useful when disabling 618 + -- certain features of an LSP (for example, turning off formatting for tsserver) 619 + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) 620 + require('lspconfig')[server_name].setup(server) 621 + end, 622 + }, 623 + } 624 + end, 625 + }, 626 + 627 + { -- Autoformat 628 + 'stevearc/conform.nvim', 629 + opts = { 630 + notify_on_error = false, 631 + format_on_save = { 632 + timeout_ms = 500, 633 + lsp_fallback = true, 634 + }, 635 + formatters_by_ft = { 636 + lua = { 'stylua' }, 637 + python = { 'ruff_format' }, -- Use Ruff for Python formatting 638 + }, 639 + }, 640 + }, 641 + 642 + { -- Autocompletion 643 + 'hrsh7th/nvim-cmp', 644 + event = 'InsertEnter', 645 + dependencies = { 646 + -- Snippet Engine & its associated nvim-cmp source 647 + { 648 + 'L3MON4D3/LuaSnip', 649 + build = (function() 650 + -- Build Step is needed for regex support in snippets 651 + -- This step is not supported in many windows environments 652 + -- Remove the below condition to re-enable on windows 653 + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then 654 + return 655 + end 656 + return 'make install_jsregexp' 657 + end)(), 658 + }, 659 + 'saadparwaiz1/cmp_luasnip', 660 + 661 + -- Adds other completion capabilities. 662 + -- nvim-cmp does not ship with all sources by default. They are split 663 + -- into multiple repos for maintenance purposes. 664 + 'hrsh7th/cmp-nvim-lsp', 665 + 'hrsh7th/cmp-path', 666 + 667 + -- If you want to add a bunch of pre-configured snippets, 668 + -- you can use this plugin to help you. It even has snippets 669 + -- for various frameworks/libraries/etc. but you will have to 670 + -- set up the ones that are useful for you. 671 + -- 'rafamadriz/friendly-snippets', 672 + }, 673 + config = function() 674 + -- See `:help cmp` 675 + local cmp = require 'cmp' 676 + local luasnip = require 'luasnip' 677 + luasnip.config.setup {} 678 + 679 + cmp.setup { 680 + snippet = { 681 + expand = function(args) 682 + luasnip.lsp_expand(args.body) 683 + end, 684 + }, 685 + completion = { completeopt = 'menu,menuone,noinsert' }, 686 + 687 + -- For an understanding of why these mappings were 688 + -- chosen, you will need to read `:help ins-completion` 689 + -- 690 + -- No, but seriously. Please read `:help ins-completion`, it is really good! 691 + mapping = cmp.mapping.preset.insert { 692 + -- Select the [n]ext item 693 + ['<C-n>'] = cmp.mapping.select_next_item(), 694 + -- Select the [p]revious item 695 + ['<C-p>'] = cmp.mapping.select_prev_item(), 696 + 697 + -- Accept ([y]es) the completion. 698 + -- This will auto-import if your LSP supports it. 699 + -- This will expand snippets if the LSP sent a snippet. 700 + ['<C-y>'] = cmp.mapping.confirm { select = true }, 701 + 702 + -- Manually trigger a completion from nvim-cmp. 703 + -- Generally you don't need this, because nvim-cmp will display 704 + -- completions whenever it has completion options available. 705 + ['<C-Space>'] = cmp.mapping.complete {}, 706 + 707 + -- Think of <c-l> as moving to the right of your snippet expansion. 708 + -- So if you have a snippet that's like: 709 + -- function $name($args) 710 + -- $body 711 + -- end 712 + -- 713 + -- <c-l> will move you to the right of each of the expansion locations. 714 + -- <c-h> is similar, except moving you backwards. 715 + ['<C-l>'] = cmp.mapping(function() 716 + if luasnip.expand_or_locally_jumpable() then 717 + luasnip.expand_or_jump() 718 + end 719 + end, { 'i', 's' }), 720 + ['<C-h>'] = cmp.mapping(function() 721 + if luasnip.locally_jumpable(-1) then 722 + luasnip.jump(-1) 723 + end 724 + end, { 'i', 's' }), 725 + }, 726 + sources = { 727 + { name = 'nvim_lsp' }, 728 + { name = 'luasnip' }, 729 + { name = 'path' }, 730 + }, 731 + } 732 + end, 733 + }, 734 + 735 + { -- You can easily change to a different colorscheme. 736 + -- Change the name of the colorscheme plugin below, and then 737 + -- change the command in the config to whatever the name of that colorscheme is 738 + -- 739 + -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme` 740 + 'folke/tokyonight.nvim', 741 + priority = 1000, -- make sure to load this before all the other start plugins 742 + init = function() 743 + -- Load the colorscheme here. 744 + -- Like many other themes, this one has different styles, and you could load 745 + -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. 746 + vim.cmd.colorscheme 'tokyonight-night' 747 + 748 + -- You can configure highlights by doing something like 749 + vim.cmd.hi 'Comment gui=none' 750 + end, 751 + }, 752 + 753 + -- Highlight todo, notes, etc in comments 754 + { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, 755 + 756 + { -- Collection of various small independent plugins/modules 757 + 'echasnovski/mini.nvim', 758 + config = function() 759 + -- Better Around/Inside textobjects 760 + -- 761 + -- Examples: 762 + -- - va) - [V]isually select [A]round [)]paren 763 + -- - yinq - [Y]ank [I]nside [N]ext [']quote 764 + -- - ci' - [C]hange [I]nside [']quote 765 + require('mini.ai').setup { n_lines = 500 } 766 + 767 + -- Add/delete/replace surroundings (brackets, quotes, etc.) 768 + -- 769 + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren 770 + -- - sd' - [S]urround [D]elete [']quotes 771 + -- - sr)' - [S]urround [R]eplace [)] ['] 772 + require('mini.surround').setup() 773 + 774 + -- Simple and easy statusline. 775 + -- You could remove this setup call if you don't like it, 776 + -- and try some other statusline plugin 777 + local statusline = require 'mini.statusline' 778 + -- set use_icons to true if you have a Nerd Font 779 + statusline.setup { use_icons = vim.g.have_nerd_font } 780 + 781 + -- You can configure sections in the statusline by overriding their 782 + -- default behavior. For example, here we set the section for 783 + -- cursor location to LINE:COLUMN 784 + ---@diagnostic disable-next-line: duplicate-set-field 785 + statusline.section_location = function() 786 + return '%2l:%-2v' 787 + end 788 + 789 + -- ... and there is more! 790 + -- Check out: https://github.com/echasnovski/mini.nvim 791 + end, 792 + }, 793 + 794 + { -- Highlight, edit, and navigate code 795 + 'nvim-treesitter/nvim-treesitter', 796 + build = ':TSUpdate', 797 + opts = { 798 + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, 799 + -- Autoinstall languages that are not installed 800 + auto_install = true, 801 + highlight = { enable = true }, 802 + indent = { enable = true }, 803 + }, 804 + config = function(_, opts) 805 + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` 806 + 807 + ---@diagnostic disable-next-line: missing-fields 808 + require('nvim-treesitter.configs').setup(opts) 809 + 810 + -- There are additional nvim-treesitter modules that you can use to interact 811 + -- with nvim-treesitter. You should go explore a few and see what interests you: 812 + -- 813 + -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` 814 + -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context 815 + -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects 816 + end, 817 + }, 818 + 819 + { 820 + 'iamcco/markdown-preview.nvim', 821 + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, 822 + ft = { 'markdown' }, 823 + build = function() 824 + vim.fn['mkdp#util#install']() 825 + end, 826 + }, 827 + 828 + -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the 829 + -- init.lua. If you want these files, they are in the repository, so you can just download them and 830 + -- put them in the right spots if you want. 831 + 832 + -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for kickstart 833 + -- 834 + -- Here are some example plugins that I've included in the kickstart repository. 835 + -- Uncomment any of the lines below to enable them (you will need to restart nvim). 836 + -- 837 + -- require 'kickstart.plugins.debug', 838 + -- require 'kickstart.plugins.indent_line', 839 + 840 + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` 841 + -- This is the easiest way to modularize your config. 842 + -- 843 + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. 844 + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` 845 + -- { import = 'custom.plugins' }, 846 + }, { 847 + ui = { 848 + -- If you have a Nerd Font, set icons to an empty table which will use the 849 + -- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table 850 + icons = vim.g.have_nerd_font and {} or { 851 + cmd = '⌘', 852 + config = '🛠', 853 + event = '📅', 854 + ft = '📂', 855 + init = '⚙', 856 + keys = '🗝', 857 + plugin = '🔌', 858 + runtime = '💻', 859 + require = '🌙', 860 + source = '📄', 861 + start = '🚀', 862 + task = '📌', 863 + lazy = '💤 ', 864 + }, 865 + }, 866 + }) 867 + 868 + -- The line beneath this is called `modeline`. See `:help modeline` 869 + -- vim: ts=2 sts=2 sw=2 et
+28
config/nvim/lazy-lock.json
··· 1 + { 2 + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 + "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, 4 + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, 5 + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 6 + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 7 + "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, 8 + "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, 9 + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, 10 + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 11 + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, 12 + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, 13 + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, 14 + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 15 + "mini.nvim": { "branch": "main", "commit": "9df78f3cdf9bdcc5aaf93cc51412a69a384041b2" }, 16 + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, 17 + "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, 18 + "nvim-treesitter": { "branch": "master", "commit": "4b222913486ec0a5983efa82b0649a2ab87cf1f0" }, 19 + "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, 20 + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 21 + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, 22 + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, 23 + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, 24 + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, 25 + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, 26 + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, 27 + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } 28 + }
+5
config/nvim/lua/custom/plugins/init.lua
··· 1 + -- You can add your own plugins here or in other files in this directory! 2 + -- I promise not to create any merge conflicts in this directory :) 3 + -- 4 + -- See the kickstart.nvim README for more information 5 + return {}
+52
config/nvim/lua/kickstart/health.lua
··· 1 + --[[ 2 + -- 3 + -- This file is not required for your own configuration, 4 + -- but helps people determine if their system is setup correctly. 5 + -- 6 + --]] 7 + 8 + local check_version = function() 9 + local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) 10 + if not vim.version.cmp then 11 + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) 12 + return 13 + end 14 + 15 + if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then 16 + vim.health.ok(string.format("Neovim version is: '%s'", verstr)) 17 + else 18 + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) 19 + end 20 + end 21 + 22 + local check_external_reqs = function() 23 + -- Basic utils: `git`, `make`, `unzip` 24 + for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do 25 + local is_executable = vim.fn.executable(exe) == 1 26 + if is_executable then 27 + vim.health.ok(string.format("Found executable: '%s'", exe)) 28 + else 29 + vim.health.warn(string.format("Could not find executable: '%s'", exe)) 30 + end 31 + end 32 + 33 + return true 34 + end 35 + 36 + return { 37 + check = function() 38 + vim.health.start 'kickstart.nvim' 39 + 40 + vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` 41 + 42 + Fix only warnings for plugins and languages you intend to use. 43 + Mason will give warnings for languages that are not installed. 44 + You do not need to install, unless you want to use those languages!]] 45 + 46 + local uv = vim.uv or vim.loop 47 + vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) 48 + 49 + check_version() 50 + check_external_reqs() 51 + end, 52 + }
+87
config/nvim/lua/kickstart/plugins/debug.lua
··· 1 + -- debug.lua 2 + -- 3 + -- Shows how to use the DAP plugin to debug your code. 4 + -- 5 + -- Primarily focused on configuring the debugger for Go, but can 6 + -- be extended to other languages as well. That's why it's called 7 + -- kickstart.nvim and not kitchen-sink.nvim ;) 8 + 9 + return { 10 + -- NOTE: Yes, you can install new plugins here! 11 + 'mfussenegger/nvim-dap', 12 + -- NOTE: And you can specify dependencies as well 13 + dependencies = { 14 + -- Creates a beautiful debugger UI 15 + 'rcarriga/nvim-dap-ui', 16 + 17 + -- Installs the debug adapters for you 18 + 'williamboman/mason.nvim', 19 + 'jay-babu/mason-nvim-dap.nvim', 20 + 21 + -- Add your own debuggers here 22 + 'leoluz/nvim-dap-go', 23 + }, 24 + config = function() 25 + local dap = require 'dap' 26 + local dapui = require 'dapui' 27 + 28 + require('mason-nvim-dap').setup { 29 + -- Makes a best effort to setup the various debuggers with 30 + -- reasonable debug configurations 31 + automatic_setup = true, 32 + 33 + -- You can provide additional configuration to the handlers, 34 + -- see mason-nvim-dap README for more information 35 + handlers = {}, 36 + 37 + -- You'll need to check that you have the required things installed 38 + -- online, please don't ask me how to install them :) 39 + ensure_installed = { 40 + -- Update this to ensure that you have the debuggers for the langs you want 41 + 'delve', 42 + }, 43 + } 44 + 45 + -- Basic debugging keymaps, feel free to change to your liking! 46 + vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' }) 47 + vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' }) 48 + vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' }) 49 + vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' }) 50 + vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) 51 + vim.keymap.set('n', '<leader>B', function() 52 + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') 53 + end, { desc = 'Debug: Set Breakpoint' }) 54 + 55 + -- Dap UI setup 56 + -- For more information, see |:help nvim-dap-ui| 57 + dapui.setup { 58 + -- Set icons to characters that are more likely to work in every terminal. 59 + -- Feel free to remove or use ones that you like more! :) 60 + -- Don't feel like these are good choices. 61 + icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, 62 + controls = { 63 + icons = { 64 + pause = '⏸', 65 + play = '▶', 66 + step_into = '⏎', 67 + step_over = '⏭', 68 + step_out = '⏮', 69 + step_back = 'b', 70 + run_last = '▶▶', 71 + terminate = '⏹', 72 + disconnect = '⏏', 73 + }, 74 + }, 75 + } 76 + 77 + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. 78 + vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' }) 79 + 80 + dap.listeners.after.event_initialized['dapui_config'] = dapui.open 81 + dap.listeners.before.event_terminated['dapui_config'] = dapui.close 82 + dap.listeners.before.event_exited['dapui_config'] = dapui.close 83 + 84 + -- Install golang specific config 85 + require('dap-go').setup() 86 + end, 87 + }
+9
config/nvim/lua/kickstart/plugins/indent_line.lua
··· 1 + return { 2 + { -- Add indentation guides even on blank lines 3 + 'lukas-reineke/indent-blankline.nvim', 4 + -- Enable `lukas-reineke/indent-blankline.nvim` 5 + -- See `:help ibl` 6 + main = 'ibl', 7 + opts = {}, 8 + }, 9 + }
+95
config/ohmyposh/zen.toml
··· 1 + console_title_template = '{{ .Shell }} in {{ .Folder }}' 2 + version = 3 3 + final_space = true 4 + 5 + [secondary_prompt] 6 + template = '፨ ' 7 + foreground = '#B2A488' 8 + background = '' 9 + 10 + [transient_prompt] 11 + template = '» ' 12 + foreground = '' 13 + background = '' 14 + foreground_templates = [ 15 + '{{if gt .Code 0}}#FF5555{{end}}', 16 + '{{if eq .Code 0}}#8CA58C{{end}}', 17 + ] 18 + 19 + [[blocks]] 20 + type = 'prompt' 21 + alignment = 'left' 22 + 23 + [[blocks.segments]] 24 + style = 'plain' 25 + template = '{{ if .Env.VIRTUAL_ENV }}π {{ dir .Env.VIRTUAL_ENV | base }} {{ if .Output }}{{ .Output }}{{ end }} ። {{ end }}' 26 + foreground = '#518141' 27 + background = '' 28 + type = 'command' 29 + [blocks.segments.properties] 30 + command = '[ -n "$VIRTUAL_ENV" ] && $VIRTUAL_ENV/bin/python --version | cut -d" " -f2 || true' 31 + shell = 'bash' 32 + 33 + [[blocks.segments]] 34 + style = 'plain' 35 + template = '{{ if .Full }} go {{ .Full }}{{ end }} ' 36 + foreground = '#00ADD8' 37 + background = '' 38 + type = 'go' 39 + 40 + [[blocks.segments]] 41 + style = 'plain' 42 + template = '{{ .Path }}' 43 + foreground = '#bba8a6' 44 + background = '' 45 + type = 'path' 46 + 47 + [blocks.segments.properties] 48 + style = 'full' 49 + 50 + [[blocks.segments]] 51 + style = 'plain' 52 + template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <#D4AF37>{{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}</>' 53 + foreground = '#06e9f9' 54 + background = '' 55 + type = 'git' 56 + 57 + [blocks.segments.properties] 58 + branch_icon = '' 59 + commit_icon = '@' 60 + fetch_status = true 61 + 62 + [[blocks]] 63 + type = 'prompt' 64 + alignment = 'right' 65 + 66 + [[blocks.segments]] 67 + style = 'plain' 68 + template = '{{ .Output }}' 69 + foreground = '#bba8a6' 70 + background = '' 71 + type = 'command' 72 + 73 + [blocks.segments.properties] 74 + command = 'git log --pretty=format:%cr -1 || date +%H:%M:%S' 75 + fetch_timeout = 2000 76 + fetch_version = true 77 + responsive = true 78 + shell = 'bash' 79 + threshold = 0 80 + 81 + [[blocks]] 82 + type = 'prompt' 83 + alignment = 'left' 84 + newline = true 85 + 86 + [[blocks.segments]] 87 + style = 'plain' 88 + template = '»' 89 + foreground = '' 90 + background = '' 91 + type = 'text' 92 + foreground_templates = [ 93 + '{{if gt .Code 0}}#FF5555{{end}}', 94 + '{{if eq .Code 0}}#cde8ec{{end}}', 95 + ]
+50
config/tmux/tmux.conf
··· 1 + set -g default-terminal "tmux-256color" 2 + set -ag terminal-overrides ",xterm-256color:RGB" 3 + 4 + set -g prefix C-a 5 + unbind C-b 6 + bind-key C-a send-prefix 7 + 8 + unbind % 9 + bind | split-window -h 10 + 11 + unbind '"' 12 + bind - split-window -v 13 + 14 + unbind r 15 + bind r source-file ~/.tmux.conf 16 + 17 + bind j resize-pane -D 5 18 + bind k resize-pane -U 5 19 + bind l resize-pane -R 5 20 + bind h resize-pane -L 5 21 + 22 + bind -r m resize-pane -Z 23 + 24 + set -g mouse on 25 + 26 + set-window-option -g mode-keys vi 27 + 28 + bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v" 29 + bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y" 30 + 31 + unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode when dragging with mouse 32 + 33 + # remove delay for exiting insert mode with ESC in Neovim 34 + set -sg escape-time 10 35 + 36 + # tpm plugin 37 + set -g @plugin 'tmux-plugins/tpm' 38 + 39 + # list of tmux plugins 40 + set -g @plugin 'christoomey/vim-tmux-navigator' 41 + set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions after computer restart 42 + set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes 43 + set -g @plugin 'fabioluciano/tmux-tokyo-night' 44 + 45 + 46 + set -g @resurrect-capture-pane-contents 'on' 47 + set -g @continuum-restore 'on' 48 + 49 + # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 50 + run '~/.tmux/plugins/tpm/tpm'
+39
config/wezterm/wezterm.lua
··· 1 + -- Pull in the wezterm API 2 + local wezterm = require("wezterm") 3 + 4 + -- This will hold the configuration. 5 + local config = wezterm.config_builder() 6 + 7 + -- This is where you actually apply your config choices 8 + config.colors = { 9 + foreground = "#CBE0F0", 10 + background = "#011423", 11 + cursor_bg = "#47FF9C", 12 + cursor_border = "#47FF9C", 13 + cursor_fg = "#011423", 14 + selection_bg = "#033259", 15 + selection_fg = "#CBE0F0", 16 + ansi = { "#214969", "#E52E2E", "#44FFB1", "#FFE073", "#0FC5ED", "#a277ff", "#24EAF7", "#24EAF7" }, 17 + brights = { "#214969", "#E52E2E", "#44FFB1", "#FFE073", "#A277FF", "#a277ff", "#24EAF7", "#24EAF7" }, 18 + } 19 + 20 + config.font = wezterm.font("Fira Code") 21 + config.font_size = 19 22 + 23 + -- fix option key 24 + config.keys = { 25 + { key = "LeftArrow", mods = "OPT", action = wezterm.action({ SendString = "\x1bb" }) }, 26 + { key = "RightArrow", mods = "OPT", action = wezterm.action({ SendString = "\x1bf" }) }, 27 + } 28 + 29 + config.selection_word_boundary = " \t\n{}[]():\"'" 30 + 31 + -- to taste 32 + 33 + config.enable_tab_bar = false 34 + config.window_decorations = "RESIZE" 35 + config.window_background_opacity = 0.75 36 + config.macos_window_background_blur = 10 37 + 38 + -- and finally, return the configuration to wezterm 39 + return config
+81
config/zsh/aliases
··· 1 + # --- editor ---------------------------------------------------------------- 2 + alias vim='nvim' 3 + 4 + # --- git ------------------------------------------------------------------- 5 + alias gp='git push' 6 + alias gpl='git pull' 7 + alias gst='git status' 8 + alias gsw='git switch' 9 + alias gco='git checkout' 10 + alias ga='git add' 11 + alias gcmsg='git commit -m' 12 + alias grm='git rebase main' 13 + alias gpfl='git push --force-with-lease' 14 + alias gwta='git worktree add' 15 + alias ghistory="git log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%an%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)- %s%C(reset)' --all" 16 + 17 + # --- navigation ------------------------------------------------------------ 18 + alias ..='cd ..' 19 + alias ...='cd ../..' 20 + alias ....='cd ../../..' 21 + alias .....='cd ../../../..' 22 + 23 + # --- listing / files ------------------------------------------------------- 24 + alias l='ls -lah' 25 + alias rgf="rg --files | rg" 26 + alias ffile='l -R | ag' 27 + 28 + # --- tmux / tools ---------------------------------------------------------- 29 + alias t='tmux' 30 + alias m='mitmproxy' 31 + alias k='kubectl' 32 + alias konfig='kubectl config' 33 + alias tf='terraform' 34 + alias ipy='ipython' 35 + alias murder='kill -9' 36 + 37 + # --- docker ---------------------------------------------------------------- 38 + alias composeupf="docker compose up --build -d --remove-orphans && docker compose logs -f" 39 + 40 + # --- network --------------------------------------------------------------- 41 + alias whosthere='lsof -iTCP -sTCP:LISTEN' 42 + alias hosts="cat ~/.ssh/config | ag Host --nocolor" 43 + alias pid2port='f() { lsof -nP -iTCP -sTCP:LISTEN | rg "$(ps aux | rg "$1" | awk '"'"'{print $2}'"'"' | paste -sd '"'"'|'"'"' -)"; }; f' 44 + 45 + # --- python ---------------------------------------------------------------- 46 + alias cpc='uvx copychat' 47 + alias psw="uvx prefect cloud workspace set" 48 + 49 + # --- info ------------------------------------------------------------------ 50 + alias mern="echo 'User: $(whoami), Host: $(hostname), IP: '$(ifconfig | rg -o 'inet (\d{1,3}\.){3}\d{1,3}' | rg -v '127.0.0.1' | rg -v '255$' | rg -o '(\d{1,3}\.){3}\d{1,3}')" 51 + 52 + # --- custom scripts -------------------------------------------------------- 53 + alias lights='~/tangled.sh/@zzstoatzz.io/scripts/update-lights' 54 + 55 + # --- typo fixes ------------------------------------------------------------ 56 + alias clera='clear' 57 + alias claer='clear' 58 + alias cleara='clear' 59 + alias cleawr='clear' 60 + alias celar='clear' 61 + alias dlear='clear' 62 + alias vlear='clear' 63 + alias xlear='clear' 64 + alias cpear='clear' 65 + alias cmear='clear' 66 + alias ckear='clear' 67 + alias clesr='clear' 68 + alias clezr='clear' 69 + alias cleqr='clear' 70 + alias cleae='clear' 71 + alias cleat='clear' 72 + alias cleag='clear' 73 + alias cleaf='clear' 74 + alias claew='clear' 75 + alias clea='clear' 76 + alias clae='clear' 77 + 78 + # --- platform-conditional -------------------------------------------------- 79 + if [[ "$OSTYPE" == darwin* ]]; then 80 + alias zed="open -a /Applications/Zed.app -n" 81 + fi
+87
config/zsh/utils
··· 1 + function gbre() { 2 + local count=${1:-10} 3 + local email=${2:-"thrast36@gmail.com"} 4 + 5 + git for-each-ref --sort=-committerdate refs/heads \ 6 + --format="%(refname:short) %(committeremail)" | 7 + awk -v email="$email" '$2 == "<"email">" {print $1}' | 8 + head -n $count 9 + } 10 + 11 + git_exclude() { 12 + echo "$1" >> .git/info/exclude 13 + } 14 + 15 + 16 + mv_ext() { 17 + if [ "$#" -ne 3 ]; then 18 + echo "Usage: mv_ext <dir> <from_ext> <to_ext>" 19 + return 1 20 + fi 21 + 22 + local dir="$1" 23 + local from_ext="$2" 24 + local to_ext="$3" 25 + 26 + if [ ! -d "$dir" ]; then 27 + echo "Error: Directory '$dir' does not exist." 28 + return 1 29 + fi 30 + 31 + find "$dir" -type f -name "*.$from_ext" -exec bash -c 'mv "$0" "${0%.$1}.$2"' {} "$from_ext" "$to_ext" \; 32 + 33 + echo "Renamed all .$from_ext files to .$to_ext in $dir" 34 + } 35 + 36 + 37 + 38 + git_rebase_main() { 39 + current_branch=$(git branch --show-current) 40 + git checkout main 41 + git pull origin main 42 + git checkout "$current_branch" 43 + git rebase main 44 + } 45 + 46 + 47 + 48 + find_err() { 49 + local package=$1 50 + local command=$2 51 + local start_version=$3 52 + local reverse=$4 53 + 54 + # Get and sort versions, using sort -u to remove duplicates 55 + versions=($(pip index versions "$package" | rg -o '\d+\.\d+\.\d+' | sort -V -u)) 56 + if [[ "$reverse" == "reverse" ]]; then 57 + versions=($(echo "${versions[@]}" | tr ' ' '\n' | sort -rV -u)) 58 + fi 59 + 60 + # Print header 61 + echo "📦 Testing $package versions starting from $start_version" 62 + echo "🔍 Command: $command" 63 + echo "-------------------------------------------" 64 + 65 + local start=false 66 + local last_working_version="" 67 + 68 + for version in "${versions[@]}"; do 69 + if [[ "$version" == "$start_version" || "$start" == true ]]; then 70 + start=true 71 + printf "Testing v%-10s" "$version" 72 + 73 + # Run the command silently 74 + if output=$(uv run --with "$package==$version" python -c "$command" 2>&1); then 75 + echo " ✅" 76 + last_working_version=$version 77 + else 78 + echo " ❌" 79 + echo -e "\nFirst failing version: $version" 80 + echo "Last working version: $last_working_version" 81 + echo -e "\nError:" 82 + echo "$output" | tail -n 3 83 + break 84 + fi 85 + fi 86 + done 87 + }
+81
config/zsh/zshrc
··· 1 + # --- personal config ------------------------------------------------------- 2 + source ~/.aliases 3 + source ~/.utils 4 + 5 + # --- general settings ------------------------------------------------------ 6 + CASE_SENSITIVE="true" 7 + COMPLETION_WAITING_DOTS="true" 8 + 9 + WORDCHARS="*?_-.[]~=/&<>' " 10 + 11 + autoload -Uz select-word-style 12 + select-word-style normal 13 + zstyle ':zle:*' word-style unspecified 14 + 15 + # --- prompt ---------------------------------------------------------------- 16 + eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/zen.toml)" 17 + 18 + # --- plugins (nix-managed) ------------------------------------------------- 19 + if [ -d "$HOME/.nix-profile/share/zsh-autosuggestions" ]; then 20 + source "$HOME/.nix-profile/share/zsh-autosuggestions/zsh-autosuggestions.zsh" 21 + elif [ -d "/run/current-system/sw/share/zsh-autosuggestions" ]; then 22 + source "/run/current-system/sw/share/zsh-autosuggestions/zsh-autosuggestions.zsh" 23 + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]; then 24 + source "${HOMEBREW_PREFIX:-/opt/homebrew}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" 25 + fi 26 + 27 + if [ -d "$HOME/.nix-profile/share/zsh-syntax-highlighting" ]; then 28 + source "$HOME/.nix-profile/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" 29 + elif [ -d "/run/current-system/sw/share/zsh-syntax-highlighting" ]; then 30 + source "/run/current-system/sw/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" 31 + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]; then 32 + source "${HOMEBREW_PREFIX:-/opt/homebrew}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" 33 + fi 34 + 35 + # autojump 36 + [ -f "$HOME/.nix-profile/share/autojump/autojump.zsh" ] && source "$HOME/.nix-profile/share/autojump/autojump.zsh" 37 + [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/profile.d/autojump.sh" ] && source "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/profile.d/autojump.sh" 38 + 39 + # --- completions ----------------------------------------------------------- 40 + autoload -Uz compinit 41 + zstyle ':completion:*' menu select 42 + compinit 43 + fpath+=~/.zfunc 44 + 45 + # --- history --------------------------------------------------------------- 46 + HISTFILE=~/.zsh_history 47 + HISTSIZE=100000 48 + SAVEHIST=100000 49 + 50 + setopt APPEND_HISTORY 51 + setopt INC_APPEND_HISTORY 52 + setopt HIST_IGNORE_DUPS 53 + setopt HIST_IGNORE_SPACE 54 + setopt SHARE_HISTORY 55 + 56 + # --- limits ---------------------------------------------------------------- 57 + ulimit -n 4096 58 + 59 + # --- tool completions ------------------------------------------------------ 60 + command -v uv &>/dev/null && eval "$(uv generate-shell-completion zsh)" 61 + command -v uvx &>/dev/null && eval "$(uvx --generate-shell-completion zsh)" 62 + 63 + _uv_run_mod() { 64 + if [[ "$words[2]" == "run" && "$words[CURRENT]" != -* ]]; then 65 + _arguments '*:filename:_files' 66 + else 67 + _uv "$@" 68 + fi 69 + } 70 + compdef _uv_run_mod uv 71 + 72 + _uvx_run_mod() { 73 + if [[ $CURRENT -gt 2 ]]; then 74 + _arguments '*:filename:_files' 75 + fi 76 + } 77 + compdef _uvx_run_mod uvx 78 + 79 + # --- path additions (non-nix tools) ---------------------------------------- 80 + [ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH" 81 + [ -d "$HOME/.local/bin" ] && export PATH="$HOME/.local/bin:$PATH"
+48
flake.lock
··· 1 + { 2 + "nodes": { 3 + "home-manager": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1771037579, 11 + "narHash": "sha256-NX5XuhGcsmk0oEII2PEtMRgvh2KaAv3/WWQsOpxAgR4=", 12 + "owner": "nix-community", 13 + "repo": "home-manager", 14 + "rev": "05e6dc0f6ed936f918cb6f0f21f1dad1e4c53150", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "nix-community", 19 + "repo": "home-manager", 20 + "type": "github" 21 + } 22 + }, 23 + "nixpkgs": { 24 + "locked": { 25 + "lastModified": 1770843696, 26 + "narHash": "sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8=", 27 + "owner": "NixOS", 28 + "repo": "nixpkgs", 29 + "rev": "2343bbb58f99267223bc2aac4fc9ea301a155a16", 30 + "type": "github" 31 + }, 32 + "original": { 33 + "owner": "NixOS", 34 + "ref": "nixpkgs-unstable", 35 + "repo": "nixpkgs", 36 + "type": "github" 37 + } 38 + }, 39 + "root": { 40 + "inputs": { 41 + "home-manager": "home-manager", 42 + "nixpkgs": "nixpkgs" 43 + } 44 + } 45 + }, 46 + "root": "root", 47 + "version": 7 48 + }
+36
flake.nix
··· 1 + { 2 + description = "nate's dotfiles — zsh, nvim, tmux, wezterm, oh-my-posh"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 6 + home-manager = { 7 + url = "github:nix-community/home-manager"; 8 + inputs.nixpkgs.follows = "nixpkgs"; 9 + }; 10 + }; 11 + 12 + outputs = { nixpkgs, home-manager, ... }: 13 + let 14 + supportedSystems = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; 15 + 16 + mkHome = system: 17 + let 18 + pkgs = nixpkgs.legacyPackages.${system}; 19 + isDarwin = builtins.match ".*-darwin" system != null; 20 + in 21 + home-manager.lib.homeManagerConfiguration { 22 + inherit pkgs; 23 + modules = [ ./home.nix ]; 24 + extraSpecialArgs = { inherit isDarwin; }; 25 + }; 26 + in 27 + { 28 + homeConfigurations = builtins.listToAttrs (map (system: { 29 + name = "nate@${system}"; 30 + value = mkHome system; 31 + }) supportedSystems); 32 + 33 + # convenience: `nix run .` applies config for current system 34 + # usage: nix run home-manager -- switch --flake .#nate@$(nix eval --raw nixpkgs#system) 35 + }; 36 + }
+101
home.nix
··· 1 + { pkgs, isDarwin, ... }: 2 + 3 + { 4 + home.username = "nate"; 5 + home.homeDirectory = if isDarwin then "/Users/nate" else "/home/nate"; 6 + home.stateVersion = "24.05"; 7 + 8 + programs.home-manager.enable = true; 9 + 10 + # --- packages ----------------------------------------------------------- 11 + 12 + home.packages = with pkgs; [ 13 + # core shell 14 + zsh 15 + oh-my-posh 16 + tmux 17 + neovim 18 + 19 + # search / nav 20 + ripgrep 21 + fd 22 + fzf 23 + jq 24 + bat 25 + eza 26 + autojump 27 + 28 + # dev basics 29 + git 30 + gh 31 + curl 32 + wget 33 + tree 34 + dust 35 + 36 + # languages 37 + uv 38 + rustup 39 + go 40 + nodejs_22 41 + deno 42 + bun 43 + 44 + # zsh plugins (sourced in zshrc) 45 + zsh-autosuggestions 46 + zsh-syntax-highlighting 47 + 48 + # fonts 49 + nerd-fonts.fira-code 50 + ] ++ pkgs.lib.optionals (!isDarwin) [ 51 + wezterm 52 + ]; 53 + 54 + # --- session variables --------------------------------------------------- 55 + 56 + home.sessionVariables = { 57 + EDITOR = "nvim"; 58 + VISUAL = "nvim"; 59 + CARGO_NEW_EDITION = "2024"; 60 + }; 61 + 62 + # --- file symlinks ------------------------------------------------------- 63 + 64 + home.file = { 65 + # zsh 66 + ".zshrc".source = ./config/zsh/zshrc; 67 + ".aliases".source = ./config/zsh/aliases; 68 + ".utils".source = ./config/zsh/utils; 69 + 70 + # oh-my-posh 71 + ".config/ohmyposh/zen.toml".source = ./config/ohmyposh/zen.toml; 72 + 73 + # tmux 74 + ".tmux.conf".source = ./config/tmux/tmux.conf; 75 + 76 + # wezterm 77 + ".wezterm.lua".source = ./config/wezterm/wezterm.lua; 78 + 79 + # neovim 80 + ".config/nvim/init.lua".source = ./config/nvim/init.lua; 81 + ".config/nvim/lazy-lock.json".source = ./config/nvim/lazy-lock.json; 82 + ".config/nvim/.stylua.toml".source = ./config/nvim/.stylua.toml; 83 + ".config/nvim/doc/kickstart.txt".source = ./config/nvim/doc/kickstart.txt; 84 + ".config/nvim/lua/custom/plugins/init.lua".source = ./config/nvim/lua/custom/plugins/init.lua; 85 + ".config/nvim/lua/kickstart/health.lua".source = ./config/nvim/lua/kickstart/health.lua; 86 + ".config/nvim/lua/kickstart/plugins/debug.lua".source = ./config/nvim/lua/kickstart/plugins/debug.lua; 87 + ".config/nvim/lua/kickstart/plugins/indent_line.lua".source = ./config/nvim/lua/kickstart/plugins/indent_line.lua; 88 + 89 + # atuin 90 + ".config/atuin/config.toml".source = ./config/atuin/config.toml; 91 + 92 + # git 93 + ".gitconfig".source = ./config/git/config; 94 + 95 + # bin 96 + "bin/disk-breakdown" = { 97 + source = ./bin/disk-breakdown; 98 + executable = true; 99 + }; 100 + }; 101 + }