Configuration for my NixOS based systems and Home Manager
1-- Bootstrap lazy.nvim
2local ensure_lazy = function()
3 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
4 if not vim.loop.fs_stat(lazypath) then
5 vim.fn.system({
6 "git", "clone", "--filter=blob:none",
7 "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release
8 lazypath
9 })
10 end
11 vim.opt.rtp:prepend(lazypath)
12end
13
14local lazy_bootstrap = ensure_lazy()
15if lazy_bootstrap then print("Bootstrapped lazy.nvim") end
16
17require("lazy").setup({
18 install = { colorscheme = { "catppuccin-latte" } },
19 checker = { enabled = false },
20 spec = {
21 -- Color themes
22 { "shaunsingh/nord.nvim", priority = 1000, lazy = true },
23 { "shaunsingh/moonlight.nvim", priority = 1000, lazy = true },
24 { "folke/tokyonight.nvim", priority = 1000, lazy = true },
25 { "cranberry-clockworks/coal.nvim", priority = 1000, lazy = true },
26 { "hardselius/warlock", priority = 1000, lazy = true },
27 { "sontungexpt/witch", priority = 1000, lazy = true, config = true },
28 { "rose-pine/neovim", priority = 1000, lazy = true },
29 { "catppuccin/nvim", name = "catppuccin", priority = 1000, lazy = true },
30 { "p00f/alabaster.nvim", priority = 1000, lazy = true },
31 {
32 "neanias/everforest-nvim",
33 version = false,
34 lazy = true,
35 priority = 1000, -- make sure to load this before all the other start plugins
36 main = "everforest",
37 opts = { background = "hard" }
38 },
39 { "rebelot/kanagawa.nvim", opts = { compile = true }, priority = 1000, lazy = true },
40 {
41 'jesseleite/nvim-noirbuddy',
42 dependencies = {
43 'tjdevries/colorbuddy.nvim',
44 'nvim-lualine/lualine.nvim'
45 },
46 lazy = true,
47 priority = 1000,
48 config = function(_, opts)
49 -- configure lualine
50 require('noirbuddy').setup(opts)
51 local noirbuddy_lualine = require("noirbuddy.plugins.lualine")
52 require("lualine").setup {
53 options = {
54 icons_enabled = true,
55 --theme = "auto"
56 theme = noirbuddy_lualine.theme
57 },
58 sections = noirbuddy_lualine.sections,
59 inactive_sections = noirbuddy_lualine.inactive_sections,
60 }
61 end,
62 opts = {
63 -- All of your `setup(opts)` will go here
64 preset = "oxide",
65 colors = {
66 noir_8 = "#3A4649"
67 }
68 },
69 },
70 -- Completion
71 {
72 "hrsh7th/nvim-cmp",
73 dependencies = {
74 "hrsh7th/cmp-nvim-lsp",
75 "hrsh7th/cmp-buffer",
76 "hrsh7th/cmp-path",
77 "hrsh7th/cmp-vsnip",
78 "hrsh7th/vim-vsnip",
79 "petertriho/cmp-git",
80 "hrsh7th/cmp-cmdline"
81 },
82 config = require('completion')
83 }, -- nvim lsp plugins
84 {
85 "neovim/nvim-lspconfig",
86 config = false
87 },
88 -- LSP Goodness
89 {
90 "ray-x/navigator.lua",
91 dependencies = {
92 { 'ray-x/guihua.lua', build = 'cd lua/fzy && make' },
93 { 'neovim/nvim-lspconfig' },
94 }
95
96 },
97 {
98 -- Syntax Highlighting from the future
99 "nvim-treesitter/nvim-treesitter",
100 branch = "main",
101 --init = function() vim.cmd([[":TSUpdate"]]) end,
102 main = "nvim-treesitter",
103 opts = {},
104 config = function(_, opts)
105 require("nvim-treesitter").setup(opts)
106 vim.api.nvim_create_autocmd("FileType", {
107 callback = function()
108 pcall(vim.treesitter.start)
109 end,
110 })
111 end,
112 build = ":TSUpdate",
113 version = false,
114 },
115 { "nvim-treesitter/nvim-treesitter-context", enabled = false },
116 -- Git stuff
117 --
118 -- GitGutter, shows inline difs
119 --"airblade/vim-gitgutter",
120 {
121 "NeogitOrg/neogit",
122 dependencies = {
123 "nvim-lua/plenary.nvim", -- required
124 "sindrets/diffview.nvim", -- optional - Diff integration
125 "nvim-telescope/telescope.nvim"
126 },
127 config = true
128 },
129 -- Auto format tool
130 {
131 "stevearc/conform.nvim",
132 lazy = true,
133 opts = {
134 python = { "isort", "black" },
135 lua = { "lua-format" },
136 clojure = { "cljfmt" },
137 rust = { "rustfmt" },
138 haskell = { "ormolu", "stylish-haskell" },
139 go = { "goimports", "gofmt" },
140 java = { "google-java-format" },
141 javascript = { "prettierd", "prettier", stop_after_first = true },
142 typescript = { "prettierd", "prettier", stop_after_first = true },
143 html = { "prettierd", "prettier", stop_after_first = true },
144 yaml = { "prettier" },
145 sh = { "shfmt" },
146 c = { "clang-format" },
147 }
148 },
149 --{
150 -- "hedyhli/outline.nvim",
151 -- lazy = true,
152 -- cmd = { "Outline", "OutlineOpen" },
153 -- config = true,
154 -- keys = {
155 -- { "<leader>o", "<cmd>Outline<cr>", desc = "Toggle outline" },
156 -- },
157 --},
158 {
159 "ray-x/go.nvim",
160 ft = "go",
161 lazy = true,
162 dependencies = {
163 "ray-x/guihua.lua", "neovim/nvim-lspconfig",
164 "nvim-treesitter/nvim-treesitter"
165 }
166 },
167 {
168 "nvim-lualine/lualine.nvim",
169 config = true,
170 dependencies = { "nvim-tree/nvim-web-devicons" }
171 },
172 -- Fuzzy finding stuff
173 "ibhagwan/fzf-lua",
174 -- A lua + nvim stdlib sort of thing
175 { "nvim-lua/plenary.nvim", lazy = true, },
176 -- Telescope, find anything fast
177 {
178 "nvim-telescope/telescope.nvim",
179 config = true,
180 dependencies = {
181 "nvim-lua/plenary.nvim",
182 "nvim-telescope/telescope-symbols.nvim",
183 "nvim-telescope/telescope-fzf-native.nvim"
184 }
185 },
186 {
187 "folke/trouble.nvim",
188 dependencies = "nvim-tree/nvim-web-devicons",
189 config = true,
190 },
191 -- Which key is bound?
192 -- literally the best plugin ever
193 {
194 "folke/which-key.nvim",
195 init = function()
196 vim.o.timeout = true
197 vim.o.timeoutlen = 300
198 end,
199 config = true
200 },
201 -- Developing my neovim
202 {
203 "folke/lazydev.nvim",
204 config = true,
205 ft = "lua",
206 lazy = true,
207 opts = {
208 library = {
209 path = "luvit-meta/library", words = { "vim%.uv" },
210 },
211 },
212 dependencies = {
213 "Bilal2453/luvit-meta"
214 },
215 },
216 -- Lithsps
217 {
218 "windwp/nvim-autopairs",
219 event = "InsertEnter",
220 config = function()
221 local pairs = require("nvim-autopairs")
222
223 pairs.setup({
224 check_ts = true,
225 enable_check_bracket_line = false,
226 })
227
228 pairs.get_rules("`")[1].not_filetypes = { "clojure", "scheme", "scm", "janet" }
229 pairs.get_rules("'")[1].not_filetypes = { "clojure", "scheme", "scm", "janet", "rust" }
230 end,
231 },
232 -- This gives me the paredit engine, it's pretty nifty
233 {
234 "gpanders/nvim-parinfer",
235 ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" },
236 lazy = true,
237 config = function()
238 --vim.g.parinfer_comment_chars = { ";" }
239 vim.g.parinfer_force_balance = true
240 end
241 }, -- ))))))
242 -- This one gives me vim-sexp like structural editing
243 {
244 "julienvincent/nvim-paredit",
245 config = function()
246 local paredit = require('nvim-paredit')
247 paredit.setup({
248 indent = {
249 enabled = true,
250 },
251 filetypes = { "clojure", "fennel", "janet" },
252 })
253 end,
254 lazy = true,
255 ft = { "hy", "scheme", "scm", "clojure", "fennel", "janet", "lisp", "python", "lua" }
256 },
257 { "hiphish/rainbow-delimiters.nvim", priority = 1050, ft = { "scheme", "scm", "clojure", "janet", "lisp" } },
258 -- Conjure, lisp is magical
259 {
260 "Olical/conjure",
261 dependencies = { "PaterJason/cmp-conjure" },
262 config = function()
263 vim.g["conjure#client#scheme#stdio#command"] = "gxi"
264 vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> $?"
265 end,
266 lazy = true,
267 ft = { "scheme", "scm", "lisp", "fennel", "clojure", "lua", "janet" },
268 },
269 { "PaterJason/cmp-conjure", lazy = true },
270 { "p1xelHer0/gerbil.nvim", lazy = true, ft = "scheme", config = true },
271 -- Fennel, Luasthp
272 { "jaawerth/fennel.vim", lazy = true, ft = "fennel", config = true },
273 { "rktjmp/hotpot.nvim", lazy = true, ft = "fennel", config = true },
274 { "Olical/nfnl", lazy = true, ft = "fennel", config = true },
275 -- Rust stuff
276 {
277 "mrcjkb/rustaceanvim",
278 lazy = false,
279 version = "^9",
280 config = function()
281 vim.g.rustaceanvim = {
282 server = {
283 settings = {
284 ['rust-analyzer'] = {
285 files = {
286 excludeDirs = { "target", ".cargo", ".direnv" },
287 },
288 },
289 },
290 },
291 }
292 end,
293 },
294 { "mfussenegger/nvim-dap", lazy = true, ft = { "c", "rust" } },
295 {
296 "saecki/crates.nvim",
297 tag = "v0.7.1",
298 dependencies = { "nvim-lua/plenary.nvim" },
299 config = function() require("crates").setup() end,
300 lazy = true,
301 ft = { "rust" }
302 },
303 -- TCL
304 { "lewis6991/tree-sitter-tcl", lazy = true, build = "make", ft = { "tcl" } },
305 -- LF
306 {
307 "ptzz/lf.vim",
308 lazy = true,
309 cmd = { "Lf" },
310 dependencies = { "voldikss/vim-floaterm" }
311 },
312 { "imsnif/kdl.vim", lazy = true, ft = "kdl" },
313 { "catgoose/nvim-colorizer.lua", lazy = true, ft = { "css", "html", "toml", "conf" } },
314 {
315 "lewis6991/gitsigns.nvim",
316 config = true,
317 opts = {
318 on_attach = function(bufnr)
319 local gitsigns = require('gitsigns')
320
321 local function map(mode, l, r, opts)
322 opts = opts or {}
323 opts.buffer = bufnr
324 vim.keymap.set(mode, l, r, opts)
325 end
326
327 -- Navigation
328 map('n', ']c', function()
329 if vim.wo.diff then
330 vim.cmd.normal({ ']c', bang = true })
331 else
332 gitsigns.nav_hunk('next')
333 end
334 end)
335
336 map('n', '[c', function()
337 if vim.wo.diff then
338 vim.cmd.normal({ '[c', bang = true })
339 else
340 gitsigns.nav_hunk('prev')
341 end
342 end)
343
344 -- Actions
345 map('n', '<leader>gs', gitsigns.stage_hunk)
346 map('n', '<leader>gr', gitsigns.reset_hunk)
347
348 map('v', '<leader>gs', function()
349 gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') })
350 end)
351
352 map('v', '<leader>gr', function()
353 gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') })
354 end)
355
356 map('n', '<leader>gS', gitsigns.stage_buffer)
357 map('n', '<leader>gR', gitsigns.reset_buffer)
358 map('n', '<leader>gp', gitsigns.preview_hunk)
359 map('n', '<leader>gi', gitsigns.preview_hunk_inline)
360
361 map('n', '<leader>gb', function()
362 gitsigns.blame_line({ full = true })
363 end)
364
365 map('n', '<leader>gd', gitsigns.diffthis)
366
367 map('n', '<leader>gD', function()
368 gitsigns.diffthis('~')
369 end)
370
371 map('n', '<leader>gQ', function() gitsigns.setqflist('all') end)
372 map('n', '<leader>gq', gitsigns.setqflist)
373
374 -- Toggles
375 map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
376 map('n', '<leader>gtw', gitsigns.toggle_word_diff)
377
378 -- Text object
379 map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
380 end
381 }
382 },
383 {
384 "Bowuigi/acme-nvim",
385 config = function()
386 local acme = require('acme')
387 local opts = { noremap = true, silent = true }
388 vim.keymap.set("n", "<leader>ee", acme.exec, opts)
389 vim.keymap.set("v", "<leader>ee", acme.exec, opts)
390 vim.keymap.set("v", "<leader>et", acme.tagline, opts)
391 vim.keymap.set("v", "<leader>em", acme.mark, opts)
392 end
393 },
394 { "rachartier/tiny-cmdline.nvim", config = true }
395 }
396})