├── .docs └── images │ └── neovim.png ├── .envrc ├── .github └── workflows │ ├── renovate.yaml │ └── update-flake.yaml ├── .gitignore ├── LICENSE ├── README.md ├── config ├── auto_cmds.nix ├── default.nix ├── file_types.nix ├── keymaps.nix ├── plugins │ ├── cmp │ │ ├── autopairs.nix │ │ ├── cmp-copilot.nix │ │ ├── cmp.nix │ │ ├── lspkind.nix │ │ └── schemastore.nix │ ├── editor │ │ ├── copilot-chat.nix │ │ ├── illuminate.nix │ │ ├── indent-blankline.nix │ │ ├── navic.nix │ │ ├── neo-tree.nix │ │ ├── todo-comments.nix │ │ ├── treesitter.nix │ │ └── undotree.nix │ ├── git │ │ ├── gitsigns.nix │ │ └── lazygit.nix │ ├── lsp │ │ ├── conform.nix │ │ ├── fidget.nix │ │ └── lsp.nix │ ├── snippets │ │ └── luasnip.nix │ ├── themes │ │ └── default.nix │ ├── ui │ │ ├── bufferline.nix │ │ ├── lualine.nix │ │ └── startup.nix │ └── utils │ │ ├── extra_plugins.nix │ │ ├── markdown-preview.nix │ │ ├── mini.nix │ │ ├── obsidian.nix │ │ ├── telescope.nix │ │ ├── toggleterm.nix │ │ ├── web-devicons.nix │ │ └── whichkey.nix └── settings.nix ├── flake.lock ├── flake.nix └── renovate.json5 /.docs/images/neovim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dc-tec/nixvim/9539aae2a9800827776b22024dfbc5a9b363f6f8/.docs/images/neovim.png -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | use_flake 2 | -------------------------------------------------------------------------------- /.github/workflows/renovate.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | - cron: "30 00 * * 0" 4 | 5 | jobs: 6 | renovate: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: checkout 10 | uses: actions/checkout@v4 11 | - name: Renovate 12 | uses: renovatebot/github-action@v42.0.4 13 | with: 14 | configurationFile: renovate.json5 15 | renovate-version: full 16 | token: ${{ secrets.RENOVATE_TOKEN }} 17 | -------------------------------------------------------------------------------- /.github/workflows/update-flake.yaml: -------------------------------------------------------------------------------- 1 | name: Update Flake and Validate Build 2 | 3 | on: 4 | schedule: 5 | - cron: "30 00 * * 1" 6 | workflow_dispatch: # Allow manual triggering 7 | 8 | # Set default permissions as read only 9 | permissions: read-all 10 | 11 | jobs: 12 | update-flake: 13 | runs-on: ubuntu-latest 14 | permissions: 15 | # Only need contents write to update the flake lock file 16 | contents: write 17 | outputs: 18 | update_available: ${{ steps.check_updates.outputs.update_available }} 19 | 20 | steps: 21 | - name: Repository Checkout 22 | uses: actions/checkout@v4 23 | 24 | - name: Install Nix 25 | uses: DeterminateSystems/nix-installer-action@v17 26 | 27 | - name: Check for Updates 28 | id: check_updates 29 | run: | 30 | # Create a temporary copy of flake.lock 31 | cp flake.lock flake.lock.backup 32 | 33 | # Try to update flake.lock 34 | nix flake update 35 | 36 | # Check if there are differences 37 | if ! cmp -s flake.lock flake.lock.backup; then 38 | echo "update_available=true" >> "$GITHUB_OUTPUT" 39 | # Restore original flake.lock 40 | mv flake.lock.backup flake.lock 41 | else 42 | echo "update_available=false" >> "$GITHUB_OUTPUT" 43 | fi 44 | 45 | - name: Update flake.lock 46 | if: steps.check_updates.outputs.update_available == 'true' 47 | uses: DeterminateSystems/update-flake-lock@v25 48 | with: 49 | nix-options: --debug --log-format raw 50 | token: ${{ secrets.FLAKE_TOKEN }} 51 | pr-title: "deps: update flake.lock" 52 | pr-labels: | 53 | dependencies 54 | automated 55 | 56 | build-and-check: 57 | needs: update-flake 58 | permissions: 59 | # Needed for checking out code 60 | contents: read 61 | # Needed for creating issues 62 | issues: write 63 | strategy: 64 | matrix: 65 | os: [ubuntu-latest, macos-latest] 66 | fail-fast: false # Continue with other jobs even if one fails 67 | 68 | runs-on: ${{ matrix.os }} 69 | 70 | steps: 71 | - name: Repository Checkout 72 | uses: actions/checkout@v4 73 | with: 74 | ref: update_flake_lock_action 75 | 76 | - name: Install Nix 77 | uses: DeterminateSystems/nix-installer-action@v17 78 | 79 | - name: Build and Test Configuration 80 | id: build 81 | continue-on-error: true # Continue to next steps even if build fails 82 | run: | 83 | set +e # Don't exit immediately on error 84 | # Run the build and capture output 85 | OUTPUT=$(nix build .# 2>&1) 86 | BUILD_EXIT_CODE=$? 87 | echo "build_output<> $GITHUB_ENV 88 | echo "$OUTPUT" >> $GITHUB_ENV 89 | echo "EOF" >> $GITHUB_ENV 90 | 91 | # Check if build succeeded 92 | if [ $BUILD_EXIT_CODE -eq 0 ]; then 93 | echo "build_status=success" >> $GITHUB_ENV 94 | else 95 | echo "build_status=failure" >> $GITHUB_ENV 96 | # Ensure the error is visible in the logs 97 | echo "::error::Build failed with exit code $BUILD_EXIT_CODE" 98 | echo "$OUTPUT" 99 | fi 100 | 101 | - name: Create Issue on Build Failure 102 | if: env.build_status == 'failure' 103 | uses: actions/github-script@v7 104 | with: 105 | script: | 106 | const os = '${{ matrix.os }}'; 107 | const buildOutput = process.env.build_output; 108 | const isUpdate = '${{ needs.update-flake.outputs.update_available }}' === 'true'; 109 | 110 | // Extract warnings and errors from build output 111 | const warnings = buildOutput.match(/evaluation warning:[^\n]+/g) || []; 112 | const errors = buildOutput.match(/error:[^\n]+/g) || []; 113 | 114 | // Create a summary section 115 | const summary = [ 116 | warnings.length > 0 ? `${warnings.length} evaluation warnings` : '', 117 | errors.length > 0 ? `${errors.length} errors` : '' 118 | ].filter(Boolean).join(' and '); 119 | 120 | // Get repository information from context 121 | const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); 122 | 123 | await github.rest.issues.create({ 124 | owner, 125 | repo, 126 | title: `🔨 Build Failed on ${os}: ${summary}${isUpdate ? ' (Dependency Update)' : ''}`, 127 | body: `Build failed during automated validation on ${os}${isUpdate ? ' while testing dependency updates.' : '.'}\n 128 | ${isUpdate ? 'This failure occurred on the dependency update branch `deps/update-flake-lock`.' : 'This failure occurred on the main branch.'}\n 129 | 130 | ### Summary 131 | ${summary}\n 132 | 133 | ${warnings.length > 0 ? `### Warnings\n\`\`\`\n${warnings.join('\n')}\n\`\`\`\n` : ''} 134 | ${errors.length > 0 ? `### Errors\n\`\`\`\n${errors.join('\n')}\n\`\`\`\n` : ''} 135 | 136 |
137 | Build Output 138 | 139 | \`\`\` 140 | ${buildOutput} 141 | \`\`\` 142 |
143 | 144 | Please review the build output and fix any issues.`, 145 | labels: [ 146 | 'build-failure', 147 | 'bug', 148 | ...(warnings.length > 0 ? ['has-warnings'] : []), 149 | ...(errors.length > 0 ? ['has-errors'] : []) 150 | ] 151 | }); 152 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .direnv/ 2 | .pre-commit-config.yaml 3 | result 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NixVim Configuration 2 | 3 | This repository contains my personal configuration NixVim, a Neovim configuration managed with Nix. 4 | 5 | ![Neovim](./.docs/images/neovim.png) 6 | 7 | ## How to use 8 | 9 | You can use this flake as an input: 10 | 11 | ```nix 12 | { 13 | inputs = { 14 | nixvim.url = "github:dc-tec/nixvim" 15 | }; 16 | } 17 | ``` 18 | 19 | You can then install the package either normally or through home-manager. 20 | 21 | #### Normal: 22 | 23 | ```nix 24 | environment.systemPackages = [ 25 | inputs.nixvim.packages.x86_64-linux.default 26 | ]; 27 | ``` 28 | 29 | #### Home-Manager 30 | 31 | ```nix 32 | home-manager.users..home.packages = [ 33 | inputs.nixvim.packages.x86_64-linux.default 34 | ]; 35 | ``` 36 | 37 | ## Plugins 38 | 39 | ### General Configuration 40 | 41 | - `settings.nix`: Contains general settings for Neovim. 42 | - `keymaps.nix`: Defines key mappings. 43 | - `auto_cmds.nix`: Sets up automatic commands. 44 | - `file_types.nix`: Configures file type specific settings. 45 | 46 | ### Themes 47 | 48 | - `default.nix`: Sets the default theme. 49 | 50 | ### Completion 51 | 52 | - `cmp.nix`: Configures the cmp completion framework. 53 | - `cmp-copilot.nix`: Adds GitHub Copilot support to cmp. 54 | - `lspkind.nix`: Adds icons to lsp completion items. 55 | - `autopairs.nix`: Adds the autopairs plugin. 56 | - `schemastore.nix`: Adds the schemastore plugin for JSON and YAML schemas. 57 | 58 | ### Snippets 59 | 60 | - `luasnip.nix`: Configures the LuaSnip snippet engine. 61 | 62 | ### Editor Plugins and Configurations 63 | 64 | - `neo-tree.nix`: Configures the NeoTree file explorer. 65 | - `treesitter.nix`: Configures the TreeSitter syntax highlighter. 66 | - `undotree.nix`: Configures the UndoTree undo history visualizer. 67 | - `illuminate.nix`: Configures the Illuminate plugin for highlighting other uses of the current word under the cursor. 68 | - `indent-blankline.nix`: Configures the Indent Blankline plugin for displaying indentation levels. 69 | - `todo-comments.nix`: Configures the Todo Comments plugin for highlighting TODO comments. 70 | - `copilot-chat.nix`: Configures the Copilot Chat plugin for interacting with GitHub Copilot. 71 | - `navic.nix`: Configures the Navic plugin, shows the current code context. 72 | 73 | ### UI Plugins 74 | 75 | - `bufferline.nix`: Configures the Bufferline plugin for enhanced buffer/tab display. 76 | - `lualine.nix`: Configures the Lualine status line plugin. 77 | - `startup.nix`: Configures the startup screen. 78 | 79 | ### LSP 80 | 81 | - `lsp.nix`: Configures the Neovim LSP client. 82 | - `conform.nix`: Configures the Conform plugin for automatic code formatting. 83 | - `fidget.nix`: Configures the Fidget plugin for displaying LSP diagnostics in the status line. 84 | 85 | ### Git 86 | 87 | - `lazygit.nix`: Configures the LazyGit plugin for Git integration. 88 | - `gitsigns.nix`: Configures the GitSigns plugin for displaying Git diff information. 89 | 90 | ### Utils 91 | 92 | - `telescope.nix`: Configures the Telescope plugin for fuzzy finding and picking. 93 | - `whichkey.nix`: Configures the WhichKey plugin for displaying key mappings. 94 | - `extra_plugins.nix`: Configures additional plugins. 95 | - `mini.nix`: Configures the Mini plugin. 96 | - `obsidian.nix`: Confiugres the Obsidian plugin, for note-taking purposes. 97 | - `markdown-preview.nix`: Configures the Markdown Preview plugin. 98 | - `toggleterm.nix`: Configures Terminal plugin. 99 | 100 | Please refer to the individual `.nix` files for more detailed configuration information. 101 | 102 | ## References 103 | 104 | This configuration has taken inspiration from the following contributors. 105 | 106 | - [Elythh](https://github.com/elythh/nixvim) 107 | - [MikaelFangel](https://github.com/MikaelFangel/nixvim-config) 108 | -------------------------------------------------------------------------------- /config/auto_cmds.nix: -------------------------------------------------------------------------------- 1 | { 2 | autoGroups = { 3 | highlight_yank = { }; 4 | vim_enter = { }; 5 | indentscope = { }; 6 | restore_cursor = { }; 7 | }; 8 | 9 | autoCmd = [ 10 | { 11 | group = "highlight_yank"; 12 | event = [ "TextYankPost" ]; 13 | pattern = "*"; 14 | callback = { 15 | __raw = '' 16 | function() 17 | vim.highlight.on_yank() 18 | end 19 | ''; 20 | }; 21 | } 22 | { 23 | group = "vim_enter"; 24 | event = [ "VimEnter" ]; 25 | pattern = "*"; 26 | callback = { 27 | __raw = '' 28 | function() 29 | vim.cmd('Startup') 30 | end 31 | ''; 32 | }; 33 | } 34 | { 35 | group = "indentscope"; 36 | event = [ "FileType" ]; 37 | pattern = [ 38 | "help" 39 | "Startup" 40 | "startup" 41 | "neo-tree" 42 | "Trouble" 43 | "trouble" 44 | "notify" 45 | ]; 46 | callback = { 47 | __raw = '' 48 | function() 49 | vim.b.miniindentscope_disable = true 50 | end 51 | ''; 52 | }; 53 | } 54 | ## from NVChad https://nvchad.com/docs/recipes (this autocmd will restore the cursor position when opening a file) 55 | { 56 | group = "restore_cursor"; 57 | event = [ "BufReadPost" ]; 58 | pattern = "*"; 59 | callback = { 60 | __raw = '' 61 | function() 62 | if 63 | vim.fn.line "'\"" > 1 64 | and vim.fn.line "'\"" <= vim.fn.line "$" 65 | and vim.bo.filetype ~= "commit" 66 | and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 67 | then 68 | vim.cmd "normal! g`\"" 69 | end 70 | end 71 | ''; 72 | }; 73 | } 74 | ]; 75 | } 76 | -------------------------------------------------------------------------------- /config/default.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | imports = [ 3 | # General Configuration 4 | ./settings.nix 5 | ./keymaps.nix 6 | ./auto_cmds.nix 7 | ./file_types.nix 8 | 9 | # Themes 10 | ./plugins/themes 11 | 12 | # Completion 13 | ./plugins/cmp/cmp.nix 14 | ./plugins/cmp/cmp-copilot.nix 15 | ./plugins/cmp/lspkind.nix 16 | ./plugins/cmp/autopairs.nix 17 | ./plugins/cmp/schemastore.nix 18 | 19 | # Snippets 20 | ./plugins/snippets/luasnip.nix 21 | 22 | # Editor plugins and configurations 23 | ./plugins/editor/neo-tree.nix 24 | ./plugins/editor/treesitter.nix 25 | ./plugins/editor/undotree.nix 26 | ./plugins/editor/illuminate.nix 27 | ./plugins/editor/indent-blankline.nix 28 | ./plugins/editor/todo-comments.nix 29 | ./plugins/editor/copilot-chat.nix 30 | ./plugins/editor/navic.nix 31 | 32 | # UI plugins 33 | ./plugins/ui/bufferline.nix 34 | ./plugins/ui/lualine.nix 35 | ./plugins/ui/startup.nix 36 | 37 | # LSP and formatting 38 | ./plugins/lsp/lsp.nix 39 | ./plugins/lsp/conform.nix 40 | ./plugins/lsp/fidget.nix 41 | 42 | # Git 43 | ./plugins/git/lazygit.nix 44 | ./plugins/git/gitsigns.nix 45 | 46 | # Utils 47 | ./plugins/utils/telescope.nix 48 | ./plugins/utils/whichkey.nix 49 | ./plugins/utils/extra_plugins.nix 50 | ./plugins/utils/mini.nix 51 | ./plugins/utils/markdown-preview.nix 52 | ./plugins/utils/obsidian.nix 53 | ./plugins/utils/toggleterm.nix 54 | ./plugins/utils/web-devicons.nix 55 | ]; 56 | } 57 | -------------------------------------------------------------------------------- /config/file_types.nix: -------------------------------------------------------------------------------- 1 | { 2 | autoGroups = { 3 | filetypes = { }; 4 | }; 5 | 6 | files."ftdetect/terraformft.lua".autoCmd = [ 7 | { 8 | group = "filetypes"; 9 | event = [ 10 | "BufRead" 11 | "BufNewFile" 12 | ]; 13 | pattern = [ 14 | "*.tf" 15 | " *.tfvars" 16 | " *.hcl" 17 | ]; 18 | command = "set ft=terraform"; 19 | } 20 | ]; 21 | 22 | files."ftdetect/bicepft.lua".autoCmd = [ 23 | { 24 | group = "filetypes"; 25 | event = [ 26 | "BufRead" 27 | "BufNewFile" 28 | ]; 29 | pattern = [ 30 | "*.bicep" 31 | "*.bicepparam" 32 | ]; 33 | command = "set ft=bicep"; 34 | } 35 | ]; 36 | } 37 | -------------------------------------------------------------------------------- /config/keymaps.nix: -------------------------------------------------------------------------------- 1 | { 2 | globals.mapleader = " "; 3 | 4 | keymaps = [ 5 | { 6 | mode = [ 7 | "n" 8 | "x" 9 | ]; 10 | key = "j"; 11 | action = "v:count == 0 ? 'gj' : 'j'"; 12 | options = { 13 | expr = true; 14 | silent = true; 15 | }; 16 | } 17 | { 18 | mode = [ 19 | "n" 20 | "x" 21 | ]; 22 | key = ""; 23 | action = "v:count == 0 ? 'gj' : 'j'"; 24 | options = { 25 | expr = true; 26 | silent = true; 27 | }; 28 | } 29 | { 30 | mode = [ 31 | "n" 32 | "x" 33 | ]; 34 | key = "k"; 35 | action = "v:count == 0 ? 'gk' : 'k'"; 36 | options = { 37 | expr = true; 38 | silent = true; 39 | }; 40 | } 41 | { 42 | mode = [ 43 | "n" 44 | "x" 45 | ]; 46 | key = ""; 47 | action = "v:count == 0 ? 'gk' : 'k'"; 48 | options = { 49 | expr = true; 50 | silent = true; 51 | }; 52 | } 53 | { 54 | mode = "n"; 55 | key = ""; 56 | action = "h"; 57 | options = { 58 | desc = "Go to Left Window"; 59 | remap = true; 60 | }; 61 | } 62 | { 63 | mode = "n"; 64 | key = ""; 65 | action = "j"; 66 | options = { 67 | desc = "Go to Lower Window"; 68 | remap = true; 69 | }; 70 | } 71 | { 72 | mode = "n"; 73 | key = ""; 74 | action = "k"; 75 | options = { 76 | desc = "Go to Upper Window"; 77 | remap = true; 78 | }; 79 | } 80 | { 81 | mode = "n"; 82 | key = ""; 83 | action = "l"; 84 | options = { 85 | desc = "Go to Right Window"; 86 | remap = true; 87 | }; 88 | } 89 | { 90 | mode = "n"; 91 | key = ""; 92 | action = "resize +2"; 93 | options = { 94 | desc = "Increase Window Height"; 95 | }; 96 | } 97 | { 98 | mode = "n"; 99 | key = ""; 100 | action = "resize -2"; 101 | options = { 102 | desc = "Decrease Window Height"; 103 | }; 104 | } 105 | { 106 | mode = "n"; 107 | key = ""; 108 | action = "vertical resize -2"; 109 | options = { 110 | desc = "Decrease Window Width"; 111 | }; 112 | } 113 | { 114 | mode = "n"; 115 | key = ""; 116 | action = "vertical resize +2"; 117 | options = { 118 | desc = "Increase Window Width"; 119 | }; 120 | } 121 | { 122 | mode = "n"; 123 | key = ""; 124 | action = "m .+1=="; 125 | options = { 126 | desc = "Move Down"; 127 | }; 128 | } 129 | { 130 | mode = "n"; 131 | key = ""; 132 | action = "m .-2=="; 133 | options = { 134 | desc = "Move Up"; 135 | }; 136 | } 137 | { 138 | mode = "i"; 139 | key = ""; 140 | action = "m .+1==gi"; 141 | options = { 142 | desc = "Move Down"; 143 | }; 144 | } 145 | { 146 | mode = "i"; 147 | key = ""; 148 | action = "m .-2==gi"; 149 | options = { 150 | desc = "Move Up"; 151 | }; 152 | } 153 | { 154 | mode = "v"; 155 | key = ""; 156 | action = ":m '>+1gv=gv"; 157 | options = { 158 | desc = "Move Down"; 159 | }; 160 | } 161 | { 162 | mode = "v"; 163 | key = ""; 164 | action = ":m '<-2gv=gv"; 165 | options = { 166 | desc = "Move Up"; 167 | }; 168 | } 169 | { 170 | mode = "i"; 171 | key = ";"; 172 | action = ";u"; 173 | } 174 | { 175 | mode = "i"; 176 | key = "."; 177 | action = ".u"; 178 | } 179 | { 180 | mode = "i"; 181 | key = ";"; 182 | action = ";u"; 183 | } 184 | { 185 | mode = [ 186 | "i" 187 | "x" 188 | "n" 189 | "s" 190 | ]; 191 | key = ""; 192 | action = "w"; 193 | options = { 194 | desc = "Save File"; 195 | }; 196 | } 197 | { 198 | mode = [ 199 | "i" 200 | "n" 201 | ]; 202 | key = ""; 203 | action = "noh"; 204 | options = { 205 | desc = "Escape and Clear hlsearch"; 206 | }; 207 | } 208 | { 209 | mode = "n"; 210 | key = "ur"; 211 | action = "nohlsearchdiffupdatenormal! "; 212 | options = { 213 | desc = "Redraw / Clear hlsearch / Diff Update"; 214 | }; 215 | } 216 | { 217 | mode = "n"; 218 | key = "n"; 219 | action = "'Nn'[v:searchforward].'zv'"; 220 | options = { 221 | expr = true; 222 | desc = "Next Search Result"; 223 | }; 224 | } 225 | { 226 | mode = "x"; 227 | key = "n"; 228 | action = "'Nn'[v:searchforward]"; 229 | options = { 230 | expr = true; 231 | desc = "Next Search Result"; 232 | }; 233 | } 234 | { 235 | mode = "o"; 236 | key = "n"; 237 | action = "'Nn'[v:searchforward]"; 238 | options = { 239 | expr = true; 240 | desc = "Next Search Result"; 241 | }; 242 | } 243 | { 244 | mode = "n"; 245 | key = "N"; 246 | action = "'nN'[v:searchforward].'zv'"; 247 | options = { 248 | expr = true; 249 | desc = "Prev Search Result"; 250 | }; 251 | } 252 | { 253 | mode = "x"; 254 | key = "N"; 255 | action = "'nN'[v:searchforward]"; 256 | options = { 257 | expr = true; 258 | desc = "Prev Search Result"; 259 | }; 260 | } 261 | { 262 | mode = "o"; 263 | key = "N"; 264 | action = "'nN'[v:searchforward]"; 265 | options = { 266 | expr = true; 267 | desc = "Prev Search Result"; 268 | }; 269 | } 270 | { 271 | mode = "n"; 272 | key = "cd"; 273 | action = "vim.diagnostic.open_float"; 274 | options = { 275 | desc = "Line Diagnostics"; 276 | }; 277 | } 278 | { 279 | mode = "n"; 280 | key = "]d"; 281 | action = "diagnostic_goto(true)"; 282 | options = { 283 | desc = "Next Diagnostic"; 284 | }; 285 | } 286 | { 287 | mode = "n"; 288 | key = "[d"; 289 | action = "diagnostic_goto(false)"; 290 | options = { 291 | desc = "Prev Diagnostic"; 292 | }; 293 | } 294 | { 295 | mode = "n"; 296 | key = "]e"; 297 | action = "diagnostic_goto(true 'ERROR')"; 298 | options = { 299 | desc = "Next Error"; 300 | }; 301 | } 302 | { 303 | mode = "n"; 304 | key = "[e"; 305 | action = "diagnostic_goto(false 'ERROR')"; 306 | options = { 307 | desc = "Prev Error"; 308 | }; 309 | } 310 | { 311 | mode = "n"; 312 | key = "]w"; 313 | action = "diagnostic_goto(true 'WARN')"; 314 | options = { 315 | desc = "Next Warning"; 316 | }; 317 | } 318 | { 319 | mode = "n"; 320 | key = "[w"; 321 | action = "diagnostic_goto(false 'WARN')"; 322 | options = { 323 | desc = "Prev Warning"; 324 | }; 325 | } 326 | { 327 | mode = "n"; 328 | key = "qq"; 329 | action = "qa"; 330 | options = { 331 | desc = "Quit All"; 332 | }; 333 | } 334 | { 335 | mode = "n"; 336 | key = "ui"; 337 | action = "vim.show_pos"; 338 | options = { 339 | desc = "Inspect Pos"; 340 | }; 341 | } 342 | { 343 | mode = "t"; 344 | key = ""; 345 | action = ""; 346 | options = { 347 | desc = "Enter Normal Mode"; 348 | }; 349 | } 350 | { 351 | mode = "t"; 352 | key = ""; 353 | action = "wincmd h"; 354 | options = { 355 | desc = "Go to Left Window"; 356 | }; 357 | } 358 | { 359 | mode = "t"; 360 | key = ""; 361 | action = "wincmd j"; 362 | options = { 363 | desc = "Go to Lower Window"; 364 | }; 365 | } 366 | { 367 | mode = "t"; 368 | key = ""; 369 | action = "wincmd k"; 370 | options = { 371 | desc = "Go to Upper Window"; 372 | }; 373 | } 374 | { 375 | mode = "t"; 376 | key = ""; 377 | action = "wincmd l"; 378 | options = { 379 | desc = "Go to Right Window"; 380 | }; 381 | } 382 | { 383 | mode = "t"; 384 | key = ""; 385 | action = "close"; 386 | options = { 387 | desc = "Hide Terminal"; 388 | }; 389 | } 390 | { 391 | mode = "n"; 392 | key = "ww"; 393 | action = "p"; 394 | options = { 395 | desc = "Other Window"; 396 | remap = true; 397 | }; 398 | } 399 | { 400 | mode = "n"; 401 | key = "wd"; 402 | action = "c"; 403 | options = { 404 | desc = "Delete Window"; 405 | remap = true; 406 | }; 407 | } 408 | { 409 | mode = "n"; 410 | key = "w-"; 411 | action = "s"; 412 | options = { 413 | desc = "Split Window Below"; 414 | remap = true; 415 | }; 416 | } 417 | { 418 | mode = "n"; 419 | key = "w|"; 420 | action = "v"; 421 | options = { 422 | desc = "Split Window Right"; 423 | remap = true; 424 | }; 425 | } 426 | { 427 | mode = "n"; 428 | key = "-"; 429 | action = "s"; 430 | options = { 431 | desc = "Split Window Below"; 432 | remap = true; 433 | }; 434 | } 435 | { 436 | mode = "n"; 437 | key = "|"; 438 | action = "v"; 439 | options = { 440 | desc = "Split Window Right"; 441 | remap = true; 442 | }; 443 | } 444 | { 445 | mode = "n"; 446 | key = "l"; 447 | action = "tablast"; 448 | options = { 449 | desc = "Last Tab"; 450 | }; 451 | } 452 | { 453 | mode = "n"; 454 | key = "f"; 455 | action = "tabfirst"; 456 | options = { 457 | desc = "First Tab"; 458 | }; 459 | } 460 | { 461 | mode = "n"; 462 | key = ""; 463 | action = "tabnew"; 464 | options = { 465 | desc = "New Tab"; 466 | }; 467 | } 468 | { 469 | mode = "n"; 470 | key = "]"; 471 | action = "tabnext"; 472 | options = { 473 | desc = "Next Tab"; 474 | }; 475 | } 476 | { 477 | mode = "n"; 478 | key = "d"; 479 | action = "tabclose"; 480 | options = { 481 | desc = "Close Tab"; 482 | }; 483 | } 484 | { 485 | mode = "n"; 486 | key = "["; 487 | action = "tabprevious"; 488 | options = { 489 | desc = "Previous Tab"; 490 | }; 491 | } 492 | ]; 493 | } 494 | -------------------------------------------------------------------------------- /config/plugins/cmp/autopairs.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.nvim-autopairs = { 3 | enable = true; 4 | settings = { 5 | disable_filetype = [ 6 | "TelescopePrompt" 7 | "vim" 8 | ]; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /config/plugins/cmp/cmp-copilot.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.copilot-cmp = { 3 | enable = true; 4 | }; 5 | plugins.copilot-lua = { 6 | settings = { 7 | copilot = { 8 | suggestion = { 9 | enabled = false; 10 | }; 11 | panel = { 12 | enabled = false; 13 | }; 14 | }; 15 | }; 16 | }; 17 | 18 | extraConfigLua = '' 19 | require("copilot").setup({ 20 | suggestion = { enabled = false }, 21 | panel = { enabled = false }, 22 | }) 23 | ''; 24 | } 25 | -------------------------------------------------------------------------------- /config/plugins/cmp/cmp.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins = { 3 | cmp-emoji = { 4 | enable = true; 5 | }; 6 | cmp = { 7 | enable = true; 8 | settings = { 9 | autoEnableSources = true; 10 | experimental = { 11 | ghost_text = false; 12 | }; 13 | performance = { 14 | debounce = 60; 15 | fetchingTimeout = 200; 16 | maxViewEntries = 30; 17 | }; 18 | snippet = { 19 | expand = "luasnip"; 20 | }; 21 | formatting = { 22 | fields = [ 23 | "kind" 24 | "abbr" 25 | "menu" 26 | ]; 27 | }; 28 | sources = [ 29 | { name = "git"; } 30 | { name = "nvim_lsp"; } 31 | { name = "emoji"; } 32 | { 33 | name = "buffer"; # text within current buffer 34 | option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; 35 | keywordLength = 3; 36 | } 37 | { name = "copilot"; } 38 | { 39 | name = "path"; # file system paths 40 | keywordLength = 3; 41 | } 42 | { 43 | name = "luasnip"; # snippets 44 | keywordLength = 3; 45 | } 46 | ]; 47 | 48 | window = { 49 | completion = { 50 | border = "solid"; 51 | }; 52 | documentation = { 53 | border = "solid"; 54 | }; 55 | }; 56 | 57 | mapping = { 58 | "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; 59 | "" = "cmp.mapping.select_next_item()"; 60 | "" = "cmp.mapping.select_prev_item()"; 61 | "" = "cmp.mapping.abort()"; 62 | "" = "cmp.mapping.scroll_docs(-4)"; 63 | "" = "cmp.mapping.scroll_docs(4)"; 64 | "" = "cmp.mapping.complete()"; 65 | "" = "cmp.mapping.confirm({ select = true })"; 66 | "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; 67 | }; 68 | }; 69 | }; 70 | cmp-nvim-lsp = { 71 | enable = true; 72 | }; # lsp 73 | cmp-buffer = { 74 | enable = true; 75 | }; 76 | cmp-path = { 77 | enable = true; 78 | }; # file system paths 79 | cmp_luasnip = { 80 | enable = true; 81 | }; # snippets 82 | cmp-cmdline = { 83 | enable = false; 84 | }; # autocomplete for cmdline 85 | }; 86 | extraConfigLua = '' 87 | luasnip = require("luasnip") 88 | kind_icons = { 89 | Text = "󰊄", 90 | Method = " ", 91 | Function = "󰡱 ", 92 | Constructor = " ", 93 | Field = " ", 94 | Variable = "󱀍 ", 95 | Class = " ", 96 | Interface = " ", 97 | Module = "󰕳 ", 98 | Property = " ", 99 | Unit = " ", 100 | Value = " ", 101 | Enum = " ", 102 | Keyword = " ", 103 | Snippet = " ", 104 | Color = " ", 105 | File = "", 106 | Reference = " ", 107 | Folder = " ", 108 | EnumMember = " ", 109 | Constant = " ", 110 | Struct = " ", 111 | Event = " ", 112 | Operator = " ", 113 | TypeParameter = " ", 114 | } 115 | 116 | local cmp = require'cmp' 117 | 118 | -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). 119 | cmp.setup.cmdline({'/', "?" }, { 120 | sources = { 121 | { name = 'buffer' } 122 | } 123 | }) 124 | 125 | -- Set configuration for specific filetype. 126 | cmp.setup.filetype('gitcommit', { 127 | sources = cmp.config.sources({ 128 | { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. 129 | }, { 130 | { name = 'buffer' }, 131 | }) 132 | }) 133 | 134 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 135 | cmp.setup.cmdline(':', { 136 | sources = cmp.config.sources({ 137 | { name = 'path' } 138 | }, { 139 | { name = 'cmdline' } 140 | }), 141 | }) ''; 142 | } 143 | -------------------------------------------------------------------------------- /config/plugins/cmp/lspkind.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.lspkind = { 3 | enable = true; 4 | symbolMap = { 5 | Copilot = " "; 6 | }; 7 | extraOptions = { 8 | maxwidth = 50; 9 | ellipsis_char = "..."; 10 | }; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /config/plugins/cmp/schemastore.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.schemastore = { 3 | enable = true; 4 | 5 | json = { 6 | enable = true; 7 | }; 8 | 9 | yaml = { 10 | enable = true; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /config/plugins/editor/copilot-chat.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.copilot-chat = { 3 | enable = true; 4 | }; 5 | 6 | keymaps = [ 7 | { 8 | key = "ct"; 9 | action = "CopilotChatToggle"; 10 | options.desc = "Toggle Copilot Chat Window"; 11 | } 12 | { 13 | key = "cs"; 14 | action = "CopilotChatStop"; 15 | options.desc = "Stop current Copilot output"; 16 | } 17 | { 18 | key = "cr"; 19 | action = "CopilotChatReview"; 20 | options.desc = "Review the selected code"; 21 | } 22 | { 23 | key = "ce"; 24 | action = "CopilotChatExplain"; 25 | options.desc = "Give an explanation for the selected code"; 26 | } 27 | { 28 | key = "cd"; 29 | action = "CopilotChatDocs"; 30 | options.desc = "Add documentation for the selection"; 31 | } 32 | { 33 | key = "cp"; 34 | action = "CopilotChatTests"; 35 | options.desc = "Add tests for my code"; 36 | } 37 | ]; 38 | } 39 | -------------------------------------------------------------------------------- /config/plugins/editor/illuminate.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.illuminate = { 3 | enable = true; 4 | underCursor = false; 5 | filetypesDenylist = [ 6 | "Outline" 7 | "TelescopePrompt" 8 | "alpha" 9 | "harpoon" 10 | "reason" 11 | ]; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /config/plugins/editor/indent-blankline.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins = { 3 | indent-blankline = { 4 | enable = true; 5 | }; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /config/plugins/editor/navic.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.navic = { 3 | enable = true; 4 | settings = { 5 | separator = "  "; 6 | highlight = true; 7 | depthLimit = 5; 8 | lsp = { 9 | autoAttach = true; 10 | }; 11 | icons = { 12 | Array = "󱃵 "; 13 | Boolean = " "; 14 | Class = " "; 15 | Constant = " "; 16 | Constructor = " "; 17 | Enum = " "; 18 | EnumMember = " "; 19 | Event = " "; 20 | Field = "󰽏 "; 21 | File = " "; 22 | Function = "󰡱 "; 23 | Interface = " "; 24 | Key = " "; 25 | Method = " "; 26 | Module = "󰕳 "; 27 | Namespace = " "; 28 | Null = "󰟢 "; 29 | Number = " "; 30 | Object = " "; 31 | Operator = " "; 32 | Package = "󰏖 "; 33 | String = " "; 34 | Struct = " "; 35 | TypeParameter = " "; 36 | Variable = " "; 37 | }; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /config/plugins/editor/neo-tree.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.neo-tree = { 3 | enable = true; 4 | sources = [ 5 | "filesystem" 6 | "buffers" 7 | "git_status" 8 | "document_symbols" 9 | ]; 10 | addBlankLineAtTop = false; 11 | 12 | filesystem = { 13 | bindToCwd = false; 14 | followCurrentFile = { 15 | enabled = true; 16 | }; 17 | }; 18 | 19 | defaultComponentConfigs = { 20 | indent = { 21 | withExpanders = true; 22 | expanderCollapsed = "󰅂"; 23 | expanderExpanded = "󰅀"; 24 | expanderHighlight = "NeoTreeExpander"; 25 | }; 26 | 27 | gitStatus = { 28 | symbols = { 29 | added = " "; 30 | conflict = "󰩌 "; 31 | deleted = "󱂥"; 32 | ignored = " "; 33 | modified = " "; 34 | renamed = "󰑕"; 35 | staged = "󰩍"; 36 | unstaged = ""; 37 | untracked = " "; 38 | }; 39 | }; 40 | }; 41 | }; 42 | 43 | keymaps = [ 44 | { 45 | mode = [ "n" ]; 46 | key = "e"; 47 | action = "Neotree toggle"; 48 | options = { 49 | desc = "Open/Close Neotree"; 50 | }; 51 | } 52 | ]; 53 | } 54 | -------------------------------------------------------------------------------- /config/plugins/editor/todo-comments.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.todo-comments = { 3 | enable = true; 4 | settings = { 5 | colors = { 6 | error = [ 7 | "DiagnosticError" 8 | "ErrorMsg" 9 | "#ED8796" 10 | ]; 11 | warning = [ 12 | "DiagnosticWarn" 13 | "WarningMsg" 14 | "#EED49F" 15 | ]; 16 | info = [ 17 | "DiagnosticInfo" 18 | "#EED49F" 19 | ]; 20 | default = [ 21 | "Identifier" 22 | "#F5A97F" 23 | ]; 24 | test = [ 25 | "Identifier" 26 | "#8AADF4" 27 | ]; 28 | }; 29 | }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /config/plugins/editor/treesitter.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | plugins.treesitter = { 4 | enable = true; 5 | settings = { 6 | indent.enable = true; 7 | highlight.enable = true; 8 | }; 9 | folding = false; 10 | nixvimInjections = true; 11 | grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; 12 | }; 13 | 14 | plugins.treesitter-textobjects = { 15 | enable = false; 16 | select = { 17 | enable = true; 18 | lookahead = true; 19 | keymaps = { 20 | "aa" = "@parameter.outer"; 21 | "ia" = "@parameter.inner"; 22 | "af" = "@function.outer"; 23 | "if" = "@function.inner"; 24 | "ac" = "@class.outer"; 25 | "ic" = "@class.inner"; 26 | "ii" = "@conditional.inner"; 27 | "ai" = "@conditional.outer"; 28 | "il" = "@loop.inner"; 29 | "al" = "@loop.outer"; 30 | "at" = "@comment.outer"; 31 | }; 32 | }; 33 | move = { 34 | enable = true; 35 | gotoNextStart = { 36 | "]m" = "@function.outer"; 37 | "]]" = "@class.outer"; 38 | }; 39 | gotoNextEnd = { 40 | "]M" = "@function.outer"; 41 | "][" = "@class.outer"; 42 | }; 43 | gotoPreviousStart = { 44 | "[m" = "@function.outer"; 45 | "[[" = "@class.outer"; 46 | }; 47 | gotoPreviousEnd = { 48 | "[M" = "@function.outer"; 49 | "[]" = "@class.outer"; 50 | }; 51 | }; 52 | swap = { 53 | enable = true; 54 | swapNext = { 55 | "a" = "@parameters.inner"; 56 | }; 57 | swapPrevious = { 58 | "A" = "@parameter.outer"; 59 | }; 60 | }; 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /config/plugins/editor/undotree.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.undotree = { 3 | enable = true; 4 | settings = { 5 | autoOpenDiff = true; 6 | focusOnToggle = true; 7 | }; 8 | }; 9 | keymaps = [ 10 | { 11 | mode = "n"; 12 | key = "ut"; 13 | action = "UndotreeToggle"; 14 | options = { 15 | silent = true; 16 | desc = "Undotree"; 17 | }; 18 | } 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /config/plugins/git/gitsigns.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.gitsigns = { 3 | enable = true; 4 | settings = { 5 | signs = { 6 | add = { 7 | text = " "; 8 | }; 9 | change = { 10 | text = " "; 11 | }; 12 | delete = { 13 | text = " "; 14 | }; 15 | untracked = { 16 | text = ""; 17 | }; 18 | topdelete = { 19 | text = "󱂥 "; 20 | }; 21 | changedelete = { 22 | text = "󱂧 "; 23 | }; 24 | }; 25 | }; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /config/plugins/git/lazygit.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | extraPlugins = with pkgs.vimPlugins; [ 4 | lazygit-nvim 5 | ]; 6 | 7 | extraConfigLua = '' 8 | require("telescope").load_extension("lazygit") 9 | ''; 10 | 11 | keymaps = [ 12 | { 13 | mode = "n"; 14 | key = "gg"; 15 | action = "LazyGit"; 16 | options = { 17 | desc = "LazyGit (root dir)"; 18 | }; 19 | } 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /config/plugins/lsp/conform.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: 6 | { 7 | config = { 8 | extraConfigLuaPre = 9 | # lua 10 | '' 11 | local slow_format_filetypes = {} 12 | 13 | vim.api.nvim_create_user_command("FormatDisable", function(args) 14 | if args.bang then 15 | -- FormatDisable! will disable formatting just for this buffer 16 | vim.b.disable_autoformat = true 17 | else 18 | vim.g.disable_autoformat = true 19 | end 20 | end, { 21 | desc = "Disable autoformat-on-save", 22 | bang = true, 23 | }) 24 | vim.api.nvim_create_user_command("FormatEnable", function() 25 | vim.b.disable_autoformat = false 26 | vim.g.disable_autoformat = false 27 | end, { 28 | desc = "Re-enable autoformat-on-save", 29 | }) 30 | vim.api.nvim_create_user_command("FormatToggle", function(args) 31 | if args.bang then 32 | -- Toggle formatting for current buffer 33 | vim.b.disable_autoformat = not vim.b.disable_autoformat 34 | else 35 | -- Toggle formatting globally 36 | vim.g.disable_autoformat = not vim.g.disable_autoformat 37 | end 38 | end, { 39 | desc = "Toggle autoformat-on-save", 40 | bang = true, 41 | }) 42 | ''; 43 | plugins.conform-nvim = { 44 | enable = true; 45 | settings = { 46 | format_on_save = '' 47 | function(bufnr) 48 | if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then 49 | return 50 | end 51 | 52 | if slow_format_filetypes[vim.bo[bufnr].filetype] then 53 | return 54 | end 55 | 56 | local function on_format(err) 57 | if err and err:match("timeout$") then 58 | slow_format_filetypes[vim.bo[bufnr].filetype] = true 59 | end 60 | end 61 | 62 | return { timeout_ms = 200, lsp_fallback = true }, on_format 63 | end 64 | ''; 65 | 66 | format_after_save = '' 67 | function(bufnr) 68 | if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then 69 | return 70 | end 71 | 72 | if not slow_format_filetypes[vim.bo[bufnr].filetype] then 73 | return 74 | end 75 | 76 | return { lsp_fallback = true } 77 | end 78 | ''; 79 | notify_on_error = true; 80 | formatters_by_ft = { 81 | html = { 82 | __unkeyed-1 = "prettierd"; 83 | __unkeyed-2 = "prettier"; 84 | stop_after_first = true; 85 | }; 86 | css = { 87 | __unkeyed-1 = "prettierd"; 88 | __unkeyed-2 = "prettier"; 89 | stop_after_first = true; 90 | }; 91 | javascript = { 92 | __unkeyed-1 = "prettierd"; 93 | __unkeyed-2 = "prettier"; 94 | stop_after_first = true; 95 | }; 96 | typescript = { 97 | __unkeyed-1 = "prettierd"; 98 | __unkeyed-2 = "prettier"; 99 | stop_after_first = true; 100 | }; 101 | python = [ 102 | "black" 103 | "isort" 104 | ]; 105 | lua = [ "stylua" ]; 106 | nix = [ "nixfmt-rfc-style" ]; 107 | markdown = { 108 | __unkeyed-1 = "prettierd"; 109 | __unkeyed-2 = "prettier"; 110 | stop_after_first = true; 111 | }; 112 | yaml = { 113 | __unkeyed-1 = "prettierd"; 114 | __unkeyed-2 = "prettier"; 115 | stop_after_first = true; 116 | }; 117 | terraform = [ "terraform_fmt" ]; 118 | bicep = [ "bicep" ]; 119 | bash = [ 120 | "shellcheck" 121 | "shellharden" 122 | "shfmt" 123 | ]; 124 | json = [ "jq" ]; 125 | "_" = [ "trim_whitespace" ]; 126 | }; 127 | 128 | formatters = { 129 | black = { 130 | command = "${lib.getExe pkgs.black}"; 131 | }; 132 | isort = { 133 | command = "${lib.getExe pkgs.isort}"; 134 | }; 135 | nixfmt-rfc-style = { 136 | command = "${lib.getExe pkgs.nixfmt-rfc-style}"; 137 | }; 138 | alejandra = { 139 | command = "${lib.getExe pkgs.alejandra}"; 140 | }; 141 | jq = { 142 | command = "${lib.getExe pkgs.jq}"; 143 | }; 144 | prettierd = { 145 | command = "${lib.getExe pkgs.prettierd}"; 146 | }; 147 | stylua = { 148 | command = "${lib.getExe pkgs.stylua}"; 149 | }; 150 | shellcheck = { 151 | command = "${lib.getExe pkgs.shellcheck}"; 152 | }; 153 | shfmt = { 154 | command = "${lib.getExe pkgs.shfmt}"; 155 | }; 156 | shellharden = { 157 | command = "${lib.getExe pkgs.shellharden}"; 158 | }; 159 | bicep = { 160 | command = "${lib.getExe pkgs.bicep}"; 161 | }; 162 | #yamlfmt = { 163 | # command = "${lib.getExe pkgs.yamlfmt}"; 164 | #}; 165 | }; 166 | }; 167 | }; 168 | }; 169 | } 170 | -------------------------------------------------------------------------------- /config/plugins/lsp/fidget.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.fidget = { 3 | enable = true; 4 | settings = { 5 | logger = { 6 | level = "warn"; # "off", "error", "warn", "info", "debug", "trace" 7 | float_precision = 1.0e-2; # Limit the number of decimals displayed for floats 8 | }; 9 | progress = { 10 | poll_rate = 0; # How and when to poll for progress messages 11 | suppress_on_insert = true; # Suppress new messages while in insert mode 12 | ignore_done_already = false; # Ignore new tasks that are already complete 13 | ignore_empty_message = false; # Ignore new tasks that don't contain a message 14 | clear_on_detach = 15 | # Clear notification group when LSP server detaches 16 | '' 17 | function(client_id) 18 | local client = vim.lsp.get_client_by_id(client_id) 19 | return client and client.name or nil 20 | end 21 | ''; 22 | notification_group = 23 | # How to get a progress message's notification group key 24 | '' 25 | function(msg) return msg.lsp_client.name end 26 | ''; 27 | ignore = [ ]; # List of LSP servers to ignore 28 | lsp = { 29 | progress_ringbuf_size = 0; # Configure the nvim's LSP progress ring buffer size 30 | }; 31 | display = { 32 | render_limit = 16; # How many LSP messages to show at once 33 | done_ttl = 3; # How long a message should persist after completion 34 | done_icon = "✔"; # Icon shown when all LSP progress tasks are complete 35 | done_style = "Constant"; # Highlight group for completed LSP tasks 36 | progress_ttl = 10; # How long a message should persist when in progress 37 | progress_icon = { 38 | pattern = "dots"; 39 | period = 1; 40 | }; # Icon shown when LSP progress tasks are in progress 41 | progress_style = "WarningMsg"; # Highlight group for in-progress LSP tasks 42 | group_style = "Title"; # Highlight group for group name (LSP server name) 43 | icon_style = "Question"; # Highlight group for group icons 44 | priority = 30; # Ordering priority for LSP notification group 45 | skip_history = true; # Whether progress notifications should be omitted from history 46 | format_message = '' 47 | require ("fidget.progress.display").default_format_message 48 | ''; # How to format a progress message 49 | format_annote = '' 50 | function (msg) return msg.title end 51 | ''; # How to format a progress annotation 52 | format_group_name = '' 53 | function (group) return tostring (group) end 54 | ''; # How to format a progress notification group's name 55 | overrides = { 56 | rust_analyzer = { 57 | name = "rust-analyzer"; 58 | }; 59 | }; # Override options from the default notification config 60 | }; 61 | }; 62 | notification = { 63 | poll_rate = 10; # How frequently to update and render notifications 64 | filter = "info"; # "off", "error", "warn", "info", "debug", "trace" 65 | history_size = 128; # Number of removed messages to retain in history 66 | override_vim_notify = true; 67 | redirect = { 68 | __raw = '' 69 | function(msg, level, opts) 70 | if opts and opts.on_open then 71 | return require("fidget.integration.nvim-notify").delegate(msg, level, opts) 72 | end 73 | end 74 | ''; 75 | }; 76 | configs = { 77 | default = { 78 | name = "Notifications"; 79 | icon = "󰏪"; 80 | group = "Notifications"; 81 | annote = true; 82 | debug = false; 83 | debug_rate = 0.25; 84 | }; 85 | }; 86 | 87 | window = { 88 | normal_hl = "Comment"; 89 | winblend = 0; 90 | border = "none"; # none, single, double, rounded, solid, shadow 91 | zindex = 45; 92 | max_width = 0; 93 | max_height = 0; 94 | x_padding = 1; 95 | y_padding = 0; 96 | align = "bottom"; 97 | relative = "editor"; 98 | }; 99 | view = { 100 | stack_upwards = true; # Display notification items from bottom to top 101 | icon_separator = " "; # Separator between group name and icon 102 | group_separator = "---"; # Separator between notification groups 103 | group_separator_hl = 104 | # Highlight group used for group separator 105 | "Comment"; 106 | }; 107 | }; 108 | }; 109 | }; 110 | } 111 | -------------------------------------------------------------------------------- /config/plugins/lsp/lsp.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | plugins = { 4 | lsp-lines = { 5 | enable = true; 6 | }; 7 | lsp-format = { 8 | enable = true; 9 | }; 10 | helm = { 11 | enable = true; 12 | }; 13 | lsp = { 14 | enable = true; 15 | inlayHints = true; 16 | servers = { 17 | html = { 18 | enable = true; 19 | }; 20 | lua_ls = { 21 | enable = true; 22 | }; 23 | nil_ls = { 24 | enable = true; 25 | }; 26 | ts_ls = { 27 | enable = true; 28 | }; 29 | marksman = { 30 | enable = true; 31 | }; 32 | pyright = { 33 | enable = true; 34 | }; 35 | gopls = { 36 | enable = true; 37 | }; 38 | terraformls = { 39 | enable = true; 40 | }; 41 | ansiblels = { 42 | enable = true; 43 | }; 44 | jsonls = { 45 | enable = true; 46 | }; 47 | helm_ls = { 48 | enable = true; 49 | extraOptions = { 50 | settings = { 51 | "helm_ls" = { 52 | yamlls = { 53 | path = "${pkgs.yaml-language-server}/bin/yaml-language-server"; 54 | }; 55 | }; 56 | }; 57 | }; 58 | }; 59 | yamlls = { 60 | enable = true; 61 | extraOptions = { 62 | settings = { 63 | yaml = { 64 | schemas = { 65 | kubernetes = "'*.yaml"; 66 | "http://json.schemastore.org/github-workflow" = ".github/workflows/*"; 67 | "http://json.schemastore.org/github-action" = ".github/action.{yml,yaml}"; 68 | "http://json.schemastore.org/ansible-stable-2.9" = "roles/tasks/*.{yml,yaml}"; 69 | "http://json.schemastore.org/kustomization" = "kustomization.{yml,yaml}"; 70 | "http://json.schemastore.org/ansible-playbook" = "*play*.{yml,yaml}"; 71 | "http://json.schemastore.org/chart" = "Chart.{yml,yaml}"; 72 | "https://json.schemastore.org/dependabot-v2" = ".github/dependabot.{yml,yaml}"; 73 | "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json" = "*docker-compose*.{yml,yaml}"; 74 | "https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json" = "*flow*.{yml,yaml}"; 75 | }; 76 | }; 77 | }; 78 | }; 79 | }; 80 | }; 81 | 82 | keymaps = { 83 | silent = true; 84 | lspBuf = { 85 | gd = { 86 | action = "definition"; 87 | desc = "Goto Definition"; 88 | }; 89 | gr = { 90 | action = "references"; 91 | desc = "Goto References"; 92 | }; 93 | gD = { 94 | action = "declaration"; 95 | desc = "Goto Declaration"; 96 | }; 97 | gI = { 98 | action = "implementation"; 99 | desc = "Goto Implementation"; 100 | }; 101 | gT = { 102 | action = "type_definition"; 103 | desc = "Type Definition"; 104 | }; 105 | K = { 106 | action = "hover"; 107 | desc = "Hover"; 108 | }; 109 | "cw" = { 110 | action = "workspace_symbol"; 111 | desc = "Workspace Symbol"; 112 | }; 113 | "cr" = { 114 | action = "rename"; 115 | desc = "Rename"; 116 | }; 117 | }; 118 | diagnostic = { 119 | "cd" = { 120 | action = "open_float"; 121 | desc = "Line Diagnostics"; 122 | }; 123 | "[d" = { 124 | action = "goto_next"; 125 | desc = "Next Diagnostic"; 126 | }; 127 | "]d" = { 128 | action = "goto_prev"; 129 | desc = "Previous Diagnostic"; 130 | }; 131 | }; 132 | }; 133 | }; 134 | }; 135 | extraPlugins = with pkgs.vimPlugins; [ 136 | ansible-vim 137 | ]; 138 | 139 | extraConfigLua = '' 140 | local _border = "rounded" 141 | 142 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( 143 | vim.lsp.handlers.hover, { 144 | border = _border 145 | } 146 | ) 147 | 148 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( 149 | vim.lsp.handlers.signature_help, { 150 | border = _border 151 | } 152 | ) 153 | 154 | vim.diagnostic.config{ 155 | float={border=_border} 156 | }; 157 | 158 | require('lspconfig.ui.windows').default_options = { 159 | border = _border 160 | } 161 | ''; 162 | } 163 | -------------------------------------------------------------------------------- /config/plugins/snippets/luasnip.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.luasnip = { 3 | enable = true; 4 | settings = { 5 | enable_autosnippets = true; 6 | store_selection_keys = ""; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /config/plugins/themes/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | colorschemes = { 3 | catppuccin = { 4 | enable = true; 5 | settings = { 6 | background = { 7 | light = "macchiato"; 8 | dark = "mocha"; 9 | }; 10 | custom_highlights = '' 11 | function(highlights) 12 | return { 13 | CursorLineNr = { fg = highlights.peach, style = {} }, 14 | NavicText = { fg = highlights.text }, 15 | } 16 | end 17 | ''; 18 | flavour = "macchiato"; # "latte", "mocha", "frappe", "macchiato" or raw lua code 19 | no_bold = false; 20 | no_italic = false; 21 | no_underline = false; 22 | transparent_background = true; 23 | integrations = { 24 | cmp = true; 25 | notify = true; 26 | gitsigns = true; 27 | neotree = true; 28 | which_key = true; 29 | illuminate = { 30 | enabled = true; 31 | lsp = true; 32 | }; 33 | navic = { 34 | enabled = true; 35 | custom_bg = "NONE"; 36 | }; 37 | treesitter = true; 38 | telescope.enabled = true; 39 | indent_blankline.enabled = true; 40 | mini = { 41 | enabled = true; 42 | indentscope_color = "rosewater"; 43 | }; 44 | native_lsp = { 45 | enabled = true; 46 | inlay_hints = { 47 | background = true; 48 | }; 49 | virtual_text = { 50 | errors = [ "italic" ]; 51 | hints = [ "italic" ]; 52 | information = [ "italic" ]; 53 | warnings = [ "italic" ]; 54 | ok = [ "italic" ]; 55 | }; 56 | underlines = { 57 | errors = [ "underline" ]; 58 | hints = [ "underline" ]; 59 | information = [ "underline" ]; 60 | warnings = [ "underline" ]; 61 | }; 62 | }; 63 | }; 64 | }; 65 | }; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /config/plugins/ui/bufferline.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins = { 3 | bufferline = { 4 | enable = true; 5 | settings = { 6 | options = { 7 | diagnostics = "nvim_lsp"; 8 | mode = "buffers"; 9 | 10 | close_icon = " "; 11 | buffer_close_icon = "󰱝 "; 12 | modified_icon = "󰔯 "; 13 | 14 | offsets = [ 15 | { 16 | filetype = "neo-tree"; 17 | text = "Neo-tree"; 18 | highlight = "Directory"; 19 | text_align = "left"; 20 | } 21 | ]; 22 | }; 23 | }; 24 | }; 25 | }; 26 | 27 | keymaps = [ 28 | { 29 | mode = "n"; 30 | key = "]b"; 31 | action = "BufferLineCycleNext"; 32 | options = { 33 | desc = "Cycle to next buffer"; 34 | }; 35 | } 36 | 37 | { 38 | mode = "n"; 39 | key = "[b"; 40 | action = "BufferLineCyclePrev"; 41 | options = { 42 | desc = "Cycle to previous buffer"; 43 | }; 44 | } 45 | 46 | { 47 | mode = "n"; 48 | key = ""; 49 | action = "BufferLineCycleNext"; 50 | options = { 51 | desc = "Cycle to next buffer"; 52 | }; 53 | } 54 | 55 | { 56 | mode = "n"; 57 | key = ""; 58 | action = "BufferLineCyclePrev"; 59 | options = { 60 | desc = "Cycle to previous buffer"; 61 | }; 62 | } 63 | 64 | { 65 | mode = "n"; 66 | key = "bd"; 67 | action = "bdelete"; 68 | options = { 69 | desc = "Delete buffer"; 70 | }; 71 | } 72 | 73 | { 74 | mode = "n"; 75 | key = "bl"; 76 | action = "BufferLineCloseLeft"; 77 | options = { 78 | desc = "Delete buffers to the left"; 79 | }; 80 | } 81 | 82 | { 83 | mode = "n"; 84 | key = "bo"; 85 | action = "BufferLineCloseOthers"; 86 | options = { 87 | desc = "Delete other buffers"; 88 | }; 89 | } 90 | 91 | { 92 | mode = "n"; 93 | key = "bp"; 94 | action = "BufferLineTogglePin"; 95 | options = { 96 | desc = "Toggle pin"; 97 | }; 98 | } 99 | 100 | { 101 | mode = "n"; 102 | key = "bP"; 103 | action = "BufferLineGroupClose ungrouped"; 104 | options = { 105 | desc = "Delete non-pinned buffers"; 106 | }; 107 | } 108 | ]; 109 | } 110 | -------------------------------------------------------------------------------- /config/plugins/ui/lualine.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.lualine = { 3 | enable = true; 4 | settings = { 5 | options = { 6 | globalstatus = true; 7 | extensions = [ 8 | "fzf" 9 | "neo-tree" 10 | ]; 11 | disabledFiletypes = { 12 | statusline = [ 13 | "startup" 14 | "alpha" 15 | ]; 16 | }; 17 | theme = "catppuccin"; 18 | }; 19 | sections = { 20 | lualine_a = [ 21 | { 22 | __unkeyed-1 = "mode"; 23 | icon = ""; 24 | } 25 | ]; 26 | lualine_b = [ 27 | { 28 | __unkeyed-1 = "branch"; 29 | icon = ""; 30 | } 31 | { 32 | __unkeyed-1 = "diff"; 33 | symbols = { 34 | added = " "; 35 | modified = " "; 36 | removed = " "; 37 | }; 38 | } 39 | ]; 40 | lualine_c = [ 41 | { 42 | __unkeyed-1 = "diagnostics"; 43 | sources = [ "nvim_lsp" ]; 44 | symbols = { 45 | error = " "; 46 | warn = " "; 47 | info = " "; 48 | hint = "󰝶 "; 49 | }; 50 | } 51 | { 52 | __unkeyed-1 = "navic"; 53 | } 54 | ]; 55 | lualine_x = [ 56 | { 57 | __unkeyed-1 = "filetype"; 58 | icon_only = true; 59 | separator = ""; 60 | padding = { 61 | left = 1; 62 | right = 0; 63 | }; 64 | } 65 | { 66 | __unkeyed-1 = "filename"; 67 | path = 1; 68 | } 69 | { 70 | __unkeyed-1.__raw = '' 71 | function() 72 | local icon = " " 73 | local status = require("copilot.api").status.data 74 | return icon .. (status.message or " ") 75 | end, 76 | 77 | cond = function() 78 | local ok, clients = pcall(vim.lsp.get_clients, { name = "copilot", bufnr = 0 }) 79 | return ok and #clients > 0 80 | end, 81 | ''; 82 | } 83 | ]; 84 | lualine_y = [ 85 | { 86 | __unkeyed-1 = "progress"; 87 | } 88 | ]; 89 | lualine_z = [ 90 | { 91 | __unkeyed-1 = "location"; 92 | } 93 | ]; 94 | }; 95 | }; 96 | }; 97 | } 98 | -------------------------------------------------------------------------------- /config/plugins/ui/startup.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.startup = { 3 | enable = true; 4 | 5 | colors = { 6 | background = "#ffffff"; 7 | foldedSection = "#ffffff"; 8 | }; 9 | 10 | sections = { 11 | header = { 12 | type = "text"; 13 | oldfilesDirectory = false; 14 | align = "center"; 15 | foldSection = false; 16 | title = "Header"; 17 | margin = 5; 18 | content = [ 19 | " ██████╗░███████╗░█████╗░░█████╗░██████╗░████████╗░░░████████╗███████╗░█████╗░██╗░░██╗" 20 | " ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝░░░╚══██╔══╝██╔════╝██╔══██╗██║░░██║" 21 | " ██║░░██║█████╗░░██║░░╚═╝██║░░██║██████╔╝░░░██║░░░░░░░░░██║░░░█████╗░░██║░░╚═╝███████║" 22 | " ██║░░██║██╔══╝░░██║░░██╗██║░░██║██╔══██╗░░░██║░░░░░░░░░██║░░░██╔══╝░░██║░░██╗██╔══██║" 23 | " ██████╔╝███████╗╚█████╔╝╚█████╔╝██║░░██║░░░██║░░░██╗░░░██║░░░███████╗╚█████╔╝██║░░██║" 24 | " ╚═════╝░╚══════╝░╚════╝░░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░╚═╝░░╚═╝" 25 | ]; 26 | highlight = "Statement"; 27 | defaultColor = ""; 28 | oldfilesAmount = 0; 29 | }; 30 | 31 | body = { 32 | type = "mapping"; 33 | oldfilesDirectory = false; 34 | align = "center"; 35 | foldSection = false; 36 | title = "Menu"; 37 | margin = 5; 38 | content = [ 39 | [ 40 | " Find File" 41 | "Telescope find_files" 42 | "ff" 43 | ] 44 | [ 45 | "󰍉 Find Word" 46 | "Telescope live_grep" 47 | "fr" 48 | ] 49 | [ 50 | " Recent Files" 51 | "Telescope oldfiles" 52 | "fg" 53 | ] 54 | [ 55 | " File Browser" 56 | "Telescope file_browser" 57 | "fe" 58 | ] 59 | [ 60 | " Copilot Chat" 61 | "CopilotChat" 62 | "ct" 63 | ] 64 | [ 65 | "󰧑 SecondBrain" 66 | "edit ~/projects/personal/SecondBrain" 67 | "sb" 68 | ] 69 | ]; 70 | highlight = "string"; 71 | defaultColor = ""; 72 | oldfilesAmount = 0; 73 | }; 74 | }; 75 | 76 | options = { 77 | paddings = [ 78 | 1 79 | 3 80 | ]; 81 | }; 82 | 83 | parts = [ 84 | "header" 85 | "body" 86 | ]; 87 | }; 88 | } 89 | -------------------------------------------------------------------------------- /config/plugins/utils/extra_plugins.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | extraPlugins = 4 | with pkgs.vimPlugins; 5 | [ 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /config/plugins/utils/markdown-preview.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins = { 3 | markdown-preview = { 4 | enable = true; 5 | settings = { 6 | browser = "firefox"; 7 | echo_preview_url = 1; 8 | port = "6969"; 9 | preview_options = { 10 | disable_filename = 1; 11 | disable_sync_scroll = 1; 12 | sync_scroll_type = "middle"; 13 | }; 14 | theme = "dark"; 15 | }; 16 | }; 17 | }; 18 | 19 | keymaps = [ 20 | { 21 | mode = "n"; 22 | key = "mp"; 23 | action = "MarkdownPreview"; 24 | options = { 25 | desc = "Toggle Markdown Preview"; 26 | }; 27 | } 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /config/plugins/utils/mini.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.mini = { 3 | enable = true; 4 | 5 | modules = { 6 | indentscope = { 7 | symbol = "│"; 8 | options = { 9 | try_as_border = true; 10 | }; 11 | }; 12 | surround = { }; 13 | }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /config/plugins/utils/obsidian.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.obsidian = { 3 | enable = false; 4 | settings = { 5 | workspaces = [ 6 | { 7 | name = "SecondBrain"; 8 | path = "~/projects/personal/SecondBrain"; 9 | } 10 | ]; 11 | templates = { 12 | subdir = "templates"; 13 | dateFormat = "%Y-%m-%d"; 14 | timeFormat = "%H:%M"; 15 | substitutions = { }; 16 | }; 17 | 18 | dailyNotes = { 19 | folder = "0_Daily_Notes"; 20 | dateFormat = "%Y-%m-%d"; 21 | aliasFormat = "%B %-d, %Y"; 22 | }; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /config/plugins/utils/telescope.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.telescope = { 3 | enable = true; 4 | extensions = { 5 | file-browser = { 6 | enable = true; 7 | }; 8 | fzf-native = { 9 | enable = true; 10 | }; 11 | }; 12 | settings = { 13 | defaults = { 14 | layout_config = { 15 | horizontal = { 16 | prompt_position = "top"; 17 | }; 18 | }; 19 | sorting_strategy = "ascending"; 20 | }; 21 | }; 22 | keymaps = { 23 | "" = { 24 | action = "find_files"; 25 | options = { 26 | desc = "Find project files"; 27 | }; 28 | }; 29 | "/" = { 30 | action = "live_grep"; 31 | options = { 32 | desc = "Grep (root dir)"; 33 | }; 34 | }; 35 | ":" = { 36 | action = "command_history"; 37 | options = { 38 | desc = "Command History"; 39 | }; 40 | }; 41 | "b" = { 42 | action = "buffers"; 43 | options = { 44 | desc = "+buffer"; 45 | }; 46 | }; 47 | "ff" = { 48 | action = "find_files"; 49 | options = { 50 | desc = "Find project files"; 51 | }; 52 | }; 53 | "fr" = { 54 | action = "live_grep"; 55 | options = { 56 | desc = "Find text"; 57 | }; 58 | }; 59 | "fR" = { 60 | action = "resume"; 61 | options = { 62 | desc = "Resume"; 63 | }; 64 | }; 65 | "fg" = { 66 | action = "oldfiles"; 67 | options = { 68 | desc = "Recent"; 69 | }; 70 | }; 71 | "fb" = { 72 | action = "buffers"; 73 | options = { 74 | desc = "Buffers"; 75 | }; 76 | }; 77 | "" = { 78 | action = "git_files"; 79 | options = { 80 | desc = "Search git files"; 81 | }; 82 | }; 83 | "gc" = { 84 | action = "git_commits"; 85 | options = { 86 | desc = "Commits"; 87 | }; 88 | }; 89 | "gs" = { 90 | action = "git_status"; 91 | options = { 92 | desc = "Status"; 93 | }; 94 | }; 95 | "sa" = { 96 | action = "autocommands"; 97 | options = { 98 | desc = "Auto Commands"; 99 | }; 100 | }; 101 | "sb" = { 102 | action = "current_buffer_fuzzy_find"; 103 | options = { 104 | desc = "Buffer"; 105 | }; 106 | }; 107 | "sc" = { 108 | action = "command_history"; 109 | options = { 110 | desc = "Command History"; 111 | }; 112 | }; 113 | "sC" = { 114 | action = "commands"; 115 | options = { 116 | desc = "Commands"; 117 | }; 118 | }; 119 | "sD" = { 120 | action = "diagnostics"; 121 | options = { 122 | desc = "Workspace diagnostics"; 123 | }; 124 | }; 125 | "sh" = { 126 | action = "help_tags"; 127 | options = { 128 | desc = "Help pages"; 129 | }; 130 | }; 131 | "sH" = { 132 | action = "highlights"; 133 | options = { 134 | desc = "Search Highlight Groups"; 135 | }; 136 | }; 137 | "sk" = { 138 | action = "keymaps"; 139 | options = { 140 | desc = "Keymaps"; 141 | }; 142 | }; 143 | "sM" = { 144 | action = "man_pages"; 145 | options = { 146 | desc = "Man pages"; 147 | }; 148 | }; 149 | "sm" = { 150 | action = "marks"; 151 | options = { 152 | desc = "Jump to Mark"; 153 | }; 154 | }; 155 | "so" = { 156 | action = "vim_options"; 157 | options = { 158 | desc = "Options"; 159 | }; 160 | }; 161 | "sR" = { 162 | action = "resume"; 163 | options = { 164 | desc = "Resume"; 165 | }; 166 | }; 167 | "uC" = { 168 | action = "colorscheme"; 169 | options = { 170 | desc = "Colorscheme preview"; 171 | }; 172 | }; 173 | }; 174 | }; 175 | keymaps = [ 176 | { 177 | mode = "n"; 178 | key = "sd"; 179 | action = "Telescope diagnostics bufnr=0"; 180 | options = { 181 | desc = "Document diagnostics"; 182 | }; 183 | } 184 | { 185 | mode = "n"; 186 | key = "fe"; 187 | action = "Telescope file_browser"; 188 | options = { 189 | desc = "File browser"; 190 | }; 191 | } 192 | { 193 | mode = "n"; 194 | key = "fE"; 195 | action = "Telescope file_browser path=%:p:h select_buffer=true"; 196 | options = { 197 | desc = "File browser"; 198 | }; 199 | } 200 | ]; 201 | extraConfigLua = '' 202 | require("telescope").setup{ 203 | pickers = { 204 | colorscheme = { 205 | enable_preview = true 206 | } 207 | } 208 | } 209 | ''; 210 | } 211 | -------------------------------------------------------------------------------- /config/plugins/utils/toggleterm.nix: -------------------------------------------------------------------------------- 1 | _: { 2 | plugins.toggleterm = { 3 | enable = true; 4 | settings = { 5 | size = 20; 6 | }; 7 | }; 8 | keymaps = [ 9 | { 10 | mode = "n"; 11 | key = "t"; 12 | action = "ToggleTerm"; 13 | options = { 14 | desc = "Toggle Terminal Window"; 15 | }; 16 | } 17 | { 18 | mode = "n"; 19 | key = "tv"; 20 | action = "ToggleTerm direction=vertical"; 21 | options = { 22 | desc = "Toggle Vertical Terminal Window"; 23 | }; 24 | } 25 | { 26 | mode = "n"; 27 | key = "th"; 28 | action = "ToggleTerm direction=horizontal"; 29 | options = { 30 | desc = "Toggle Horizontal Terminal Window"; 31 | }; 32 | } 33 | { 34 | mode = "n"; 35 | key = "tf"; 36 | action = "ToggleTerm direction=float"; 37 | options = { 38 | desc = "Toggle Floating Terminal Window"; 39 | }; 40 | } 41 | ]; 42 | } 43 | -------------------------------------------------------------------------------- /config/plugins/utils/web-devicons.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.web-devicons = { 3 | enable = true; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /config/plugins/utils/whichkey.nix: -------------------------------------------------------------------------------- 1 | { 2 | plugins.which-key = { 3 | enable = true; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /config/settings.nix: -------------------------------------------------------------------------------- 1 | { 2 | config = { 3 | extraConfigLuaPre = 4 | # lua 5 | '' 6 | vim.fn.sign_define("diagnosticsignerror", { text = " ", texthl = "diagnosticerror", linehl = "", numhl = "" }) 7 | vim.fn.sign_define("diagnosticsignwarn", { text = " ", texthl = "diagnosticwarn", linehl = "", numhl = "" }) 8 | vim.fn.sign_define("diagnosticsignhint", { text = "󰌵", texthl = "diagnostichint", linehl = "", numhl = "" }) 9 | vim.fn.sign_define("diagnosticsigninfo", { text = " ", texthl = "diagnosticinfo", linehl = "", numhl = "" }) 10 | ''; 11 | 12 | clipboard = { 13 | providers.wl-copy.enable = true; 14 | }; 15 | 16 | opts = { 17 | # Show line numbers 18 | number = true; 19 | 20 | # Show relative line numbers 21 | relativenumber = true; 22 | 23 | # Use the system clipboard 24 | clipboard = "unnamedplus"; 25 | 26 | # Number of spaces that represent a 27 | tabstop = 2; 28 | softtabstop = 2; 29 | 30 | # Show tabline always 31 | showtabline = 2; 32 | 33 | # Use spaces instead of tabs 34 | expandtab = true; 35 | 36 | # Enable smart indentation 37 | smartindent = true; 38 | 39 | # Number of spaces to use for each step of (auto)indent 40 | shiftwidth = 2; 41 | 42 | # Enable break indent 43 | breakindent = true; 44 | 45 | # Highlight the screen line of the cursor 46 | cursorline = true; 47 | 48 | # Minimum number of screen lines to keep above and below the cursor 49 | scrolloff = 8; 50 | 51 | # Enable mouse support 52 | mouse = "a"; 53 | 54 | # Set folding method to manual 55 | foldmethod = "manual"; 56 | 57 | # Disable folding by default 58 | foldenable = false; 59 | 60 | # Wrap long lines at a character in 'breakat' 61 | linebreak = true; 62 | 63 | # Disable spell checking 64 | spell = false; 65 | 66 | # Disable swap file creation 67 | swapfile = false; 68 | 69 | # Time in milliseconds to wait for a mapped sequence to complete 70 | timeoutlen = 300; 71 | 72 | # Enable 24-bit RGB color in the TUI 73 | termguicolors = true; 74 | 75 | # Don't show mode in the command line 76 | showmode = false; 77 | 78 | # Open new split below the current window 79 | splitbelow = true; 80 | 81 | # Keep the screen when splitting 82 | splitkeep = "screen"; 83 | 84 | # Open new split to the right of the current window 85 | splitright = true; 86 | 87 | # Hide command line unless needed 88 | cmdheight = 0; 89 | 90 | # Remove EOB 91 | fillchars = { 92 | eob = " "; 93 | }; 94 | }; 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-compat": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1696426674, 7 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 8 | "owner": "edolstra", 9 | "repo": "flake-compat", 10 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "edolstra", 15 | "repo": "flake-compat", 16 | "type": "github" 17 | } 18 | }, 19 | "flake-parts": { 20 | "inputs": { 21 | "nixpkgs-lib": "nixpkgs-lib" 22 | }, 23 | "locked": { 24 | "lastModified": 1748821116, 25 | "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", 26 | "owner": "hercules-ci", 27 | "repo": "flake-parts", 28 | "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", 29 | "type": "github" 30 | }, 31 | "original": { 32 | "owner": "hercules-ci", 33 | "repo": "flake-parts", 34 | "type": "github" 35 | } 36 | }, 37 | "flake-parts_2": { 38 | "inputs": { 39 | "nixpkgs-lib": [ 40 | "nixvim", 41 | "nixpkgs" 42 | ] 43 | }, 44 | "locked": { 45 | "lastModified": 1743550720, 46 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", 47 | "owner": "hercules-ci", 48 | "repo": "flake-parts", 49 | "rev": "c621e8422220273271f52058f618c94e405bb0f5", 50 | "type": "github" 51 | }, 52 | "original": { 53 | "owner": "hercules-ci", 54 | "repo": "flake-parts", 55 | "type": "github" 56 | } 57 | }, 58 | "flake-utils": { 59 | "inputs": { 60 | "systems": "systems" 61 | }, 62 | "locked": { 63 | "lastModified": 1731533236, 64 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 65 | "owner": "numtide", 66 | "repo": "flake-utils", 67 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 68 | "type": "github" 69 | }, 70 | "original": { 71 | "owner": "numtide", 72 | "repo": "flake-utils", 73 | "type": "github" 74 | } 75 | }, 76 | "gitignore": { 77 | "inputs": { 78 | "nixpkgs": [ 79 | "pre-commit-hooks", 80 | "nixpkgs" 81 | ] 82 | }, 83 | "locked": { 84 | "lastModified": 1709087332, 85 | "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 86 | "owner": "hercules-ci", 87 | "repo": "gitignore.nix", 88 | "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 89 | "type": "github" 90 | }, 91 | "original": { 92 | "owner": "hercules-ci", 93 | "repo": "gitignore.nix", 94 | "type": "github" 95 | } 96 | }, 97 | "ixx": { 98 | "inputs": { 99 | "flake-utils": [ 100 | "nixvim", 101 | "nuschtosSearch", 102 | "flake-utils" 103 | ], 104 | "nixpkgs": [ 105 | "nixvim", 106 | "nuschtosSearch", 107 | "nixpkgs" 108 | ] 109 | }, 110 | "locked": { 111 | "lastModified": 1748294338, 112 | "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", 113 | "owner": "NuschtOS", 114 | "repo": "ixx", 115 | "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", 116 | "type": "github" 117 | }, 118 | "original": { 119 | "owner": "NuschtOS", 120 | "ref": "v0.0.8", 121 | "repo": "ixx", 122 | "type": "github" 123 | } 124 | }, 125 | "nixpkgs": { 126 | "locked": { 127 | "lastModified": 1748693115, 128 | "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", 129 | "owner": "nixos", 130 | "repo": "nixpkgs", 131 | "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", 132 | "type": "github" 133 | }, 134 | "original": { 135 | "owner": "nixos", 136 | "ref": "nixos-unstable", 137 | "repo": "nixpkgs", 138 | "type": "github" 139 | } 140 | }, 141 | "nixpkgs-lib": { 142 | "locked": { 143 | "lastModified": 1748740939, 144 | "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", 145 | "owner": "nix-community", 146 | "repo": "nixpkgs.lib", 147 | "rev": "656a64127e9d791a334452c6b6606d17539476e2", 148 | "type": "github" 149 | }, 150 | "original": { 151 | "owner": "nix-community", 152 | "repo": "nixpkgs.lib", 153 | "type": "github" 154 | } 155 | }, 156 | "nixpkgs_2": { 157 | "locked": { 158 | "lastModified": 1748406211, 159 | "narHash": "sha256-B3BsCRbc+x/d0WiG1f+qfSLUy+oiIfih54kalWBi+/M=", 160 | "owner": "NixOS", 161 | "repo": "nixpkgs", 162 | "rev": "3d1f29646e4b57ed468d60f9d286cde23a8d1707", 163 | "type": "github" 164 | }, 165 | "original": { 166 | "owner": "NixOS", 167 | "ref": "nixpkgs-unstable", 168 | "repo": "nixpkgs", 169 | "type": "github" 170 | } 171 | }, 172 | "nixpkgs_3": { 173 | "locked": { 174 | "lastModified": 1730768919, 175 | "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", 176 | "owner": "NixOS", 177 | "repo": "nixpkgs", 178 | "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", 179 | "type": "github" 180 | }, 181 | "original": { 182 | "owner": "NixOS", 183 | "ref": "nixpkgs-unstable", 184 | "repo": "nixpkgs", 185 | "type": "github" 186 | } 187 | }, 188 | "nixvim": { 189 | "inputs": { 190 | "flake-parts": "flake-parts_2", 191 | "nixpkgs": "nixpkgs_2", 192 | "nuschtosSearch": "nuschtosSearch", 193 | "systems": "systems_2" 194 | }, 195 | "locked": { 196 | "lastModified": 1748564405, 197 | "narHash": "sha256-uCmQLJmdg0gKWBs+vhNmS9RIPJW8/ddo6TvQ/a4gupc=", 198 | "owner": "nix-community", 199 | "repo": "nixvim", 200 | "rev": "8b3a69cfea5ba2fa008c6c57ab79c99c513a349b", 201 | "type": "github" 202 | }, 203 | "original": { 204 | "owner": "nix-community", 205 | "repo": "nixvim", 206 | "type": "github" 207 | } 208 | }, 209 | "nuschtosSearch": { 210 | "inputs": { 211 | "flake-utils": "flake-utils", 212 | "ixx": "ixx", 213 | "nixpkgs": [ 214 | "nixvim", 215 | "nixpkgs" 216 | ] 217 | }, 218 | "locked": { 219 | "lastModified": 1748298102, 220 | "narHash": "sha256-PP11GVwUt7F4ZZi5A5+99isuq39C59CKc5u5yVisU/U=", 221 | "owner": "NuschtOS", 222 | "repo": "search", 223 | "rev": "f8a1c221afb8b4c642ed11ac5ee6746b0fe1d32f", 224 | "type": "github" 225 | }, 226 | "original": { 227 | "owner": "NuschtOS", 228 | "repo": "search", 229 | "type": "github" 230 | } 231 | }, 232 | "pre-commit-hooks": { 233 | "inputs": { 234 | "flake-compat": "flake-compat", 235 | "gitignore": "gitignore", 236 | "nixpkgs": "nixpkgs_3" 237 | }, 238 | "locked": { 239 | "lastModified": 1747372754, 240 | "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", 241 | "owner": "cachix", 242 | "repo": "pre-commit-hooks.nix", 243 | "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", 244 | "type": "github" 245 | }, 246 | "original": { 247 | "owner": "cachix", 248 | "repo": "pre-commit-hooks.nix", 249 | "type": "github" 250 | } 251 | }, 252 | "root": { 253 | "inputs": { 254 | "flake-parts": "flake-parts", 255 | "nixpkgs": "nixpkgs", 256 | "nixvim": "nixvim", 257 | "pre-commit-hooks": "pre-commit-hooks" 258 | } 259 | }, 260 | "systems": { 261 | "locked": { 262 | "lastModified": 1681028828, 263 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 264 | "owner": "nix-systems", 265 | "repo": "default", 266 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 267 | "type": "github" 268 | }, 269 | "original": { 270 | "owner": "nix-systems", 271 | "repo": "default", 272 | "type": "github" 273 | } 274 | }, 275 | "systems_2": { 276 | "locked": { 277 | "lastModified": 1681028828, 278 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 279 | "owner": "nix-systems", 280 | "repo": "default", 281 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 282 | "type": "github" 283 | }, 284 | "original": { 285 | "owner": "nix-systems", 286 | "repo": "default", 287 | "type": "github" 288 | } 289 | } 290 | }, 291 | "root": "root", 292 | "version": 7 293 | } 294 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "deCort.tech NeoVim configuration"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | flake-parts.url = "github:hercules-ci/flake-parts"; 7 | nixvim = { 8 | url = "github:nix-community/nixvim"; 9 | }; 10 | pre-commit-hooks = { 11 | url = "github:cachix/pre-commit-hooks.nix"; 12 | }; 13 | }; 14 | 15 | outputs = 16 | { 17 | nixpkgs, 18 | nixvim, 19 | flake-parts, 20 | pre-commit-hooks, 21 | ... 22 | }@inputs: 23 | flake-parts.lib.mkFlake { inherit inputs; } { 24 | systems = [ 25 | "aarch64-linux" 26 | "x86_64-linux" 27 | "aarch64-darwin" 28 | "x86_64-darwin" 29 | ]; 30 | 31 | perSystem = 32 | { 33 | system, 34 | pkgs, 35 | self', 36 | lib, 37 | ... 38 | }: 39 | let 40 | nixvimLib = nixvim.lib.${system}; 41 | nixvim' = nixvim.legacyPackages.${system}; 42 | nixvimModule = { 43 | inherit pkgs; 44 | module = import ./config; # import the module directly 45 | # You can use `extraSpecialArgs` to pass additional arguments to your module files 46 | extraSpecialArgs = { 47 | # inherit (inputs) foo; 48 | }; 49 | }; 50 | nvim = nixvim'.makeNixvimWithModule nixvimModule; 51 | in 52 | { 53 | checks = { 54 | default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; 55 | pre-commit-check = pre-commit-hooks.lib.${system}.run { 56 | src = ./.; 57 | hooks = { 58 | statix.enable = true; 59 | nixfmt-rfc-style.enable = true; 60 | }; 61 | }; 62 | }; 63 | 64 | formatter = pkgs.nixfmt-rfc-style; 65 | 66 | packages = { 67 | default = nvim; 68 | }; 69 | 70 | devShells = { 71 | default = with pkgs; mkShell { inherit (self'.checks.pre-commit-check) shellHook; }; 72 | }; 73 | }; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "platform": "github", 4 | "semanticCommits": true, 5 | "labels": ["renovate"], 6 | "repositories": ["dc-tec/nixvim"], 7 | "extends": ["config:recommended"], 8 | } 9 | --------------------------------------------------------------------------------