| 1 | { |
| 2 | config, |
| 3 | pkgs, |
| 4 | lib, |
| 5 | ... |
| 6 | }: |
| 7 | { |
| 8 | imports = [ |
| 9 | ./formatter.nix |
| 10 | ./keybind.nix |
| 11 | ./options.nix |
| 12 | ./blink-cmp.nix |
| 13 | ]; |
| 14 | # based on default options from upstream: |
| 15 | # https://github.com/NotAShelf/nvf/blob/main/configuration.nix |
| 16 | # |
| 17 | # a full list of options is available too: |
| 18 | # https://notashelf.github.io/nvf/options.html |
| 19 | # |
| 20 | # override level 999 is used to not conflict with mkDefault as used by nvf. |
| 21 | # which allows user configurations to disable/override anything here. |
| 22 | config.vim = lib.mkOverride 999 { |
| 23 | extraLuaFiles = [ |
| 24 | ./commands/FullscreenTerm.lua |
| 25 | ./commands/SmartQuit.lua |
| 26 | |
| 27 | ./extra.lua |
| 28 | ]; |
| 29 | theme.enable = true; |
| 30 | visuals = { |
| 31 | # notification system |
| 32 | # https://github.com/j-hui/fidget.nvim |
| 33 | fidget-nvim.enable = true; |
| 34 | # highlight undo / paste / autoformat / macros |
| 35 | # https://github.com/tzachar/highlight-undo.nvim |
| 36 | highlight-undo.enable = true; |
| 37 | # indentation guides |
| 38 | # https://github.com/lukas-reineke/indent-blankline.nvim |
| 39 | indent-blankline.enable = true; |
| 40 | # extra icons |
| 41 | nvim-web-devicons.enable = true; |
| 42 | # https://github.com/petertriho/nvim-scrollbar |
| 43 | nvim-scrollbar.enable = false; |
| 44 | }; |
| 45 | lsp = { |
| 46 | # Must be enabled for language modules to hook into the LSP API. |
| 47 | enable = true; |
| 48 | formatOnSave = true; |
| 49 | # show errors inline |
| 50 | # https://github.com/folke/trouble.nvim |
| 51 | trouble.enable = true; |
| 52 | # show lightbulb icon in gutter to indicate code actions |
| 53 | # https://github.com/kosayoda/nvim-lightbulb |
| 54 | lightbulb.enable = false; |
| 55 | # show icons in auto-completion menu |
| 56 | # https://github.com/onsails/lspkind.nvim |
| 57 | lspkind.enable = config.vim.autocomplete.blink-cmp.enable; |
| 58 | # Enables inlay hints (types info in rust and shit) |
| 59 | inlayHints.enable = true; |
| 60 | # Nice mappings that I use :3 |
| 61 | mappings = { |
| 62 | codeAction = null; # in keymaps |
| 63 | goToDeclaration = "gD"; |
| 64 | goToDefinition = "gd"; |
| 65 | # TODO: changing these works but there is something else defining stuff |
| 66 | # like grn, grr, grt, etc |
| 67 | listReferences = "grr"; |
| 68 | goToType = "grt"; |
| 69 | hover = "K"; |
| 70 | nextDiagnostic = null; # ]d |
| 71 | openDiagnosticFloat = "<leader>d"; |
| 72 | renameSymbol = "grn"; |
| 73 | documentHighlight = null; |
| 74 | listDocumentSymbols = null; |
| 75 | listImplementations = null; |
| 76 | listWorkspaceFolders = null; |
| 77 | previousDiagnostic = null; |
| 78 | removeWorkspaceFolder = null; |
| 79 | signatureHelp = null; |
| 80 | toggleFormatOnSave = null; |
| 81 | }; |
| 82 | servers.nixd.init_options.autoArchive = true; |
| 83 | }; |
| 84 | treesitter = { |
| 85 | enable = false; |
| 86 | addDefaultGrammars = true; |
| 87 | }; |
| 88 | debugger.nvim-dap = { |
| 89 | enable = true; |
| 90 | ui.enable = true; |
| 91 | }; |
| 92 | languages = { |
| 93 | enableFormat = true; |
| 94 | enableTreesitter = false; |
| 95 | enableExtraDiagnostics = true; |
| 96 | # enable debug adapter protocol by default |
| 97 | enableDAP = true; |
| 98 | |
| 99 | # sort-lines: on |
| 100 | bash.enable = true; |
| 101 | clang.enable = true; |
| 102 | css.enable = true; |
| 103 | html.enable = true; |
| 104 | nix.enable = true; |
| 105 | python.enable = true; |
| 106 | rust.extensions.crates-nvim.enable = true; |
| 107 | rust.enable = true; |
| 108 | typescript.enable = true; |
| 109 | zig.enable = true; |
| 110 | # sort-lines: off |
| 111 | |
| 112 | nix.lsp.servers = [ "nixd" ]; |
| 113 | }; |
| 114 | filetree.neo-tree = { |
| 115 | enable = true; |
| 116 | setupOpts = { |
| 117 | enable_cursor_hijack = true; |
| 118 | git_status_async = true; |
| 119 | close_if_last_window = true; |
| 120 | window.width = 30; |
| 121 | filesystem.filtered_items = { |
| 122 | # dotfiles are often used for project configuration |
| 123 | hide_dotfiles = false; |
| 124 | never_show = [ |
| 125 | ".git" |
| 126 | ".jj" |
| 127 | ".DS_Store" # macOS |
| 128 | "thumbs.db" # Windows |
| 129 | ]; |
| 130 | never_show_by_pattern = [ |
| 131 | ".*.swp" |
| 132 | "._*" # macOS |
| 133 | ]; |
| 134 | }; |
| 135 | }; |
| 136 | }; |
| 137 | fzf-lua = { |
| 138 | enable = true; |
| 139 | setupOpts = { |
| 140 | fzf_colors = true; |
| 141 | keymap.fzf = { |
| 142 | "ctrl-q" = "select-all+accept"; |
| 143 | }; |
| 144 | }; |
| 145 | }; |
| 146 | statusline = { |
| 147 | lualine = { |
| 148 | enable = true; |
| 149 | refresh = { |
| 150 | statusline = 100; |
| 151 | tabline = 100; |
| 152 | winbar = 100; |
| 153 | }; |
| 154 | }; |
| 155 | }; |
| 156 | binds = { |
| 157 | whichKey.enable = true; |
| 158 | cheatsheet.enable = true; |
| 159 | }; |
| 160 | ui = { |
| 161 | borders.enable = true; |
| 162 | # https://github.com/norcalli/nvim-colorizer.lua |
| 163 | colorizer.enable = true; |
| 164 | # https://github.com/RRethy/vim-illuminate |
| 165 | illuminate.enable = true; |
| 166 | breadcrumbs = { |
| 167 | enable = false; |
| 168 | navbuddy.enable = config.vim.ui.breadcrumbs.enable; |
| 169 | }; |
| 170 | }; |
| 171 | notes = { |
| 172 | todo-comments.enable = true; |
| 173 | }; |
| 174 | git = { |
| 175 | enable = true; |
| 176 | gitsigns.enable = true; |
| 177 | gitsigns.codeActions.enable = false; # throws an annoying debug message |
| 178 | }; |
| 179 | utility.undotree.enable = true; |
| 180 | # Better help docs |
| 181 | lazy.plugins."helpview.nvim" = { |
| 182 | enabled = true; |
| 183 | package = pkgs.vimPlugins.helpview-nvim; |
| 184 | lazy = false; |
| 185 | }; |
| 186 | }; |
| 187 | } |