neovim conf based on kickstart.nvim
at main 239 lines 7.5 kB view raw
1return { 2 { 3 'folke/tokyonight.nvim', 4 lazy = false, 5 priority = 1000, 6 opts = {}, 7 }, 8 { 9 'HiPhish/rainbow-delimiters.nvim', 10 name = 'rainbow-delimiters', 11 }, 12 { 'nvzone/volt', lazy = true }, 13 { 14 'nvzone/minty', 15 cmd = { 'Shades', 'Huefy' }, 16 }, 17 { 18 'mrjones2014/smart-splits.nvim', 19 keys = { 20 -- Resizing splits 21 { 22 '<A-h>', 23 function() require('smart-splits').resize_left() end, 24 desc = 'Resize split left', 25 }, 26 { 27 '<A-j>', 28 function() require('smart-splits').resize_down() end, 29 desc = 'Resize split down', 30 }, 31 { 32 '<A-k>', 33 function() require('smart-splits').resize_up() end, 34 desc = 'Resize split up', 35 }, 36 { 37 '<A-l>', 38 function() require('smart-splits').resize_right() end, 39 desc = 'Resize split right', 40 }, 41 42 -- Moving between splits 43 { 44 '<C-h>', 45 function() require('smart-splits').move_cursor_left() end, 46 desc = 'Move to left split', 47 }, 48 { 49 '<C-j>', 50 function() require('smart-splits').move_cursor_down() end, 51 desc = 'Move to split below', 52 }, 53 { 54 '<C-k>', 55 function() require('smart-splits').move_cursor_up() end, 56 desc = 'Move to split above', 57 }, 58 { 59 '<C-l>', 60 function() require('smart-splits').move_cursor_right() end, 61 desc = 'Move to right split', 62 }, 63 { 64 '<C-\\>', 65 function() require('smart-splits').move_cursor_previous() end, 66 desc = 'Move to previous split', 67 }, 68 69 -- Swapping buffers between windows 70 { 71 '<leader><leader>h', 72 function() require('smart-splits').swap_buf_left() end, 73 desc = 'Swap buffer left', 74 }, 75 { 76 '<leader><leader>j', 77 function() require('smart-splits').swap_buf_down() end, 78 desc = 'Swap buffer down', 79 }, 80 { 81 '<leader><leader>k', 82 function() require('smart-splits').swap_buf_up() end, 83 desc = 'Swap buffer up', 84 }, 85 { 86 '<leader><leader>l', 87 function() require('smart-splits').swap_buf_right() end, 88 desc = 'Swap buffer right', 89 }, 90 }, 91 }, 92 { 93 'folke/noice.nvim', 94 event = 'VeryLazy', 95 opts = { 96 lsp = { 97 override = { 98 ['vim.lsp.util.convert_input_to_markdown_lines'] = true, 99 ['vim.lsp.util.stylize_markdown'] = true, 100 ['cmp.entry.get_documentation'] = true, 101 }, 102 }, 103 routes = { 104 { 105 filter = { 106 event = 'msg_show', 107 any = { 108 { find = '%d+L, %d+B' }, 109 { find = '; after #%d+' }, 110 { find = '; before #%d+' }, 111 }, 112 }, 113 view = 'mini', 114 }, 115 }, 116 presets = { 117 bottom_search = false, 118 command_palette = true, 119 long_message_to_split = true, 120 inc_rename = true, 121 }, 122 }, 123 -- stylua: ignore 124 keys = { 125 { "<leader>sn", "", desc = "+noice"}, 126 { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, 127 { "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, 128 { "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" }, 129 { "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" }, 130 { "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, 131 { "<leader>snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" }, 132 { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, 133 { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, 134 }, 135 config = function(_, opts) 136 -- HACK: noice shows messages from before it was enabled, 137 -- but this is not ideal when Lazy is installing plugins, 138 -- so clear the messages in this case. 139 if vim.o.filetype == 'lazy' then vim.cmd [[messages clear]] end 140 require('noice').setup(opts) 141 end, 142 }, 143 { 144 'folke/edgy.nvim', 145 event = 'VeryLazy', 146 keys = { 147 { 148 '<leader>ue', 149 function() require('edgy').toggle() end, 150 desc = 'Edgy Toggle', 151 }, 152 -- stylua: ignore 153 { "<leader>uE", function() require("edgy").select() end, desc = "Edgy Select Window" }, 154 }, 155 opts = function() 156 local opts = { 157 bottom = { 158 { 159 ft = 'toggleterm', 160 size = { height = 0.4 }, 161 filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == '' end, 162 }, 163 { 164 ft = 'noice', 165 size = { height = 0.4 }, 166 filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == '' end, 167 }, 168 'Trouble', 169 { ft = 'qf', title = 'QuickFix' }, 170 { 171 ft = 'help', 172 size = { height = 20 }, 173 -- don't open help files in edgy that we're editing 174 filter = function(buf) return vim.bo[buf].buftype == 'help' end, 175 }, 176 { title = 'Spectre', ft = 'spectre_panel', size = { height = 0.4 } }, 177 { title = 'Neotest Output', ft = 'neotest-output-panel', size = { height = 15 } }, 178 }, 179 left = { 180 { title = 'Neotest Summary', ft = 'neotest-summary' }, 181 -- "neo-tree", 182 }, 183 right = { 184 { title = 'Grug Far', ft = 'grug-far', size = { width = 0.4 } }, 185 }, 186 keys = { 187 -- increase width 188 ['<c-Right>'] = function(win) win:resize('width', 2) end, 189 -- decrease width 190 ['<c-Left>'] = function(win) win:resize('width', -2) end, 191 -- increase height 192 ['<c-Up>'] = function(win) win:resize('height', 2) end, 193 -- decrease height 194 ['<c-Down>'] = function(win) win:resize('height', -2) end, 195 }, 196 } 197 198 local pos = { 199 filesystem = 'left', 200 buffers = 'top', 201 git_status = 'right', 202 document_symbols = 'bottom', 203 diagnostics = 'bottom', 204 } 205 206 -- trouble 207 for _, pos in ipairs { 'top', 'bottom', 'left', 'right' } do 208 opts[pos] = opts[pos] or {} 209 table.insert(opts[pos], { 210 ft = 'trouble', 211 filter = function(_buf, win) 212 return vim.w[win].trouble 213 and vim.w[win].trouble.position == pos 214 and vim.w[win].trouble.type == 'split' 215 and vim.w[win].trouble.relative == 'editor' 216 and not vim.w[win].trouble_preview 217 end, 218 }) 219 end 220 221 -- snacks terminal 222 for _, pos in ipairs { 'top', 'bottom', 'left', 'right' } do 223 opts[pos] = opts[pos] or {} 224 table.insert(opts[pos], { 225 ft = 'snacks_terminal', 226 size = { height = 0.4 }, 227 title = '%{b:snacks_terminal.id}: %{b:term_title}', 228 filter = function(_buf, win) 229 return vim.w[win].snacks_win 230 and vim.w[win].snacks_win.position == pos 231 and vim.w[win].snacks_win.relative == 'editor' 232 and not vim.w[win].trouble_preview 233 end, 234 }) 235 end 236 return opts 237 end, 238 }, 239}