From 0ceb29a55c0e825104af3d3996c28ccea323fa84 Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Sun, 6 Oct 2024 23:00:01 +0200
Subject: [PATCH 1/2] WIP: nvim: Experimental minimized setup

---
 files/config/nvim/.vimrc                      |  64 +++++++++
 files/config/nvim/init.lua                    |  66 ++++++++-
 files/config/nvim/lua/config/autocmds.lua     |  16 ---
 files/config/nvim/lua/config/keymaps.lua      |  19 ---
 files/config/nvim/lua/config/lazy.lua         |  60 --------
 files/config/nvim/lua/config/options.lua      |  36 -----
 files/config/nvim/lua/plugins/coding.lua      |  69 ----------
 files/config/nvim/lua/plugins/colorscheme.lua |  14 --
 files/config/nvim/lua/plugins/editor.lua      | 100 --------------
 files/config/nvim/lua/plugins/extras.lua      |  99 -------------
 files/config/nvim/lua/plugins/formatting.lua  |  15 --
 files/config/nvim/lua/plugins/incline.lua     |  72 ----------
 files/config/nvim/lua/plugins/lsp.lua         |  35 -----
 files/config/nvim/lua/plugins/treesitter.lua  |  41 ------
 files/config/nvim/lua/plugins/ui.lua          | 130 ------------------
 flake.lock                                    |  26 ++--
 home/common/default.nix                       |   2 +-
 home/common/nvim.nix                          |  19 ---
 home/common/nvim/default.nix                  | 125 +++++++++++++++++
 home/common/nvim/lsp.lua                      |  91 ++++++++++++
 home/common/nvim/mini.lua                     | 114 +++++++++++++++
 21 files changed, 472 insertions(+), 741 deletions(-)
 create mode 100644 files/config/nvim/.vimrc
 delete mode 100644 files/config/nvim/lua/config/autocmds.lua
 delete mode 100644 files/config/nvim/lua/config/keymaps.lua
 delete mode 100644 files/config/nvim/lua/config/lazy.lua
 delete mode 100644 files/config/nvim/lua/config/options.lua
 delete mode 100644 files/config/nvim/lua/plugins/coding.lua
 delete mode 100644 files/config/nvim/lua/plugins/colorscheme.lua
 delete mode 100644 files/config/nvim/lua/plugins/editor.lua
 delete mode 100644 files/config/nvim/lua/plugins/extras.lua
 delete mode 100644 files/config/nvim/lua/plugins/formatting.lua
 delete mode 100644 files/config/nvim/lua/plugins/incline.lua
 delete mode 100644 files/config/nvim/lua/plugins/lsp.lua
 delete mode 100644 files/config/nvim/lua/plugins/treesitter.lua
 delete mode 100644 files/config/nvim/lua/plugins/ui.lua
 delete mode 100644 home/common/nvim.nix
 create mode 100644 home/common/nvim/default.nix
 create mode 100644 home/common/nvim/lsp.lua
 create mode 100644 home/common/nvim/mini.lua

diff --git a/files/config/nvim/.vimrc b/files/config/nvim/.vimrc
new file mode 100644
index 0000000..93a7db0
--- /dev/null
+++ b/files/config/nvim/.vimrc
@@ -0,0 +1,64 @@
+" Load plugins
+filetype plugin indent on
+
+" Search
+set ignorecase
+set smartcase
+
+" Tab completion
+set wildmode=list:longest,full
+set wildignore=*.swp,*.o,*.so,*.exe,*.dll
+
+" Tab settings
+set ts=2
+set sw=2
+set expandtab
+
+" Hud
+set termguicolors
+syntax on
+"set colorcolumn=80
+set cursorline
+set fillchars=vert:\│
+set hidden
+set list
+set listchars=tab:»·,trail:·
+set nofoldenable
+set nowrap
+set number
+set relativenumber
+set ruler
+set scrolloff=3
+
+" Tags
+set tags=./tags;/,tags;/
+
+" Backup Directories
+set backupdir=~/.config/nvim/backups,.
+set directory=~/.config/nvim/swaps,.
+if exists('&undodir')
+  set undodir=~/.config/nvim/undo,.
+endif
+
+let mapleader=','
+let maplocalleader=','
+
+" Jump key
+nnoremap ` '
+nnoremap ' `
+
+" Change pane
+nnoremap <C-h> <C-w>h
+nnoremap <C-j> <C-w>j
+nnoremap <C-k> <C-w>k
+nnoremap <C-l> <C-w>l
+
+" Turn off search highlight
+nnoremap <localleader>/ :nohlsearch<CR>
+
+" Trim trailing whitespace
+nnoremap <localleader>tw m`:%s/\s\+$//e<CR>:nohlsearch<CR>``
+
+" Fancy macros
+nnoremap Q @q
+vnoremap Q :norm @q<cr>
diff --git a/files/config/nvim/init.lua b/files/config/nvim/init.lua
index 2514f9e..9aa1759 100644
--- a/files/config/nvim/init.lua
+++ b/files/config/nvim/init.lua
@@ -1,2 +1,64 @@
--- bootstrap lazy.nvim, LazyVim and your plugins
-require("config.lazy")
+-- Load .vimrc
+vim.cmd([[runtime .vimrc]])
+
+vim.g.root_spec = { { ".git", ".jj", "lua" }, "lsp", "cwd" }
+
+vim.o.autochdir = true
+vim.o.fillchars = "stl: ,stlnc: ,eob:░"
+vim.o.list = false
+vim.o.scrolloff = 7
+vim.o.splitkeep = "screen"
+vim.o.updatetime = 50
+vim.o.timeout = true
+vim.o.timeoutlen = 10
+
+-- Neovim specific settings
+vim.o.icm = "split"
+-- vim.o.cia = 'kind,abbr,menu' wait for nightly to drop
+vim.o.foldtext = "v:lua.vim.treesitter.foldtext()"
+
+vim.opt.foldmethod = "expr"
+vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+
+vim.o.showmode = false
+
+-- Use rg
+vim.o.grepprg = [[rg --glob "!.git" --no-heading --vimgrep --follow $*]]
+vim.opt.grepformat = vim.opt.grepformat ^ { "%f:%l:%c:%m" }
+
+vim.fn.sign_define(
+	"DiagnosticSignError",
+	{ text = "", hl = "DiagnosticSignError", texthl = "DiagnosticSignError", culhl = "DiagnosticSignErrorLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignWarn",
+	{ text = "", hl = "DiagnosticSignWarn", texthl = "DiagnosticSignWarn", culhl = "DiagnosticSignWarnLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignInfo",
+	{ text = "", hl = "DiagnosticSignInfo", texthl = "DiagnosticSignInfo", culhl = "DiagnosticSignInfoLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignHint",
+	{ text = "", hl = "DiagnosticSignHint", texthl = "DiagnosticSignHint", culhl = "DiagnosticSignHintLine" }
+)
+
+-- Make <Tab> work for snippets
+vim.keymap.set({ "i", "s" }, "<Tab>", function()
+	if vim.snippet.active({ direction = 1 }) then
+		return "<cmd>lua vim.snippet.jump(1)<cr>"
+	else
+		return "<Tab>"
+	end
+end, { expr = true })
+
+-- Covenience macros
+-- fix ellipsis: "..." -> "…"
+vim.keymap.set(
+	"n",
+	"<leader>fe",
+	"mc:%s,\\.\\.\\.,…,g<CR>:nohlsearch<CR>`c",
+	{ noremap = true, silent = true, desc = "... -> …" }
+)
+-- fix spelling: just an easier finger roll on 40% keyboard
+vim.keymap.set("n", "<leader>fs", "1z=", { noremap = true, silent = true, desc = "Fix spelling under cursor" })
diff --git a/files/config/nvim/lua/config/autocmds.lua b/files/config/nvim/lua/config/autocmds.lua
deleted file mode 100644
index b5f7062..0000000
--- a/files/config/nvim/lua/config/autocmds.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Autocmds are automatically loaded on the VeryLazy event
--- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--- Add any additional autocmds here
-
-local function augroup(name)
-	return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
-end
-
--- Set comment string for CUE files
-vim.api.nvim_create_autocmd("FileType", {
-	group = augroup("cue"),
-	pattern = { "cue" },
-	callback = function(ev)
-		vim.bo[ev.buf].commentstring = "// %s"
-	end,
-})
diff --git a/files/config/nvim/lua/config/keymaps.lua b/files/config/nvim/lua/config/keymaps.lua
deleted file mode 100644
index 5fc7f2d..0000000
--- a/files/config/nvim/lua/config/keymaps.lua
+++ /dev/null
@@ -1,19 +0,0 @@
--- Keymaps are automatically loaded on the VeryLazy event
--- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
--- Add any additional keymaps here
-
--- C-/ should be comment instead of lazyterm
-vim.keymap.del("n", "<c-/>")
-vim.keymap.set({ "n" }, "<c-/>", "gcc", { remap = true })
-vim.keymap.set({ "v" }, "<c-/>", "gc", { remap = true })
-vim.keymap.set({ "n" }, "<Leader><c-/>", "gcgc", { remap = true })
-vim.keymap.del({ "n" }, "<c-_>")
-vim.keymap.set({ "n" }, "<c-_>", "gcc", { remap = true })
-vim.keymap.set({ "v" }, "<c-_>", "gc", { remap = true })
-vim.keymap.set({ "n" }, "<Leader><c-_>", "gcgc", { remap = true })
-
-vim.keymap.set("n", "<Tab>", "<Space>,", { remap = true })
-vim.keymap.set("n", "zz", "zt", { remap = true })
-
-vim.keymap.set("n", "[d", ":lua vim.diagnostic.goto_prev { float = false }<Enter>", { remap = true })
-vim.keymap.set("n", "]d", ":lua vim.diagnostic.goto_next { float = false }<Enter>", { remap = true })
diff --git a/files/config/nvim/lua/config/lazy.lua b/files/config/nvim/lua/config/lazy.lua
deleted file mode 100644
index 7d70096..0000000
--- a/files/config/nvim/lua/config/lazy.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-if not vim.loop.fs_stat(lazypath) then
-  -- bootstrap lazy.nvim
-  -- stylua: ignore
-  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
-end
-vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-
-require("lazy").setup({
-	spec = {
-		-- add LazyVim and import its plugins
-		{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-		-- extras
-		{ import = "lazyvim.plugins.extras.dap.core" },
-		{ import = "lazyvim.plugins.extras.editor.overseer" },
-		{ import = "lazyvim.plugins.extras.editor.telescope" },
-		{ import = "lazyvim.plugins.extras.formatting.prettier" },
-		{ import = "lazyvim.plugins.extras.lang.go" },
-		{ import = "lazyvim.plugins.extras.lang.json" },
-		{ import = "lazyvim.plugins.extras.lang.markdown" },
-		{ import = "lazyvim.plugins.extras.lang.nix" },
-		{ import = "lazyvim.plugins.extras.lang.rust" },
-		{ import = "lazyvim.plugins.extras.lang.toml" },
-		{ import = "lazyvim.plugins.extras.lang.typescript" },
-		{ import = "lazyvim.plugins.extras.lang.yaml" },
-		{ import = "lazyvim.plugins.extras.lsp.none-ls" },
-		{ import = "lazyvim.plugins.extras.test.core" },
-		{ import = "lazyvim.plugins.extras.ui.edgy" },
-		{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
-		{ import = "lazyvim.plugins.extras.util.gitui" },
-		{ import = "lazyvim.plugins.extras.util.project" },
-		-- plugins
-		{ import = "plugins" },
-	},
-	defaults = {
-		-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-		-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
-		lazy = false,
-		-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-		-- have outdated releases, which may break your Neovim install.
-		version = false, -- always use the latest git commit
-		-- version = "*", -- try installing the latest stable version for plugins that support semver
-	},
-	checker = { enabled = false }, -- automatically check for plugin updates
-	performance = {
-		rtp = {
-			-- disable some rtp plugins
-			disabled_plugins = {
-				"gzip",
-				-- "matchit",
-				-- "matchparen",
-				"netrwPlugin",
-				"tarPlugin",
-				"tohtml",
-				"tutor",
-				"zipPlugin",
-			},
-		},
-	},
-})
diff --git a/files/config/nvim/lua/config/options.lua b/files/config/nvim/lua/config/options.lua
deleted file mode 100644
index 75e6b54..0000000
--- a/files/config/nvim/lua/config/options.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-vim.opt.number = true
-vim.opt.relativenumber = false
-
-vim.g.do_filetype_lua = 1
-vim.g.root_spec = { { ".git", "lua" }, "lsp", "cwd" }
-
-vim.o.autochdir = true
-vim.o.fillchars = "stl: ,stlnc: ,eob:░"
-vim.o.list = false
-vim.o.scrolloff = 7
-vim.o.splitkeep = "screen"
-vim.o.updatetime = 500
-vim.o.timeout = true
-vim.o.timeoutlen = 0
-
--- additional filetypes
-vim.filetype.add({
-	extension = {
-		templ = "templ",
-	},
-})
-
--- AutoCommand OSC7 workaround for tmux
--- see https://github.com/neovim/neovim/issues/21771
-vim.api.nvim_create_autocmd("dirchanged", {
-	pattern = "*",
-	command = 'call chansend(v:stderr, printf("\\033]7;%s\\033", v:event.cwd))',
-})
-
--- (No) Statusline
-
-vim.opt.laststatus = 0
-vim.api.nvim_set_hl(0, "Statusline", { link = "Normal" })
-vim.api.nvim_set_hl(0, "StatuslineNC", { link = "Normal" })
-local line = string.rep("▔", vim.api.nvim_win_get_width(0))
-vim.opt.statusline = "%#WinSeparator#" .. line .. "%*"
diff --git a/files/config/nvim/lua/plugins/coding.lua b/files/config/nvim/lua/plugins/coding.lua
deleted file mode 100644
index b2af23a..0000000
--- a/files/config/nvim/lua/plugins/coding.lua
+++ /dev/null
@@ -1,69 +0,0 @@
-return {
-
-	{
-		"echasnovski/mini.pairs",
-		enabled = false,
-	},
-
-	{
-		"nvim-cmp",
-		dependencies = { "hrsh7th/cmp-emoji" },
-		opts = function(_, opts)
-			local cmp = require("cmp")
-			table.insert(opts.sources, { name = "emoji" })
-
-			opts.view = { docs = { auto_open = false }, entries = { follow_cursor = true } }
-			opts.completion = {
-				autocomplete = false,
-			}
-
-			local winhighlight =
-				"Normal:NoiceCmdlinePopupTitle,FloatBorder:NoiceCmdlinePopupBorder,CursorLine:PMenuSel,Search:Search"
-
-			opts.window = {
-				completion = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-				documentation = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-				preview = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-			}
-
-			-- lua sorting = { comparators = { cmp.config.compare.sort_text, -- this needs to be 1st cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, cmp.config.compare.kind, cmp.config.compare.length, cmp.config.compare.order, } }
-
-			opts.sorting = {
-				priority_weight = 2,
-				comparators = {
-					cmp.config.compare.exact,
-					cmp.config.compare.recently_used,
-					cmp.config.compare.locality,
-					cmp.config.compare.offset,
-					-- cmp.config.compare.scopes,
-					cmp.config.compare.score,
-					cmp.config.compare.kind,
-					-- cmp.config.compare.sort_text,
-					cmp.config.compare.length,
-					cmp.config.compare.order,
-				},
-			}
-
-			return opts
-		end,
-	},
-
-	{
-		"Exafunction/codeium.nvim",
-		opts = {
-			enable_chat = false,
-		},
-	},
-
-	{
-		"monkoose/neocodeium",
-		event = "VeryLazy",
-		config = function()
-			local neocodeium = require("neocodeium")
-			neocodeium.setup()
-			vim.keymap.set("i", "<C-j>", neocodeium.accept)
-			vim.keymap.set("i", "<A-f>", neocodeium.accept)
-			vim.keymap.set("i", "<C-h>", neocodeium.cycle_or_complete)
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/colorscheme.lua b/files/config/nvim/lua/plugins/colorscheme.lua
deleted file mode 100644
index 738a94e..0000000
--- a/files/config/nvim/lua/plugins/colorscheme.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-return {
-	{
-		"https://patagia.dev/patagia/dieter.nvim.git",
-		lazy = false,
-		priority = 1000,
-	},
-
-	{
-		"LazyVim/LazyVim",
-		opts = {
-			colorscheme = "dieter",
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/editor.lua b/files/config/nvim/lua/plugins/editor.lua
deleted file mode 100644
index eaf6f32..0000000
--- a/files/config/nvim/lua/plugins/editor.lua
+++ /dev/null
@@ -1,100 +0,0 @@
-return {
-	{
-		"folke/flash.nvim",
-		enabled = false,
-	},
-
-	{
-		"telescope.nvim",
-		keys = {
-			{
-				"<Leader><Leader>",
-				function()
-					local telescope = require("telescope")
-					local jj_pick_status, jj_res = pcall(telescope.extensions.jj.files, opts)
-					if jj_pick_status then
-						return
-					end
-					local git_files_status, git_res = pcall(telescope.builtin.git_files, opts)
-					if not git_files_status then
-						error("Could not launch jj/git files: \n" .. jj_res .. "\n" .. git_res)
-					end
-				end,
-				desc = "VCS Files",
-			},
-			{
-				"<C-p>",
-				"<cmd>Telescope projects<cr>",
-				desc = "Projects",
-			},
-		},
-		opts = function(_, opts)
-			local actions = require("telescope.actions")
-			opts.defaults = {
-				layout_strategy = "horizontal",
-				layout_config = {
-					anchor = "top",
-					horizontal = {
-						prompt_position = "top",
-						mirror = false,
-						preview_width = 0.49,
-						-- preview_height = 0.5,
-					},
-					width = 0.99,
-					height = 0.9,
-					preview_cutoff = 10,
-				},
-				mappings = {
-					i = {
-						["<esc>"] = actions.close, -- <Esc> close popup
-						["<C-u>"] = false, -- <C-u> clear prompt
-						["<C-w>"] = false, -- <C-u> clear prompt
-					},
-				},
-				path_display = { "filename_first" },
-				-- previewer = false,
-				preview = {
-					-- hide_on_startup = true,
-				},
-				sorting_strategy = "ascending",
-				winblend = 0,
-				wrap_results = true,
-			}
-		end,
-	},
-
-	{ "avm99963/vim-jjdescription", lazy = false },
-
-	{
-		"zschreur/telescope-jj.nvim",
-		keys = {
-			{
-				"<Leader>jc",
-				function()
-					require("telescope").extensions.jj.conflicts()
-				end,
-				desc = "jj conflicts",
-			},
-			{
-				"<Leader>jd",
-				function()
-					require("telescope").extensions.jj.diff()
-				end,
-				desc = "jj diffs",
-			},
-			{
-				"<Leader>jf",
-				function()
-					require("telescope").extensions.jj.files()
-				end,
-				desc = "jj files",
-			},
-		},
-		config = function()
-			LazyVim.on_load("telescope.nvim", function()
-				local telescope = require("telescope")
-				telescope.load_extension("jj")
-			end)
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/extras.lua b/files/config/nvim/lua/plugins/extras.lua
deleted file mode 100644
index 79d1a52..0000000
--- a/files/config/nvim/lua/plugins/extras.lua
+++ /dev/null
@@ -1,99 +0,0 @@
-return {
-	{
-		"direnv/direnv.vim",
-		lazy = false,
-		priority = 900,
-		config = function()
-			vim.g.direnv_silent_load = 1
-		end,
-	},
-
-	{
-		"nvimtools/none-ls.nvim",
-		opts = function(_, opts)
-			local nls = require("null-ls")
-			opts.root_dir = opts.root_dir
-				or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
-			opts.sources = vim.list_extend(opts.sources or {}, {
-				nls.builtins.formatting.mdformat,
-				nls.builtins.formatting.stylua,
-				nls.builtins.formatting.shfmt,
-				nls.builtins.formatting.buf,
-				nls.builtins.formatting.buildifier,
-				nls.builtins.diagnostics.buildifier,
-				nls.builtins.diagnostics.buf.with({
-					args = { "lint", "--disable-symlinks", "--path", "$FILENAME" },
-					cwd = function()
-						local file_dir = vim.fn.expand("%:p:h") .. ";"
-						local buf_yaml = vim.fn.findfile("buf.yaml", file_dir)
-						if buf_yaml then
-							return vim.fn.fnamemodify(buf_yaml, ":h")
-						end
-					end,
-				}),
-			})
-		end,
-	},
-
-	{
-		"nvim-neo-tree/neo-tree.nvim",
-		opts = {
-			window = {
-				width = 30,
-				position = "right",
-			},
-		},
-	},
-
-	{
-		"simrat39/rust-tools.nvim",
-		enabled = false,
-	},
-
-	{
-		"mrcjkb/rustaceanvim",
-		version = "^4", -- Recommended
-		ft = { "rust" },
-		opts = {
-			server = {
-				on_attach = function(_, bufnr)
-					vim.keymap.set("n", "<leader>cR", function()
-						vim.cmd.RustLsp("codeAction")
-					end, { desc = "Code Action", buffer = bufnr })
-					vim.keymap.set("n", "<leader>dr", function()
-						vim.cmd.RustLsp("debuggables")
-					end, { desc = "Rust debuggables", buffer = bufnr })
-					vim.keymap.set("n", "<leader>cD", function()
-						vim.cmd.RustLsp("externalDocs")
-					end, { desc = "Rust external documentation", buffer = bufnr })
-				end,
-			},
-
-			settings = {
-				-- rust-analyzer language server configuration
-				["rust-analyzer"] = {
-					cargo = {
-						allFeatures = true,
-						loadOutDirsFromCheck = true,
-						runBuildScripts = true,
-						targetDir = true,
-					},
-					-- Add clippy lints for Rust.
-					checkOnSave = {
-						allFeatures = true,
-						command = "clippy",
-						extraArgs = { "--no-deps" },
-					},
-					procMacro = {
-						enable = true,
-						ignored = {
-							["async-trait"] = { "async_trait" },
-							["napi-derive"] = { "napi" },
-							["async-recursion"] = { "async_recursion" },
-						},
-					},
-				},
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/formatting.lua b/files/config/nvim/lua/plugins/formatting.lua
deleted file mode 100644
index f1272ab..0000000
--- a/files/config/nvim/lua/plugins/formatting.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-return {
-	{
-		"stevearc/conform.nvim",
-		opts = {
-			formatters_by_ft = {
-				["cue"] = { { "cue_fmt" } },
-				["html"] = { { "prettierd", "prettier" } },
-				["nix"] = { "nixfmt" },
-				["sass"] = { { "prettierd", "prettier" } },
-				["proto"] = { { "buf" } },
-				["terraform"] = { { "terraform_fmt" } },
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/incline.lua b/files/config/nvim/lua/plugins/incline.lua
deleted file mode 100644
index c594785..0000000
--- a/files/config/nvim/lua/plugins/incline.lua
+++ /dev/null
@@ -1,72 +0,0 @@
-return {
-	"b0o/incline.nvim",
-	config = function()
-		local devicons = require("nvim-web-devicons")
-		require("incline").setup({
-			window = {
-				margin = {
-					horizontal = 0,
-					vertical = 0,
-				},
-				padding = 0,
-				placement = {
-					horizontal = "right",
-					vertical = "bottom",
-				},
-			},
-			render = function(props)
-				local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
-				if filename == "" then
-					filename = "[No Name]"
-				end
-				local ft_icon, ft_color = devicons.get_icon_color(filename)
-
-				local function get_git_diff()
-					local icons = { removed = " ", changed = " ", added = " " }
-					local signs = vim.b[props.buf].gitsigns_status_dict
-					local labels = {}
-					if signs == nil then
-						return labels
-					end
-					for name, icon in pairs(icons) do
-						if tonumber(signs[name]) and signs[name] > 0 then
-							table.insert(labels, { icon .. signs[name] .. " ", group = "Diff" .. name })
-						end
-					end
-					if #labels > 0 then
-						table.insert(labels, { "│ " })
-					end
-					return labels
-				end
-
-				local function get_diagnostic_label()
-					local icons = { error = " ", warn = " ", info = " ", hint = " " }
-					local label = {}
-
-					for severity, icon in pairs(icons) do
-						local n = #vim.diagnostic.get(
-							props.buf,
-							{ severity = vim.diagnostic.severity[string.upper(severity)] }
-						)
-						if n > 0 then
-							table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity })
-						end
-					end
-					if #label > 0 then
-						table.insert(label, { "│ " })
-					end
-					return label
-				end
-
-				return {
-					{ "  " },
-					{ get_diagnostic_label() },
-					{ get_git_diff() },
-					{ filename, group = "Label" },
-					{ "  " },
-				}
-			end,
-		})
-	end,
-	event = "VeryLazy",
-}
diff --git a/files/config/nvim/lua/plugins/lsp.lua b/files/config/nvim/lua/plugins/lsp.lua
deleted file mode 100644
index f317693..0000000
--- a/files/config/nvim/lua/plugins/lsp.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-return {
-	{
-		"neovim/nvim-lspconfig",
-		opts = {
-			diagnostics = {
-				virtual_text = false,
-			},
-			inlay_hints = { enabled = false },
-			-- codelens = {
-			-- 	enabled = true,
-			-- },
-			servers = {
-				nil_ls = {},
-				nixd = {},
-				starpls = {},
-				yamlls = {
-					settings = {
-						yaml = {
-							schemas = {
-								-- kubernetes = "*.yaml",
-								["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
-								["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
-								["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
-								["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
-								["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
-								["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
-								["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.1/all.json"] = "/*.yaml",
-							},
-						},
-					},
-				},
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/treesitter.lua b/files/config/nvim/lua/plugins/treesitter.lua
deleted file mode 100644
index 0aea1c4..0000000
--- a/files/config/nvim/lua/plugins/treesitter.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-return {
-	{
-		"nvim-treesitter/nvim-treesitter-context",
-		opts = {
-			enable = false,
-		},
-	},
-
-	{
-		"nvim-treesitter/nvim-treesitter",
-		opts = function(_, opts)
-			vim.list_extend(opts.ensure_installed, {
-				"bash",
-				"c",
-				"diff",
-				"go",
-				"html",
-				"javascript",
-				"jsdoc",
-				"json",
-				"jsonc",
-				"lua",
-				"luadoc",
-				"luap",
-				"markdown",
-				"markdown_inline",
-				"python",
-				"query",
-				"regex",
-				"rust",
-				"toml",
-				"tsx",
-				"typescript",
-				"vim",
-				"vimdoc",
-				"xml",
-				"yaml",
-			})
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/ui.lua b/files/config/nvim/lua/plugins/ui.lua
deleted file mode 100644
index 7645a72..0000000
--- a/files/config/nvim/lua/plugins/ui.lua
+++ /dev/null
@@ -1,130 +0,0 @@
-return {
-	{
-		"nvimdev/dashboard-nvim",
-		enabled = false,
-	},
-
-	{
-		"dgagn/diagflow.nvim",
-		-- event = 'LspAttach', This is what I use personnally and it works great
-		opts = {
-			scope = "line",
-			gap_size = 0,
-			max_width = 50,
-			max_height = 20,
-			show_borders = true,
-			toggle_event = { "InsertEnter", "InsertLeave" },
-		},
-	},
-
-	{
-		"akinsho/bufferline.nvim",
-		enabled = false,
-	},
-
-	{
-		"echasnovski/mini.indentscope",
-		enabled = false,
-	},
-
-	{
-		"lukas-reineke/indent-blankline.nvim",
-		enabled = false,
-	},
-
-	{ "nvimdev/indentmini.nvim", opts = { char = "│" } },
-
-	{
-		"mvllow/modes.nvim",
-		opts = {
-			colors = {
-				copy = "#f5c359",
-				delete = "#c75c6a",
-				insert = "#ffcc00",
-				visual = "#c343fc",
-			},
-			set_cursor = true,
-			set_cursorline = true,
-			set_number = true,
-		},
-	},
-
-	{
-		"folke/noice.nvim",
-		event = "VeryLazy",
-		keys = {
-			{ "<leader>sna", "<cmd>NoiceTelescope<cr>", desc = "Show all messages in Telescope" },
-		},
-		opts = function()
-			local enable_conceal = true -- Hide command text if true
-			return {
-				presets = { bottom_search = true }, -- The kind of popup used for /
-				cmdline = {
-					view = "cmdline", -- The kind of popup used for :
-					format = {
-						cmdline = { conceal = enable_conceal },
-						search_down = { conceal = enable_conceal },
-						search_up = { conceal = enable_conceal },
-						filter = { conceal = enable_conceal },
-						lua = { conceal = enable_conceal },
-						help = { conceal = enable_conceal },
-						input = { conceal = enable_conceal },
-					},
-				},
-
-				messages = { enabled = true, view = "mini" },
-				lsp = {
-					hover = { enabled = false },
-					signature = { enabled = false },
-					progress = { enabled = true, view = "cmdline" },
-					message = { enabled = false },
-					smart_move = { enabled = false },
-				},
-			}
-		end,
-	},
-
-	{
-		"rcarriga/nvim-notify",
-		opts = {
-			timeout = 1000,
-			render = "wrapped-compact",
-			top_down = false,
-			max_width = function()
-				return math.floor(vim.o.columns * 0.5)
-			end,
-			on_open = function(win)
-				vim.api.nvim_win_set_config(win, {
-					focusable = false,
-					zindex = 100,
-				})
-			end,
-		},
-	},
-
-	{
-		"nvim-lualine/lualine.nvim",
-		enabled = false,
-	},
-
-	{
-		"DrKJeff16/project.nvim",
-		config = function(_, opts)
-			if vim.fn.argv()[1] == nil then
-				require("project_nvim").setup(opts) -- Workaround for project.nvim not setting up
-				vim.schedule(function()
-					vim.cmd("Telescope projects")
-				end)
-			end
-		end,
-		opts = {
-			exclude_dirs = {
-				"~/.cargo/*",
-				"~/.config/*",
-				"/tmp/*",
-			},
-			manual_mode = false,
-			patterns = { ".git", ".jj" },
-		},
-	},
-}
diff --git a/flake.lock b/flake.lock
index ef8d639..865246b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -29,11 +29,11 @@
         "zig": "zig"
       },
       "locked": {
-        "lastModified": 1729600492,
-        "narHash": "sha256-lQ1oSHfNRvveB9YEMetEFl6a8Tpb6cQkMtSQKAYBLMQ=",
+        "lastModified": 1730568249,
+        "narHash": "sha256-+yyQ2ORHK61Q69mu9/fILlHmrPd3Es8zUTnqlwiMy3o=",
         "ref": "refs/heads/main",
-        "rev": "5e001fcb64deeee69b92a03a51d05a21b09153bd",
-        "revCount": 7763,
+        "rev": "d47df211b03894427592851b0be3b528ff8221ff",
+        "revCount": 7864,
         "type": "git",
         "url": "ssh://git@github.com/ghostty-org/ghostty"
       },
@@ -64,11 +64,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1729551526,
-        "narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
+        "lastModified": 1730490306,
+        "narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
+        "rev": "1743615b61c7285976f85b303a36cdf88a556503",
         "type": "github"
       },
       "original": {
@@ -79,11 +79,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1729413321,
-        "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
+        "lastModified": 1730200266,
+        "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
+        "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
         "type": "github"
       },
       "original": {
@@ -95,11 +95,11 @@
     },
     "nixpkgs-stable": {
       "locked": {
-        "lastModified": 1729449015,
-        "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
+        "lastModified": 1730327045,
+        "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "89172919243df199fe237ba0f776c3e3e3d72367",
+        "rev": "080166c15633801df010977d9d7474b4a6c549d7",
         "type": "github"
       },
       "original": {
diff --git a/home/common/default.nix b/home/common/default.nix
index 0697d99..3a2a686 100644
--- a/home/common/default.nix
+++ b/home/common/default.nix
@@ -9,7 +9,7 @@
     ./gnome.nix
     ./k8s.nix
     ./nix.nix
-    ./nvim.nix
+    ./nvim
     ./scripts.nix
     ./ssh.nix
     ./tmux.nix
diff --git a/home/common/nvim.nix b/home/common/nvim.nix
deleted file mode 100644
index 9e65aaf..0000000
--- a/home/common/nvim.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ ... }:
-{
-  programs.neovim = {
-    enable = true;
-    defaultEditor = true;
-    viAlias = true;
-    vimAlias = true;
-    withNodeJs = false;
-    withPython3 = false;
-    withRuby = false;
-  };
-
-  xdg.configFile = {
-    "nvim" = {
-      recursive = true;
-      source = ./../../files/config/nvim;
-    };
-  };
-}
diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix
new file mode 100644
index 0000000..91d22e5
--- /dev/null
+++ b/home/common/nvim/default.nix
@@ -0,0 +1,125 @@
+{ lib, pkgs, ... }:
+{
+  home.file.".config/nvim/.vimrc".source = ../../../files/config/nvim/.vimrc;
+
+  home.activation.mkdirNvimFolders = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
+    mkdir -p $HOME/.config/nvim/backups $HOME/.config/nvim/swaps $HOME/.config/nvim/undo
+  '';
+
+  programs.neovim = {
+    enable        = true;
+    defaultEditor = true;
+    viAlias       = true;
+    vimAlias      = true;
+    withNodeJs    = false;
+    withPython3   = false;
+    withRuby      = false;
+
+    extraLuaConfig = lib.fileContents ../../../files/config/nvim/init.lua;
+    extraPackages = with pkgs; [
+      black
+      go
+      gopls
+      gotools
+      lua-language-server
+      nil
+      nixd
+      nodePackages.prettier
+      nodePackages.typescript 
+      nodePackages.typescript-language-server
+      nodePackages.bash-language-server 
+      rust-analyzer
+      shellcheck
+      shfmt
+      stylua
+      tree-sitter
+      tree-sitter-grammars.tree-sitter-bash
+      tree-sitter-grammars.tree-sitter-yaml
+      tree-sitter-grammars.tree-sitter-go
+      tree-sitter-grammars.tree-sitter-markdown
+      tree-sitter-grammars.tree-sitter-lua
+      tree-sitter-grammars.tree-sitter-html
+      tree-sitter-grammars.tree-sitter-vim
+      tree-sitter-grammars.tree-sitter-nix
+      vscode-langservers-extracted
+    ];
+
+
+    plugins = with pkgs.vimPlugins; [
+      go-nvim
+      rustaceanvim
+      targets-vim 
+
+      {
+        plugin = pkgs.vimUtils.buildVimPlugin {
+          name = "dieter-nvim";
+          src = pkgs.fetchgit {
+            url = "https://patagia.dev/Patagia/dieter.nvim.git";
+            rev = "08fae6ffec4ae70ba6b2e1cafa780ff317ef0b61";
+            hash = "sha256-C+Vo2SUVfNMkBwuLWqLoA59Pmy9aFwur7fBpfVkLm6Q=";
+          };
+        };
+        type = "lua";
+        config = ''
+          vim.cmd.colorscheme "dieter"
+        '';
+      }
+
+      {
+        plugin = nvim-treesitter.withAllGrammars; # Treesitter
+        type = "lua";
+        config = ''
+          require'nvim-treesitter.configs'.setup {
+            highlight = { enable = true, },
+            indent = { enable = true },
+          }
+        '';
+      }
+
+      {
+        plugin = pkgs.vimUtils.buildVimPlugin {
+          name = "nvim-tree-pairs"; # make % match in TS
+          src = pkgs.fetchFromGitHub {
+            owner = "yorickpeterse";
+            repo = "nvim-tree-pairs";
+            rev = "e7f7b6cc28dda6f3fa271ce63b0d371d5b7641da";
+            hash = "sha256-fb4EsrWAbm8+dWAhiirCPuR44MEg+KYb9hZOIuEuT24=";
+          };
+        };
+        type = "lua";
+        config = "require('tree-pairs').setup()";
+      }
+
+      {
+        plugin = nvim-treesitter-textobjects; # helix-style selection of TS tree
+        type = "lua";
+        config = ''
+          require'nvim-treesitter.configs'.setup {
+            incremental_selection = {
+              enable = true,
+              keymaps = {
+                init_selection = "<M-o>",
+                scope_incremental = "<M-O>",
+                node_incremental = "<M-o>",
+                node_decremental = "<M-i>",
+              },
+            },
+          }
+        '';
+      }
+
+      {
+        plugin = mini-nvim;
+        type = "lua";
+        config = lib.fileContents ./mini.lua;
+      }
+
+      {
+        plugin = nvim-lspconfig; # Interface for LSPs
+        type = "lua";
+        config = lib.fileContents ./lsp.lua;
+      }
+    ];
+  };
+
+}
diff --git a/home/common/nvim/lsp.lua b/home/common/nvim/lsp.lua
new file mode 100644
index 0000000..c2ae113
--- /dev/null
+++ b/home/common/nvim/lsp.lua
@@ -0,0 +1,91 @@
+vim.keymap.set("n", "<space>d", vim.diagnostic.setloclist, { desc = "Add buffer diagnostics to the location list." })
+
+vim.api.nvim_create_autocmd("LspAttach", {
+	group = vim.api.nvim_create_augroup("UserLspConfig", {}),
+	callback = function(ev)
+		-- Enable completion triggered by <c-x><c-o>
+		vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
+
+		-- Buffer local mappings.
+		-- See `:help vim.lsp.*` for documentation on any of the below functions
+		local opts = function(str)
+			return { buffer = ev.buf, desc = str }
+		end
+
+		local client = vim.lsp.get_client_by_id(ev.data.client_id)
+		if client.server_capabilities.codeLensProvider then
+			vim.lsp.codelens.refresh({ bufnr = bufnr })
+		end
+
+		vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
+		vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
+		vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
+
+		vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts("Declaration"))
+		vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts("Definition"))
+		vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts("Implementation"))
+		vim.keymap.set("n", "<M-k>", vim.lsp.buf.signature_help, opts("Signature Help"))
+		vim.keymap.set("i", "<M-k>", vim.lsp.buf.signature_help, opts("Signature Help"))
+		vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts("Add Workspace Folder"))
+		vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts("Remove Workspace Folder"))
+		vim.keymap.set("n", "<space>wl", function()
+			print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
+		end, opts("List Workspace Folders"))
+		vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts("Type Definition"))
+		vim.keymap.set("n", "<space>r", vim.lsp.buf.rename, opts("Rename Symbol"))
+		vim.keymap.set({ "n", "v" }, "<space>a", vim.lsp.buf.code_action, opts("Code Action"))
+		vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("Buffer References"))
+		vim.keymap.set("n", "<localleader>f", function()
+			vim.lsp.buf.format({ async = true })
+		end, opts("Format Buffer"))
+	end,
+})
+
+local lspconfig = require("lspconfig")
+local capabilities = vim.lsp.protocol.make_client_capabilities()
+
+local servers = {
+  'gopls',
+  'nil_ls',
+  'ts_ls',
+}
+
+for _, ls in ipairs(servers) do
+  lspconfig[ls].setup {
+    capabilities = capabilities,
+    on_attach = function(_, buf)
+      vim.api.nvim_set_option_value('omnifunc', 'v:lua.MiniCompletion.completefunc_lsp', {buf = buf})
+    end,
+  }
+end
+
+lspconfig.nixd.setup({
+  capabilities = capabilities,
+	cmd = { "nixd" },
+	settings = {
+		nixd = {
+			nixpkgs = { expr = "import <nixpkgs> { }" },
+			formatting = { command = { "nixfmt" } },
+			options = {},
+		},
+	},
+})
+
+lspconfig.lua_ls.setup({
+  capabilities = capabilities,
+	settings = {
+		Lua = {
+			runtime = {
+				version = "LuaJIT",
+				path = vim.split(package.path, ";"),
+			},
+			diagnostics = { globals = { "vim", "hs" } },
+			workspace = {
+				library = {
+					[vim.fn.expand("$VIMRUNTIME/lua")] = true,
+					[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
+				},
+			},
+		},
+	},
+})
diff --git a/home/common/nvim/mini.lua b/home/common/nvim/mini.lua
new file mode 100644
index 0000000..6d9fb19
--- /dev/null
+++ b/home/common/nvim/mini.lua
@@ -0,0 +1,114 @@
+          local opts = function(label)
+            return {noremap = true, silent = true, desc = label}
+          end
+          require('mini.ai').setup()
+          require('mini.align').setup()
+          require('mini.bracketed').setup()
+          require('mini.completion').setup()
+          require('mini.diff').setup()
+          require('mini.extra').setup()
+          require('mini.icons').setup()
+          require('mini.jump').setup()
+          require('mini.pairs').setup()
+          require('mini.statusline').setup()
+          require('mini.surround').setup()
+          require('mini.splitjoin').setup()
+
+          require('mini.files').setup()
+          local oil_style = function()
+            if not MiniFiles.close() then
+              MiniFiles.open(vim.api.nvim_buf_get_name(0))
+              MiniFiles.reveal_cwd()
+            end
+          end
+          vim.keymap.set('n', '-', oil_style, opts("File Explorer"));
+
+          local hipatterns = require('mini.hipatterns')
+          hipatterns.setup({  -- highlight strings and colors
+            highlighters = {
+              -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
+              fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
+              hack  = { pattern = '%f[%w]()HACK()%f[%W]',  group = 'MiniHipatternsHack'  },
+              todo  = { pattern = '%f[%w]()TODO()%f[%W]',  group = 'MiniHipatternsTodo'  },
+              note  = { pattern = '%f[%w]()NOTE()%f[%W]',  group = 'MiniHipatternsNote'  },
+
+              -- Highlight hex color strings (`#rrggbb`) using that color
+              hex_color = hipatterns.gen_highlighter.hex_color(),
+            }
+          })
+
+          require('mini.jump2d').setup({
+            mappings = {
+              start_jumping = 'gw'
+            }
+          })
+
+          require('mini.pick').setup()
+          MiniPick.registry.files_root = function(local_opts)
+            local root_patterns = { ".jj" }
+            local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1])
+            local opts = { source = { cwd = root_dir } }
+            local_opts.cwd = root_dir -- nil?
+            return MiniPick.builtin.files(local_opts, opts)
+          end
+          vim.keymap.set('n', '<space>/', "<cmd>Pick grep_live<cr>", opts("Live Grep"))
+          vim.keymap.set('n', '<space>F', "<cmd>Pick files tool='git'<cr>", opts("Find Files in CWD"))
+          vim.keymap.set('n', '<space>ff', "<cmd>Pick files<cr>", opts("Find Files"))
+          vim.keymap.set('n', '<space>fr', "<cmd>Pick oldfiles<cr>", opts("Recent Files"))
+          vim.keymap.set('n', '<space>b', "<cmd>Pick buffers<cr>", opts("Buffers"))
+          vim.keymap.set('n', '<tab>', "<cmd>Pick buffers<cr>", opts("Buffers"))
+          vim.keymap.set('n', "<space>'", "<cmd>Pick resume<cr>", opts("Last Picker"))
+          vim.keymap.set('n', "<space>g", "<cmd>Pick git_commits<cr>", opts("Git Commits"))
+
+
+          local miniclue = require('mini.clue')
+          miniclue.setup({                   -- cute prompts about bindings
+            triggers = {
+              { mode = 'n', keys = '<Leader>' },
+              { mode = 'x', keys = '<Leader>' },
+              { mode = 'n', keys = '<space>' },
+              { mode = 'x', keys = '<space>' },
+
+              -- Built-in completion
+              { mode = 'i', keys = '<C-x>' },
+
+              -- `g` key
+              { mode = 'n', keys = 'g' },
+              { mode = 'x', keys = 'g' },
+
+              -- Marks
+              { mode = 'n', keys = "'" },
+              { mode = 'n', keys = '`' },
+              { mode = 'x', keys = "'" },
+              { mode = 'x', keys = '`' },
+
+              -- Registers
+              { mode = 'n', keys = '"' },
+              { mode = 'x', keys = '"' },
+              { mode = 'i', keys = '<C-r>' },
+              { mode = 'c', keys = '<C-r>' },
+
+              -- Window commands
+              { mode = 'n', keys = '<C-w>' },
+
+              -- `z` key
+              { mode = 'n', keys = 'z' },
+              { mode = 'x', keys = 'z' },
+
+              -- Bracketed
+              { mode = 'n', keys = '[' },
+              { mode = 'n', keys = ']' },
+            },
+            clues = {
+              miniclue.gen_clues.builtin_completion(),
+              miniclue.gen_clues.g(),
+              miniclue.gen_clues.marks(),
+              miniclue.gen_clues.registers(),
+              miniclue.gen_clues.windows(),
+              miniclue.gen_clues.z(),
+            },
+            window = {
+              delay = 15,
+            }
+          })
+

From ef5ec33e4ffc307bd84ae3251d78cc602b07c177 Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Sun, 6 Oct 2024 23:00:01 +0200
Subject: [PATCH 2/2] WIP: nvim: Experimental minimized setup

---
 files/config/nvim/init.lua                    |   2 -
 files/config/nvim/lua/config/autocmds.lua     |  16 ---
 files/config/nvim/lua/config/keymaps.lua      |  19 ---
 files/config/nvim/lua/config/lazy.lua         |  60 --------
 files/config/nvim/lua/config/options.lua      |  36 -----
 files/config/nvim/lua/plugins/coding.lua      |  69 ----------
 files/config/nvim/lua/plugins/colorscheme.lua |  14 --
 files/config/nvim/lua/plugins/editor.lua      | 100 --------------
 files/config/nvim/lua/plugins/extras.lua      |  99 -------------
 files/config/nvim/lua/plugins/formatting.lua  |  15 --
 files/config/nvim/lua/plugins/incline.lua     |  72 ----------
 files/config/nvim/lua/plugins/lsp.lua         |  35 -----
 files/config/nvim/lua/plugins/treesitter.lua  |  41 ------
 files/config/nvim/lua/plugins/ui.lua          | 130 ------------------
 flake.lock                                    |  26 ++--
 home/common/default.nix                       |   2 +-
 home/common/nvim.nix                          |  19 ---
 home/common/nvim/default.nix                  | 118 ++++++++++++++++
 home/common/nvim/init.lua                     |  93 +++++++++++++
 home/common/nvim/lsp.lua                      |  91 ++++++++++++
 home/common/nvim/mini.lua                     | 129 +++++++++++++++++
 home/common/utils.nix                         |   2 +
 22 files changed, 447 insertions(+), 741 deletions(-)
 delete mode 100644 files/config/nvim/init.lua
 delete mode 100644 files/config/nvim/lua/config/autocmds.lua
 delete mode 100644 files/config/nvim/lua/config/keymaps.lua
 delete mode 100644 files/config/nvim/lua/config/lazy.lua
 delete mode 100644 files/config/nvim/lua/config/options.lua
 delete mode 100644 files/config/nvim/lua/plugins/coding.lua
 delete mode 100644 files/config/nvim/lua/plugins/colorscheme.lua
 delete mode 100644 files/config/nvim/lua/plugins/editor.lua
 delete mode 100644 files/config/nvim/lua/plugins/extras.lua
 delete mode 100644 files/config/nvim/lua/plugins/formatting.lua
 delete mode 100644 files/config/nvim/lua/plugins/incline.lua
 delete mode 100644 files/config/nvim/lua/plugins/lsp.lua
 delete mode 100644 files/config/nvim/lua/plugins/treesitter.lua
 delete mode 100644 files/config/nvim/lua/plugins/ui.lua
 delete mode 100644 home/common/nvim.nix
 create mode 100644 home/common/nvim/default.nix
 create mode 100644 home/common/nvim/init.lua
 create mode 100644 home/common/nvim/lsp.lua
 create mode 100644 home/common/nvim/mini.lua

diff --git a/files/config/nvim/init.lua b/files/config/nvim/init.lua
deleted file mode 100644
index 2514f9e..0000000
--- a/files/config/nvim/init.lua
+++ /dev/null
@@ -1,2 +0,0 @@
--- bootstrap lazy.nvim, LazyVim and your plugins
-require("config.lazy")
diff --git a/files/config/nvim/lua/config/autocmds.lua b/files/config/nvim/lua/config/autocmds.lua
deleted file mode 100644
index b5f7062..0000000
--- a/files/config/nvim/lua/config/autocmds.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Autocmds are automatically loaded on the VeryLazy event
--- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--- Add any additional autocmds here
-
-local function augroup(name)
-	return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
-end
-
--- Set comment string for CUE files
-vim.api.nvim_create_autocmd("FileType", {
-	group = augroup("cue"),
-	pattern = { "cue" },
-	callback = function(ev)
-		vim.bo[ev.buf].commentstring = "// %s"
-	end,
-})
diff --git a/files/config/nvim/lua/config/keymaps.lua b/files/config/nvim/lua/config/keymaps.lua
deleted file mode 100644
index 5fc7f2d..0000000
--- a/files/config/nvim/lua/config/keymaps.lua
+++ /dev/null
@@ -1,19 +0,0 @@
--- Keymaps are automatically loaded on the VeryLazy event
--- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
--- Add any additional keymaps here
-
--- C-/ should be comment instead of lazyterm
-vim.keymap.del("n", "<c-/>")
-vim.keymap.set({ "n" }, "<c-/>", "gcc", { remap = true })
-vim.keymap.set({ "v" }, "<c-/>", "gc", { remap = true })
-vim.keymap.set({ "n" }, "<Leader><c-/>", "gcgc", { remap = true })
-vim.keymap.del({ "n" }, "<c-_>")
-vim.keymap.set({ "n" }, "<c-_>", "gcc", { remap = true })
-vim.keymap.set({ "v" }, "<c-_>", "gc", { remap = true })
-vim.keymap.set({ "n" }, "<Leader><c-_>", "gcgc", { remap = true })
-
-vim.keymap.set("n", "<Tab>", "<Space>,", { remap = true })
-vim.keymap.set("n", "zz", "zt", { remap = true })
-
-vim.keymap.set("n", "[d", ":lua vim.diagnostic.goto_prev { float = false }<Enter>", { remap = true })
-vim.keymap.set("n", "]d", ":lua vim.diagnostic.goto_next { float = false }<Enter>", { remap = true })
diff --git a/files/config/nvim/lua/config/lazy.lua b/files/config/nvim/lua/config/lazy.lua
deleted file mode 100644
index 7d70096..0000000
--- a/files/config/nvim/lua/config/lazy.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-if not vim.loop.fs_stat(lazypath) then
-  -- bootstrap lazy.nvim
-  -- stylua: ignore
-  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
-end
-vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-
-require("lazy").setup({
-	spec = {
-		-- add LazyVim and import its plugins
-		{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-		-- extras
-		{ import = "lazyvim.plugins.extras.dap.core" },
-		{ import = "lazyvim.plugins.extras.editor.overseer" },
-		{ import = "lazyvim.plugins.extras.editor.telescope" },
-		{ import = "lazyvim.plugins.extras.formatting.prettier" },
-		{ import = "lazyvim.plugins.extras.lang.go" },
-		{ import = "lazyvim.plugins.extras.lang.json" },
-		{ import = "lazyvim.plugins.extras.lang.markdown" },
-		{ import = "lazyvim.plugins.extras.lang.nix" },
-		{ import = "lazyvim.plugins.extras.lang.rust" },
-		{ import = "lazyvim.plugins.extras.lang.toml" },
-		{ import = "lazyvim.plugins.extras.lang.typescript" },
-		{ import = "lazyvim.plugins.extras.lang.yaml" },
-		{ import = "lazyvim.plugins.extras.lsp.none-ls" },
-		{ import = "lazyvim.plugins.extras.test.core" },
-		{ import = "lazyvim.plugins.extras.ui.edgy" },
-		{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
-		{ import = "lazyvim.plugins.extras.util.gitui" },
-		{ import = "lazyvim.plugins.extras.util.project" },
-		-- plugins
-		{ import = "plugins" },
-	},
-	defaults = {
-		-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-		-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
-		lazy = false,
-		-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-		-- have outdated releases, which may break your Neovim install.
-		version = false, -- always use the latest git commit
-		-- version = "*", -- try installing the latest stable version for plugins that support semver
-	},
-	checker = { enabled = false }, -- automatically check for plugin updates
-	performance = {
-		rtp = {
-			-- disable some rtp plugins
-			disabled_plugins = {
-				"gzip",
-				-- "matchit",
-				-- "matchparen",
-				"netrwPlugin",
-				"tarPlugin",
-				"tohtml",
-				"tutor",
-				"zipPlugin",
-			},
-		},
-	},
-})
diff --git a/files/config/nvim/lua/config/options.lua b/files/config/nvim/lua/config/options.lua
deleted file mode 100644
index 75e6b54..0000000
--- a/files/config/nvim/lua/config/options.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-vim.opt.number = true
-vim.opt.relativenumber = false
-
-vim.g.do_filetype_lua = 1
-vim.g.root_spec = { { ".git", "lua" }, "lsp", "cwd" }
-
-vim.o.autochdir = true
-vim.o.fillchars = "stl: ,stlnc: ,eob:░"
-vim.o.list = false
-vim.o.scrolloff = 7
-vim.o.splitkeep = "screen"
-vim.o.updatetime = 500
-vim.o.timeout = true
-vim.o.timeoutlen = 0
-
--- additional filetypes
-vim.filetype.add({
-	extension = {
-		templ = "templ",
-	},
-})
-
--- AutoCommand OSC7 workaround for tmux
--- see https://github.com/neovim/neovim/issues/21771
-vim.api.nvim_create_autocmd("dirchanged", {
-	pattern = "*",
-	command = 'call chansend(v:stderr, printf("\\033]7;%s\\033", v:event.cwd))',
-})
-
--- (No) Statusline
-
-vim.opt.laststatus = 0
-vim.api.nvim_set_hl(0, "Statusline", { link = "Normal" })
-vim.api.nvim_set_hl(0, "StatuslineNC", { link = "Normal" })
-local line = string.rep("▔", vim.api.nvim_win_get_width(0))
-vim.opt.statusline = "%#WinSeparator#" .. line .. "%*"
diff --git a/files/config/nvim/lua/plugins/coding.lua b/files/config/nvim/lua/plugins/coding.lua
deleted file mode 100644
index b2af23a..0000000
--- a/files/config/nvim/lua/plugins/coding.lua
+++ /dev/null
@@ -1,69 +0,0 @@
-return {
-
-	{
-		"echasnovski/mini.pairs",
-		enabled = false,
-	},
-
-	{
-		"nvim-cmp",
-		dependencies = { "hrsh7th/cmp-emoji" },
-		opts = function(_, opts)
-			local cmp = require("cmp")
-			table.insert(opts.sources, { name = "emoji" })
-
-			opts.view = { docs = { auto_open = false }, entries = { follow_cursor = true } }
-			opts.completion = {
-				autocomplete = false,
-			}
-
-			local winhighlight =
-				"Normal:NoiceCmdlinePopupTitle,FloatBorder:NoiceCmdlinePopupBorder,CursorLine:PMenuSel,Search:Search"
-
-			opts.window = {
-				completion = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-				documentation = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-				preview = cmp.config.window.bordered({ winhighlight = winhighlight, border = "rounded" }),
-			}
-
-			-- lua sorting = { comparators = { cmp.config.compare.sort_text, -- this needs to be 1st cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, cmp.config.compare.kind, cmp.config.compare.length, cmp.config.compare.order, } }
-
-			opts.sorting = {
-				priority_weight = 2,
-				comparators = {
-					cmp.config.compare.exact,
-					cmp.config.compare.recently_used,
-					cmp.config.compare.locality,
-					cmp.config.compare.offset,
-					-- cmp.config.compare.scopes,
-					cmp.config.compare.score,
-					cmp.config.compare.kind,
-					-- cmp.config.compare.sort_text,
-					cmp.config.compare.length,
-					cmp.config.compare.order,
-				},
-			}
-
-			return opts
-		end,
-	},
-
-	{
-		"Exafunction/codeium.nvim",
-		opts = {
-			enable_chat = false,
-		},
-	},
-
-	{
-		"monkoose/neocodeium",
-		event = "VeryLazy",
-		config = function()
-			local neocodeium = require("neocodeium")
-			neocodeium.setup()
-			vim.keymap.set("i", "<C-j>", neocodeium.accept)
-			vim.keymap.set("i", "<A-f>", neocodeium.accept)
-			vim.keymap.set("i", "<C-h>", neocodeium.cycle_or_complete)
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/colorscheme.lua b/files/config/nvim/lua/plugins/colorscheme.lua
deleted file mode 100644
index 738a94e..0000000
--- a/files/config/nvim/lua/plugins/colorscheme.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-return {
-	{
-		"https://patagia.dev/patagia/dieter.nvim.git",
-		lazy = false,
-		priority = 1000,
-	},
-
-	{
-		"LazyVim/LazyVim",
-		opts = {
-			colorscheme = "dieter",
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/editor.lua b/files/config/nvim/lua/plugins/editor.lua
deleted file mode 100644
index eaf6f32..0000000
--- a/files/config/nvim/lua/plugins/editor.lua
+++ /dev/null
@@ -1,100 +0,0 @@
-return {
-	{
-		"folke/flash.nvim",
-		enabled = false,
-	},
-
-	{
-		"telescope.nvim",
-		keys = {
-			{
-				"<Leader><Leader>",
-				function()
-					local telescope = require("telescope")
-					local jj_pick_status, jj_res = pcall(telescope.extensions.jj.files, opts)
-					if jj_pick_status then
-						return
-					end
-					local git_files_status, git_res = pcall(telescope.builtin.git_files, opts)
-					if not git_files_status then
-						error("Could not launch jj/git files: \n" .. jj_res .. "\n" .. git_res)
-					end
-				end,
-				desc = "VCS Files",
-			},
-			{
-				"<C-p>",
-				"<cmd>Telescope projects<cr>",
-				desc = "Projects",
-			},
-		},
-		opts = function(_, opts)
-			local actions = require("telescope.actions")
-			opts.defaults = {
-				layout_strategy = "horizontal",
-				layout_config = {
-					anchor = "top",
-					horizontal = {
-						prompt_position = "top",
-						mirror = false,
-						preview_width = 0.49,
-						-- preview_height = 0.5,
-					},
-					width = 0.99,
-					height = 0.9,
-					preview_cutoff = 10,
-				},
-				mappings = {
-					i = {
-						["<esc>"] = actions.close, -- <Esc> close popup
-						["<C-u>"] = false, -- <C-u> clear prompt
-						["<C-w>"] = false, -- <C-u> clear prompt
-					},
-				},
-				path_display = { "filename_first" },
-				-- previewer = false,
-				preview = {
-					-- hide_on_startup = true,
-				},
-				sorting_strategy = "ascending",
-				winblend = 0,
-				wrap_results = true,
-			}
-		end,
-	},
-
-	{ "avm99963/vim-jjdescription", lazy = false },
-
-	{
-		"zschreur/telescope-jj.nvim",
-		keys = {
-			{
-				"<Leader>jc",
-				function()
-					require("telescope").extensions.jj.conflicts()
-				end,
-				desc = "jj conflicts",
-			},
-			{
-				"<Leader>jd",
-				function()
-					require("telescope").extensions.jj.diff()
-				end,
-				desc = "jj diffs",
-			},
-			{
-				"<Leader>jf",
-				function()
-					require("telescope").extensions.jj.files()
-				end,
-				desc = "jj files",
-			},
-		},
-		config = function()
-			LazyVim.on_load("telescope.nvim", function()
-				local telescope = require("telescope")
-				telescope.load_extension("jj")
-			end)
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/extras.lua b/files/config/nvim/lua/plugins/extras.lua
deleted file mode 100644
index 79d1a52..0000000
--- a/files/config/nvim/lua/plugins/extras.lua
+++ /dev/null
@@ -1,99 +0,0 @@
-return {
-	{
-		"direnv/direnv.vim",
-		lazy = false,
-		priority = 900,
-		config = function()
-			vim.g.direnv_silent_load = 1
-		end,
-	},
-
-	{
-		"nvimtools/none-ls.nvim",
-		opts = function(_, opts)
-			local nls = require("null-ls")
-			opts.root_dir = opts.root_dir
-				or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
-			opts.sources = vim.list_extend(opts.sources or {}, {
-				nls.builtins.formatting.mdformat,
-				nls.builtins.formatting.stylua,
-				nls.builtins.formatting.shfmt,
-				nls.builtins.formatting.buf,
-				nls.builtins.formatting.buildifier,
-				nls.builtins.diagnostics.buildifier,
-				nls.builtins.diagnostics.buf.with({
-					args = { "lint", "--disable-symlinks", "--path", "$FILENAME" },
-					cwd = function()
-						local file_dir = vim.fn.expand("%:p:h") .. ";"
-						local buf_yaml = vim.fn.findfile("buf.yaml", file_dir)
-						if buf_yaml then
-							return vim.fn.fnamemodify(buf_yaml, ":h")
-						end
-					end,
-				}),
-			})
-		end,
-	},
-
-	{
-		"nvim-neo-tree/neo-tree.nvim",
-		opts = {
-			window = {
-				width = 30,
-				position = "right",
-			},
-		},
-	},
-
-	{
-		"simrat39/rust-tools.nvim",
-		enabled = false,
-	},
-
-	{
-		"mrcjkb/rustaceanvim",
-		version = "^4", -- Recommended
-		ft = { "rust" },
-		opts = {
-			server = {
-				on_attach = function(_, bufnr)
-					vim.keymap.set("n", "<leader>cR", function()
-						vim.cmd.RustLsp("codeAction")
-					end, { desc = "Code Action", buffer = bufnr })
-					vim.keymap.set("n", "<leader>dr", function()
-						vim.cmd.RustLsp("debuggables")
-					end, { desc = "Rust debuggables", buffer = bufnr })
-					vim.keymap.set("n", "<leader>cD", function()
-						vim.cmd.RustLsp("externalDocs")
-					end, { desc = "Rust external documentation", buffer = bufnr })
-				end,
-			},
-
-			settings = {
-				-- rust-analyzer language server configuration
-				["rust-analyzer"] = {
-					cargo = {
-						allFeatures = true,
-						loadOutDirsFromCheck = true,
-						runBuildScripts = true,
-						targetDir = true,
-					},
-					-- Add clippy lints for Rust.
-					checkOnSave = {
-						allFeatures = true,
-						command = "clippy",
-						extraArgs = { "--no-deps" },
-					},
-					procMacro = {
-						enable = true,
-						ignored = {
-							["async-trait"] = { "async_trait" },
-							["napi-derive"] = { "napi" },
-							["async-recursion"] = { "async_recursion" },
-						},
-					},
-				},
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/formatting.lua b/files/config/nvim/lua/plugins/formatting.lua
deleted file mode 100644
index f1272ab..0000000
--- a/files/config/nvim/lua/plugins/formatting.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-return {
-	{
-		"stevearc/conform.nvim",
-		opts = {
-			formatters_by_ft = {
-				["cue"] = { { "cue_fmt" } },
-				["html"] = { { "prettierd", "prettier" } },
-				["nix"] = { "nixfmt" },
-				["sass"] = { { "prettierd", "prettier" } },
-				["proto"] = { { "buf" } },
-				["terraform"] = { { "terraform_fmt" } },
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/incline.lua b/files/config/nvim/lua/plugins/incline.lua
deleted file mode 100644
index c594785..0000000
--- a/files/config/nvim/lua/plugins/incline.lua
+++ /dev/null
@@ -1,72 +0,0 @@
-return {
-	"b0o/incline.nvim",
-	config = function()
-		local devicons = require("nvim-web-devicons")
-		require("incline").setup({
-			window = {
-				margin = {
-					horizontal = 0,
-					vertical = 0,
-				},
-				padding = 0,
-				placement = {
-					horizontal = "right",
-					vertical = "bottom",
-				},
-			},
-			render = function(props)
-				local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
-				if filename == "" then
-					filename = "[No Name]"
-				end
-				local ft_icon, ft_color = devicons.get_icon_color(filename)
-
-				local function get_git_diff()
-					local icons = { removed = " ", changed = " ", added = " " }
-					local signs = vim.b[props.buf].gitsigns_status_dict
-					local labels = {}
-					if signs == nil then
-						return labels
-					end
-					for name, icon in pairs(icons) do
-						if tonumber(signs[name]) and signs[name] > 0 then
-							table.insert(labels, { icon .. signs[name] .. " ", group = "Diff" .. name })
-						end
-					end
-					if #labels > 0 then
-						table.insert(labels, { "│ " })
-					end
-					return labels
-				end
-
-				local function get_diagnostic_label()
-					local icons = { error = " ", warn = " ", info = " ", hint = " " }
-					local label = {}
-
-					for severity, icon in pairs(icons) do
-						local n = #vim.diagnostic.get(
-							props.buf,
-							{ severity = vim.diagnostic.severity[string.upper(severity)] }
-						)
-						if n > 0 then
-							table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity })
-						end
-					end
-					if #label > 0 then
-						table.insert(label, { "│ " })
-					end
-					return label
-				end
-
-				return {
-					{ "  " },
-					{ get_diagnostic_label() },
-					{ get_git_diff() },
-					{ filename, group = "Label" },
-					{ "  " },
-				}
-			end,
-		})
-	end,
-	event = "VeryLazy",
-}
diff --git a/files/config/nvim/lua/plugins/lsp.lua b/files/config/nvim/lua/plugins/lsp.lua
deleted file mode 100644
index f317693..0000000
--- a/files/config/nvim/lua/plugins/lsp.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-return {
-	{
-		"neovim/nvim-lspconfig",
-		opts = {
-			diagnostics = {
-				virtual_text = false,
-			},
-			inlay_hints = { enabled = false },
-			-- codelens = {
-			-- 	enabled = true,
-			-- },
-			servers = {
-				nil_ls = {},
-				nixd = {},
-				starpls = {},
-				yamlls = {
-					settings = {
-						yaml = {
-							schemas = {
-								-- kubernetes = "*.yaml",
-								["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
-								["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
-								["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
-								["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
-								["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
-								["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
-								["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.1/all.json"] = "/*.yaml",
-							},
-						},
-					},
-				},
-			},
-		},
-	},
-}
diff --git a/files/config/nvim/lua/plugins/treesitter.lua b/files/config/nvim/lua/plugins/treesitter.lua
deleted file mode 100644
index 0aea1c4..0000000
--- a/files/config/nvim/lua/plugins/treesitter.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-return {
-	{
-		"nvim-treesitter/nvim-treesitter-context",
-		opts = {
-			enable = false,
-		},
-	},
-
-	{
-		"nvim-treesitter/nvim-treesitter",
-		opts = function(_, opts)
-			vim.list_extend(opts.ensure_installed, {
-				"bash",
-				"c",
-				"diff",
-				"go",
-				"html",
-				"javascript",
-				"jsdoc",
-				"json",
-				"jsonc",
-				"lua",
-				"luadoc",
-				"luap",
-				"markdown",
-				"markdown_inline",
-				"python",
-				"query",
-				"regex",
-				"rust",
-				"toml",
-				"tsx",
-				"typescript",
-				"vim",
-				"vimdoc",
-				"xml",
-				"yaml",
-			})
-		end,
-	},
-}
diff --git a/files/config/nvim/lua/plugins/ui.lua b/files/config/nvim/lua/plugins/ui.lua
deleted file mode 100644
index 7645a72..0000000
--- a/files/config/nvim/lua/plugins/ui.lua
+++ /dev/null
@@ -1,130 +0,0 @@
-return {
-	{
-		"nvimdev/dashboard-nvim",
-		enabled = false,
-	},
-
-	{
-		"dgagn/diagflow.nvim",
-		-- event = 'LspAttach', This is what I use personnally and it works great
-		opts = {
-			scope = "line",
-			gap_size = 0,
-			max_width = 50,
-			max_height = 20,
-			show_borders = true,
-			toggle_event = { "InsertEnter", "InsertLeave" },
-		},
-	},
-
-	{
-		"akinsho/bufferline.nvim",
-		enabled = false,
-	},
-
-	{
-		"echasnovski/mini.indentscope",
-		enabled = false,
-	},
-
-	{
-		"lukas-reineke/indent-blankline.nvim",
-		enabled = false,
-	},
-
-	{ "nvimdev/indentmini.nvim", opts = { char = "│" } },
-
-	{
-		"mvllow/modes.nvim",
-		opts = {
-			colors = {
-				copy = "#f5c359",
-				delete = "#c75c6a",
-				insert = "#ffcc00",
-				visual = "#c343fc",
-			},
-			set_cursor = true,
-			set_cursorline = true,
-			set_number = true,
-		},
-	},
-
-	{
-		"folke/noice.nvim",
-		event = "VeryLazy",
-		keys = {
-			{ "<leader>sna", "<cmd>NoiceTelescope<cr>", desc = "Show all messages in Telescope" },
-		},
-		opts = function()
-			local enable_conceal = true -- Hide command text if true
-			return {
-				presets = { bottom_search = true }, -- The kind of popup used for /
-				cmdline = {
-					view = "cmdline", -- The kind of popup used for :
-					format = {
-						cmdline = { conceal = enable_conceal },
-						search_down = { conceal = enable_conceal },
-						search_up = { conceal = enable_conceal },
-						filter = { conceal = enable_conceal },
-						lua = { conceal = enable_conceal },
-						help = { conceal = enable_conceal },
-						input = { conceal = enable_conceal },
-					},
-				},
-
-				messages = { enabled = true, view = "mini" },
-				lsp = {
-					hover = { enabled = false },
-					signature = { enabled = false },
-					progress = { enabled = true, view = "cmdline" },
-					message = { enabled = false },
-					smart_move = { enabled = false },
-				},
-			}
-		end,
-	},
-
-	{
-		"rcarriga/nvim-notify",
-		opts = {
-			timeout = 1000,
-			render = "wrapped-compact",
-			top_down = false,
-			max_width = function()
-				return math.floor(vim.o.columns * 0.5)
-			end,
-			on_open = function(win)
-				vim.api.nvim_win_set_config(win, {
-					focusable = false,
-					zindex = 100,
-				})
-			end,
-		},
-	},
-
-	{
-		"nvim-lualine/lualine.nvim",
-		enabled = false,
-	},
-
-	{
-		"DrKJeff16/project.nvim",
-		config = function(_, opts)
-			if vim.fn.argv()[1] == nil then
-				require("project_nvim").setup(opts) -- Workaround for project.nvim not setting up
-				vim.schedule(function()
-					vim.cmd("Telescope projects")
-				end)
-			end
-		end,
-		opts = {
-			exclude_dirs = {
-				"~/.cargo/*",
-				"~/.config/*",
-				"/tmp/*",
-			},
-			manual_mode = false,
-			patterns = { ".git", ".jj" },
-		},
-	},
-}
diff --git a/flake.lock b/flake.lock
index ef8d639..1d1dad0 100644
--- a/flake.lock
+++ b/flake.lock
@@ -29,11 +29,11 @@
         "zig": "zig"
       },
       "locked": {
-        "lastModified": 1729600492,
-        "narHash": "sha256-lQ1oSHfNRvveB9YEMetEFl6a8Tpb6cQkMtSQKAYBLMQ=",
+        "lastModified": 1730688195,
+        "narHash": "sha256-wXK1/gOImxv0vHpUc9qgno1AY8c64j17/UFIiT7zH1g=",
         "ref": "refs/heads/main",
-        "rev": "5e001fcb64deeee69b92a03a51d05a21b09153bd",
-        "revCount": 7763,
+        "rev": "737dc0896dc266a98c889e122b5c900636e589c9",
+        "revCount": 7874,
         "type": "git",
         "url": "ssh://git@github.com/ghostty-org/ghostty"
       },
@@ -64,11 +64,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1729551526,
-        "narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
+        "lastModified": 1730633670,
+        "narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
+        "rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661",
         "type": "github"
       },
       "original": {
@@ -79,11 +79,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1729413321,
-        "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
+        "lastModified": 1730531603,
+        "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
+        "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
         "type": "github"
       },
       "original": {
@@ -95,11 +95,11 @@
     },
     "nixpkgs-stable": {
       "locked": {
-        "lastModified": 1729449015,
-        "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
+        "lastModified": 1730327045,
+        "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "89172919243df199fe237ba0f776c3e3e3d72367",
+        "rev": "080166c15633801df010977d9d7474b4a6c549d7",
         "type": "github"
       },
       "original": {
diff --git a/home/common/default.nix b/home/common/default.nix
index 0697d99..3a2a686 100644
--- a/home/common/default.nix
+++ b/home/common/default.nix
@@ -9,7 +9,7 @@
     ./gnome.nix
     ./k8s.nix
     ./nix.nix
-    ./nvim.nix
+    ./nvim
     ./scripts.nix
     ./ssh.nix
     ./tmux.nix
diff --git a/home/common/nvim.nix b/home/common/nvim.nix
deleted file mode 100644
index 9e65aaf..0000000
--- a/home/common/nvim.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ ... }:
-{
-  programs.neovim = {
-    enable = true;
-    defaultEditor = true;
-    viAlias = true;
-    vimAlias = true;
-    withNodeJs = false;
-    withPython3 = false;
-    withRuby = false;
-  };
-
-  xdg.configFile = {
-    "nvim" = {
-      recursive = true;
-      source = ./../../files/config/nvim;
-    };
-  };
-}
diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix
new file mode 100644
index 0000000..ac0578f
--- /dev/null
+++ b/home/common/nvim/default.nix
@@ -0,0 +1,118 @@
+{ lib, pkgs, ... }:
+{
+  programs.neovim = {
+    enable        = true;
+    defaultEditor = true;
+    viAlias       = true;
+    vimAlias      = true;
+    withNodeJs    = false;
+    withPython3   = false;
+    withRuby      = false;
+
+    extraLuaConfig = lib.fileContents ./init.lua;
+    extraPackages = with pkgs; [
+      black
+      go
+      gopls
+      gotools
+      lua-language-server
+      nil
+      nixd
+      nodePackages.prettier
+      nodePackages.typescript 
+      nodePackages.typescript-language-server
+      nodePackages.bash-language-server 
+      rust-analyzer
+      shellcheck
+      shfmt
+      stylua
+      tree-sitter
+      tree-sitter-grammars.tree-sitter-bash
+      tree-sitter-grammars.tree-sitter-yaml
+      tree-sitter-grammars.tree-sitter-go
+      tree-sitter-grammars.tree-sitter-markdown
+      tree-sitter-grammars.tree-sitter-lua
+      tree-sitter-grammars.tree-sitter-html
+      tree-sitter-grammars.tree-sitter-vim
+      tree-sitter-grammars.tree-sitter-nix
+      vscode-langservers-extracted
+    ];
+
+
+    plugins = with pkgs.vimPlugins; [
+      go-nvim
+      rustaceanvim
+      targets-vim 
+
+      {
+        plugin = pkgs.vimUtils.buildVimPlugin {
+          name = "dieter-nvim";
+          src = pkgs.fetchgit {
+            url = "https://patagia.dev/Patagia/dieter.nvim.git";
+            rev = "08fae6ffec4ae70ba6b2e1cafa780ff317ef0b61";
+            hash = "sha256-C+Vo2SUVfNMkBwuLWqLoA59Pmy9aFwur7fBpfVkLm6Q=";
+          };
+        };
+        type = "lua";
+        config = ''
+          vim.cmd.colorscheme "dieter"
+        '';
+      }
+
+      {
+        plugin = nvim-treesitter.withAllGrammars; # Treesitter
+        type = "lua";
+        config = ''
+          require'nvim-treesitter.configs'.setup {
+            highlight = { enable = true, },
+            indent = { enable = true },
+          }
+        '';
+      }
+
+      {
+        plugin = pkgs.vimUtils.buildVimPlugin {
+          name = "nvim-tree-pairs"; # make % match in TS
+          src = pkgs.fetchFromGitHub {
+            owner = "yorickpeterse";
+            repo = "nvim-tree-pairs";
+            rev = "e7f7b6cc28dda6f3fa271ce63b0d371d5b7641da";
+            hash = "sha256-fb4EsrWAbm8+dWAhiirCPuR44MEg+KYb9hZOIuEuT24=";
+          };
+        };
+        type = "lua";
+        config = "require('tree-pairs').setup()";
+      }
+
+      {
+        plugin = nvim-treesitter-textobjects; # helix-style selection of TS tree
+        type = "lua";
+        config = ''
+          require'nvim-treesitter.configs'.setup {
+            incremental_selection = {
+              enable = true,
+              keymaps = {
+                init_selection = "<M-o>",
+                scope_incremental = "<M-O>",
+                node_incremental = "<M-o>",
+                node_decremental = "<M-i>",
+              },
+            },
+          }
+        '';
+      }
+
+      {
+        plugin = mini-nvim;
+        type = "lua";
+        config = lib.fileContents ./mini.lua;
+      }
+
+      {
+        plugin = nvim-lspconfig; # Interface for LSPs
+        type = "lua";
+        config = lib.fileContents ./lsp.lua;
+      }
+    ];
+  };
+}
diff --git a/home/common/nvim/init.lua b/home/common/nvim/init.lua
new file mode 100644
index 0000000..ba179d8
--- /dev/null
+++ b/home/common/nvim/init.lua
@@ -0,0 +1,93 @@
+-- vim.g.mapleader = "<space>"
+vim.g.maplocalleader = ','
+
+-- UI
+
+vim.opt.cursorline = true
+vim.opt.laststatus = 0
+vim.opt.number = true
+vim.opt.relativenumber = true
+vim.opt.ruler = true
+vim.opt.rulerformat = "" -- FIXME: fancify!
+vim.opt.rulerformat = "%36(%5l,%-6(%c%V%) %t%)%*"
+vim.opt.syntax = "on"
+vim.opt.termguicolors = true
+
+-- Search
+vim.opt.ignorecase = true
+vim.opt.smartcase = true
+
+-- Tab completion
+-- vim.opt.wildmode="list:longest,full"
+vim.opt.wildignore="*.swp,*.o,*.so,*.exe,*.dll"
+
+-- Whitespaces
+vim.opt.breakindent = true
+vim.opt.copyindent = true
+vim.opt.expandtab = true
+vim.opt.softtabstop = 2
+vim.opt.shiftround = true
+vim.opt.shiftwidth = 2
+vim.opt.smartindent = true
+vim.opt.tabstop = 2
+vim.opt.wrap = false
+vim.opt.list = true
+vim.opt.listchars="tab:»·,trail:·"
+
+-- Folds
+vim.opt.foldenable = false
+vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"
+vim.opt.foldmethod = "expr"
+vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+
+--
+
+vim.o.autochdir = true
+vim.o.fillchars = "stl: ,stlnc: ,eob:░,vert:│"
+vim.o.list = false
+vim.o.scrolloff = 7
+vim.o.splitkeep = "screen"
+vim.o.updatetime = 50
+vim.o.timeout = true
+vim.o.timeoutlen = 10
+vim.o.icm = "split"
+-- vim.o.cia = 'kind,abbr,menu' wait for nightly to drop
+
+vim.o.showmode = false
+
+
+-- Use rg
+vim.o.grepprg = [[rg --glob "!.jj" --glob "!.git" --no-heading --vimgrep --follow $*]]
+vim.opt.grepformat = vim.opt.grepformat ^ { "%f:%l:%c:%m" }
+
+vim.fn.sign_define(
+	"DiagnosticSignError",
+	{ text = "", hl = "DiagnosticSignError", texthl = "DiagnosticSignError", culhl = "DiagnosticSignErrorLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignWarn",
+	{ text = "", hl = "DiagnosticSignWarn", texthl = "DiagnosticSignWarn", culhl = "DiagnosticSignWarnLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignInfo",
+	{ text = "", hl = "DiagnosticSignInfo", texthl = "DiagnosticSignInfo", culhl = "DiagnosticSignInfoLine" }
+)
+vim.fn.sign_define(
+	"DiagnosticSignHint",
+	{ text = "", hl = "DiagnosticSignHint", texthl = "DiagnosticSignHint", culhl = "DiagnosticSignHintLine" }
+)
+
+-- Make <Tab> work for snippets
+vim.keymap.set({ "i", "s" }, "<Tab>", function()
+	if vim.snippet.active({ direction = 1 }) then
+		return "<cmd>lua vim.snippet.jump(1)<cr>"
+	else
+		return "<Tab>"
+	end
+end, { expr = true })
+
+vim.keymap.set({ "n" }, "<c-/>", "gcc", { remap = true })
+vim.keymap.set({ "v" }, "<c-/>", "gc", { remap = true })
+vim.keymap.set({ "n" }, "<c-_>", "gcc", { remap = true })
+vim.keymap.set({ "v" }, "<c-_>", "gc", { remap = true })
+vim.keymap.set("n", "zz", "zt", { remap = true })
diff --git a/home/common/nvim/lsp.lua b/home/common/nvim/lsp.lua
new file mode 100644
index 0000000..c2ae113
--- /dev/null
+++ b/home/common/nvim/lsp.lua
@@ -0,0 +1,91 @@
+vim.keymap.set("n", "<space>d", vim.diagnostic.setloclist, { desc = "Add buffer diagnostics to the location list." })
+
+vim.api.nvim_create_autocmd("LspAttach", {
+	group = vim.api.nvim_create_augroup("UserLspConfig", {}),
+	callback = function(ev)
+		-- Enable completion triggered by <c-x><c-o>
+		vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
+
+		-- Buffer local mappings.
+		-- See `:help vim.lsp.*` for documentation on any of the below functions
+		local opts = function(str)
+			return { buffer = ev.buf, desc = str }
+		end
+
+		local client = vim.lsp.get_client_by_id(ev.data.client_id)
+		if client.server_capabilities.codeLensProvider then
+			vim.lsp.codelens.refresh({ bufnr = bufnr })
+		end
+
+		vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
+		vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
+		vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
+
+		vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts("Declaration"))
+		vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts("Definition"))
+		vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts("Implementation"))
+		vim.keymap.set("n", "<M-k>", vim.lsp.buf.signature_help, opts("Signature Help"))
+		vim.keymap.set("i", "<M-k>", vim.lsp.buf.signature_help, opts("Signature Help"))
+		vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts("Add Workspace Folder"))
+		vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts("Remove Workspace Folder"))
+		vim.keymap.set("n", "<space>wl", function()
+			print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
+		end, opts("List Workspace Folders"))
+		vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts("Type Definition"))
+		vim.keymap.set("n", "<space>r", vim.lsp.buf.rename, opts("Rename Symbol"))
+		vim.keymap.set({ "n", "v" }, "<space>a", vim.lsp.buf.code_action, opts("Code Action"))
+		vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("Buffer References"))
+		vim.keymap.set("n", "<localleader>f", function()
+			vim.lsp.buf.format({ async = true })
+		end, opts("Format Buffer"))
+	end,
+})
+
+local lspconfig = require("lspconfig")
+local capabilities = vim.lsp.protocol.make_client_capabilities()
+
+local servers = {
+  'gopls',
+  'nil_ls',
+  'ts_ls',
+}
+
+for _, ls in ipairs(servers) do
+  lspconfig[ls].setup {
+    capabilities = capabilities,
+    on_attach = function(_, buf)
+      vim.api.nvim_set_option_value('omnifunc', 'v:lua.MiniCompletion.completefunc_lsp', {buf = buf})
+    end,
+  }
+end
+
+lspconfig.nixd.setup({
+  capabilities = capabilities,
+	cmd = { "nixd" },
+	settings = {
+		nixd = {
+			nixpkgs = { expr = "import <nixpkgs> { }" },
+			formatting = { command = { "nixfmt" } },
+			options = {},
+		},
+	},
+})
+
+lspconfig.lua_ls.setup({
+  capabilities = capabilities,
+	settings = {
+		Lua = {
+			runtime = {
+				version = "LuaJIT",
+				path = vim.split(package.path, ";"),
+			},
+			diagnostics = { globals = { "vim", "hs" } },
+			workspace = {
+				library = {
+					[vim.fn.expand("$VIMRUNTIME/lua")] = true,
+					[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
+				},
+			},
+		},
+	},
+})
diff --git a/home/common/nvim/mini.lua b/home/common/nvim/mini.lua
new file mode 100644
index 0000000..cba6c4c
--- /dev/null
+++ b/home/common/nvim/mini.lua
@@ -0,0 +1,129 @@
+          local opts = function(label)
+            return {noremap = true, silent = true, desc = label}
+          end
+          require('mini.ai').setup()
+          require('mini.align').setup()
+          require('mini.bracketed').setup()
+          require('mini.completion').setup()
+          require('mini.diff').setup()
+          require('mini.extra').setup()
+          require('mini.icons').setup()
+          require('mini.jump').setup()
+          -- require('mini.pairs').setup()
+          -- require('mini.statusline').setup()
+          require('mini.surround').setup()
+          require('mini.splitjoin').setup()
+
+          require('mini.files').setup()
+          local oil_style = function()
+            if not MiniFiles.close() then
+              MiniFiles.open(vim.api.nvim_buf_get_name(0))
+              MiniFiles.reveal_cwd()
+            end
+          end
+          vim.keymap.set('n', '-', oil_style, opts("File Explorer"));
+
+          local hipatterns = require('mini.hipatterns')
+          hipatterns.setup({  -- highlight strings and colors
+            highlighters = {
+              -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
+              fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
+              hack  = { pattern = '%f[%w]()HACK()%f[%W]',  group = 'MiniHipatternsHack'  },
+              todo  = { pattern = '%f[%w]()TODO()%f[%W]',  group = 'MiniHipatternsTodo'  },
+              note  = { pattern = '%f[%w]()NOTE()%f[%W]',  group = 'MiniHipatternsNote'  },
+
+              -- Highlight hex color strings (`#rrggbb`) using that color
+              hex_color = hipatterns.gen_highlighter.hex_color(),
+            }
+          })
+
+          require('mini.jump2d').setup({
+            mappings = {
+              start_jumping = 'gw'
+            }
+          })
+
+          require('mini.pick').setup({
+            mappings = {
+              move_down = '<tab>'
+            },
+            options = {
+              use_cache = true
+            }
+          })
+          MiniPick.registry.files_root = function(local_opts)
+            local root_patterns = { ".jj", ".git" }
+            local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1])
+            local opts = { source = { cwd = root_dir, tool = "rg" } }
+            local_opts.cwd = root_dir
+            return MiniPick.builtin.files(local_opts, opts)
+          end
+          MiniPick.registry.grep_live_root = function(local_opts)
+            local root_patterns = { ".jj", ".git" }
+            local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1])
+            local opts = { source = { cwd = root_dir } }
+            local_opts.cwd = root_dir
+            return MiniPick.builtin.grep_live(local_opts, opts)
+          end
+          vim.keymap.set('n', '<space>/', "<cmd>Pick grep_live_root<cr>", opts("Live Grep"))
+          vim.keymap.set('n', '<space>F', "<cmd>Pick files<cr>", opts("Find Files in CWD"))
+          vim.keymap.set('n', '<space>ff', "<cmd>Pick files_root<cr>", opts("Find Files"))
+          vim.keymap.set('n', '<space>fr', "<cmd>Pick oldfiles<cr>", opts("Recent Files"))
+          vim.keymap.set('n', '<space>b', "<cmd>Pick buffers<cr>", opts("Buffers"))
+          vim.keymap.set('n', '<space>d', "<cmd>Pick diagnostics<cr>", opts("Diagnostics"))
+          vim.keymap.set('n', '<tab>', "<cmd>Pick buffers include_current=false<cr>", opts("Buffers"))
+          vim.keymap.set('n', "<space>'", "<cmd>Pick resume<cr>", opts("Last Picker"))
+          vim.keymap.set('n', "<space>g", "<cmd>Pick git_commits<cr>", opts("Git Commits"))
+
+
+          local miniclue = require('mini.clue')
+          miniclue.setup({                   -- cute prompts about bindings
+            triggers = {
+              { mode = 'n', keys = '<Leader>' },
+              { mode = 'x', keys = '<Leader>' },
+              { mode = 'n', keys = '<space>' },
+              { mode = 'x', keys = '<space>' },
+
+              -- Built-in completion
+              { mode = 'i', keys = '<C-x>' },
+
+              -- `g` key
+              { mode = 'n', keys = 'g' },
+              { mode = 'x', keys = 'g' },
+
+              -- Marks
+              { mode = 'n', keys = "'" },
+              { mode = 'n', keys = '`' },
+              { mode = 'x', keys = "'" },
+              { mode = 'x', keys = '`' },
+
+              -- Registers
+              { mode = 'n', keys = '"' },
+              { mode = 'x', keys = '"' },
+              { mode = 'i', keys = '<C-r>' },
+              { mode = 'c', keys = '<C-r>' },
+
+              -- Window commands
+              { mode = 'n', keys = '<C-w>' },
+
+              -- `z` key
+              { mode = 'n', keys = 'z' },
+              { mode = 'x', keys = 'z' },
+
+              -- Bracketed
+              { mode = 'n', keys = '[' },
+              { mode = 'n', keys = ']' },
+            },
+            clues = {
+              miniclue.gen_clues.builtin_completion(),
+              miniclue.gen_clues.g(),
+              miniclue.gen_clues.marks(),
+              miniclue.gen_clues.registers(),
+              miniclue.gen_clues.windows(),
+              miniclue.gen_clues.z(),
+            },
+            window = {
+              delay = 15,
+            }
+          })
+
diff --git a/home/common/utils.nix b/home/common/utils.nix
index 7d5fd93..0a608da 100644
--- a/home/common/utils.nix
+++ b/home/common/utils.nix
@@ -55,6 +55,8 @@
       arguments = [
         "--glob=!.git/*"
         "--glob=!.jj/*"
+        "--glob=!result/*"
+        "--glob=!target/*"
       ];
     };