From ff32ecb811bc62558bacf9fe7391e35be1fde199 Mon Sep 17 00:00:00 2001 From: Dennis Date: Wed, 4 Feb 2026 19:02:27 +0100 Subject: [PATCH] refactor: major config changes --- hosts/dnsc-air/default.nix | 13 +- modules/lazygit/default.nix | 6 + modules/nvim/config/lazy-lock.json | 7 +- modules/nvim/config/lsp/biome.lua | 34 ++++ modules/nvim/config/lua/dnsc/lsp.lua | 1 + modules/nvim/config/lua/plugins/blink.lua | 7 +- modules/nvim/config/lua/plugins/dispatch.lua | 3 + modules/nvim/config/lua/plugins/lazydev.lua | 7 - modules/nvim/config/lua/plugins/snacks.lua | 1 - modules/nvim/config/lua/plugins/snipe.lua | 19 -- .../nvim/config/lua/plugins/treesitter.lua | 180 +++++++++--------- modules/nvim/default.nix | 8 +- modules/tmux/default.nix | 40 ---- .../tmuxinator/personal-layouts/proglog.yml | 1 - 14 files changed, 148 insertions(+), 179 deletions(-) create mode 100644 modules/nvim/config/lsp/biome.lua create mode 100644 modules/nvim/config/lua/plugins/dispatch.lua delete mode 100644 modules/nvim/config/lua/plugins/lazydev.lua delete mode 100644 modules/nvim/config/lua/plugins/snipe.lua diff --git a/hosts/dnsc-air/default.nix b/hosts/dnsc-air/default.nix index df43c0d..f56019a 100644 --- a/hosts/dnsc-air/default.nix +++ b/hosts/dnsc-air/default.nix @@ -26,13 +26,19 @@ nix.settings.trusted-users = [ "dennis" ]; # Device specific overlays - nixpkgs.overlays = []; + nixpkgs.overlays = [ ]; # System Packages environment.systemPackages = lib.mkAfter ( with pkgs; [ rsync + # Some global devtools that are + # not included in project flakes + tree-sitter + nil + stylua + lua-language-server ] ); @@ -73,5 +79,8 @@ }; nix.enable = false; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; } diff --git a/modules/lazygit/default.nix b/modules/lazygit/default.nix index 5deab6a..151543d 100644 --- a/modules/lazygit/default.nix +++ b/modules/lazygit/default.nix @@ -8,6 +8,12 @@ nerdFontsVersion = "3"; theme = { lightTheme = false; + activeBorderColor = [ "magenta" "bold" ]; + searchingActiveBorderColor = [ "cyan" "bold" ]; + inactiveBorderColor = [ "#807c9f" ]; + optionsTextColor = [ "#807c9f" ]; + selectedLineBgColor = [ "#331531" ]; + inactiveViewSelectedLineBgColor = [ "#1d202f" ]; }; }; }; diff --git a/modules/nvim/config/lazy-lock.json b/modules/nvim/config/lazy-lock.json index 691f246..69a4ba6 100644 --- a/modules/nvim/config/lazy-lock.json +++ b/modules/nvim/config/lazy-lock.json @@ -6,19 +6,18 @@ "follow-md-links.nvim": { "branch": "main", "commit": "728d96d268eef9666f0ee77a083e7e2f0b44f607" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "gitportal.nvim": { "branch": "main", "commit": "0c3e1c1d518c9e42e61e8df35ea0c0582a278a65" }, - "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, - "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "mini.pairs": { "branch": "main", "commit": "4089aa6ea6423e02e1a8326a7a7a00159f6f5e04" }, "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, - "nvim-treesitter": { "branch": "main", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter": { "branch": "main", "commit": "4967fa48b0fe7a7f92cee546c76bb4bb61bb14d5" }, "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "schemastore.nvim": { "branch": "main", "commit": "9b6a3ab14cecc7da9f3aa4fa0ae2a7390748aca5" }, "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "snipe.nvim": { "branch": "main", "commit": "d2d196c335919767803f905d573ce66340e33ee6" }, "substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" }, "vim-cool": { "branch": "master", "commit": "9ea940c0d537e55de0de4c0298c04b976960fb12" }, + "vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/modules/nvim/config/lsp/biome.lua b/modules/nvim/config/lsp/biome.lua new file mode 100644 index 0000000..aa0c92c --- /dev/null +++ b/modules/nvim/config/lsp/biome.lua @@ -0,0 +1,34 @@ +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'biome' + local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/biome' + if local_cmd and vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers) + end, + filetypes = { + 'astro', + 'css', + 'graphql', + 'html', + 'javascript', + 'javascriptreact', + 'json', + 'jsonc', + 'svelte', + 'typescript', + 'typescriptreact', + 'vue', + }, + workspace_required = true, + root_markers = { + 'package-lock.json', + 'yarn.lock', + 'pnpm-lock.yaml', + 'bun.lockb', + 'bun.lock', + 'deno.lock', + }, +} diff --git a/modules/nvim/config/lua/dnsc/lsp.lua b/modules/nvim/config/lua/dnsc/lsp.lua index ec0df4e..c065590 100644 --- a/modules/nvim/config/lua/dnsc/lsp.lua +++ b/modules/nvim/config/lua/dnsc/lsp.lua @@ -6,6 +6,7 @@ vim.lsp.enable("astro") vim.lsp.enable("tailwindcss") vim.lsp.enable("gopls") vim.lsp.enable("eslint") +vim.lsp.enable("biome") vim.diagnostic.config({ virtual_text = false, diff --git a/modules/nvim/config/lua/plugins/blink.lua b/modules/nvim/config/lua/plugins/blink.lua index 59e0fb9..ee221be 100644 --- a/modules/nvim/config/lua/plugins/blink.lua +++ b/modules/nvim/config/lua/plugins/blink.lua @@ -29,7 +29,7 @@ return { enabled = true, }, sources = { - default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + default = { "lsp", "path", "snippets", "buffer" }, per_filetype = { sql = { "dadbod" }, mysql = { "dadbod" }, @@ -38,11 +38,6 @@ return { }, providers = { dadbod = { module = "vim_dadbod_completion.blink" }, - lazydev = { - name = "LazyDev", - module = "lazydev.integrations.blink", - score_offset = 100, - }, }, }, fuzzy = { implementation = "prefer_rust_with_warning" }, diff --git a/modules/nvim/config/lua/plugins/dispatch.lua b/modules/nvim/config/lua/plugins/dispatch.lua new file mode 100644 index 0000000..e91cec8 --- /dev/null +++ b/modules/nvim/config/lua/plugins/dispatch.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-dispatch", +} diff --git a/modules/nvim/config/lua/plugins/lazydev.lua b/modules/nvim/config/lua/plugins/lazydev.lua deleted file mode 100644 index c5003dc..0000000 --- a/modules/nvim/config/lua/plugins/lazydev.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - "folke/lazydev.nvim", - ft = "lua", -- only load on lua files - opts = {}, - }, -} diff --git a/modules/nvim/config/lua/plugins/snacks.lua b/modules/nvim/config/lua/plugins/snacks.lua index aa356f8..19c3e5a 100644 --- a/modules/nvim/config/lua/plugins/snacks.lua +++ b/modules/nvim/config/lua/plugins/snacks.lua @@ -26,7 +26,6 @@ return { input = { enabled = true }, lazygit = { enabled = true, - configure = true, }, notifier = { enabled = true }, picker = { diff --git a/modules/nvim/config/lua/plugins/snipe.lua b/modules/nvim/config/lua/plugins/snipe.lua deleted file mode 100644 index 30b755d..0000000 --- a/modules/nvim/config/lua/plugins/snipe.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "leath-dub/snipe.nvim", - keys = { - { - "bs", - function() - require("snipe").open_buffer_menu() - end, - desc = "Open Snipe buffer menu", - }, - }, - opts = { - position = "center", - open_win_override = { - title = "Select buffer", - border = "rounded", - }, - }, -} diff --git a/modules/nvim/config/lua/plugins/treesitter.lua b/modules/nvim/config/lua/plugins/treesitter.lua index bfc7441..5c86500 100644 --- a/modules/nvim/config/lua/plugins/treesitter.lua +++ b/modules/nvim/config/lua/plugins/treesitter.lua @@ -1,106 +1,100 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", - config = function() - local configs = require("nvim-treesitter.configs") - - configs.setup({ - ensure_installed = { - "angular", - "bash", - "c", - "css", - "diff", - "html", - "javascript", - "jsdoc", - "json", - "jsonc", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "odin", - "go", - "goctl", - "gowork", - "gomod", - "gosum", - "gotmpl", - "printf", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", + opts = { + ensure_installed = { + "angular", + "bash", + "c", + "css", + "diff", + "html", + "javascript", + "jsdoc", + "json", + "jsonc", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "odin", + "go", + "goctl", + "gowork", + "gomod", + "gosum", + "gotmpl", + "printf", + "python", + "query", + "regex", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + }, + auto_install = true, + sync_install = false, + ignore_install = {}, + modules = {}, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", }, - auto_install = true, - sync_install = false, - ignore_install = {}, - modules = {}, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { + }, + textobjects = { + select = { enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", + -- You can use the capture groups defined in textobjects.scm + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", }, }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", }, - swap = { - enable = true, - swap_next = { - ["a"] = "@parameter.inner", - }, - swap_previous = { - ["A"] = "@parameter.inner", - }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", }, }, - }) - - vim.treesitter.language.register("markdown", "vimwiki") - end, + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["A"] = "@parameter.inner", + }, + }, + }, + }, } diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix index 205cd65..880eeb6 100644 --- a/modules/nvim/default.nix +++ b/modules/nvim/default.nix @@ -14,14 +14,10 @@ home.packages = lib.mkAfter ( with pkgs; [ + # Some devtools not included in project + # flakes stylua - typescript-language-server - vscode-langservers-extracted - astro-language-server - tailwindcss-language-server lua-language-server - prettierd - eslint_d nil tree-sitter ] diff --git a/modules/tmux/default.nix b/modules/tmux/default.nix index a54cbce..292e383 100644 --- a/modules/tmux/default.nix +++ b/modules/tmux/default.nix @@ -1,36 +1,5 @@ { pkgs, ... }: -let - tmux-compile = pkgs.tmuxPlugins.mkTmuxPlugin { - pluginName = "compile-mode"; - version = "1.0"; - src = pkgs.fetchFromGitHub { - owner = "alexekdahl"; - repo = "tmux-compile"; - rev = "be830d944a189fc6b209490fcb815346a3c402ca"; - hash = "sha256-+b3Oc4M0xhwCo7HupAJpG68ZxMC8yMNZLl6QtEQv12o="; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postPatch = '' - patchShebangs . - ''; - postInstall = '' - for script in $target/share/tmux-plugins/*/bin/* $target/share/tmux-plugins/*/*.tmux; do - [ -f "$script" ] && [ -x "$script" ] && wrapProgram "$script" \ - --prefix PATH : ${ - pkgs.lib.makeBinPath [ - pkgs.bash - pkgs.coreutils - pkgs.tmux - pkgs.gnused - pkgs.gnugrep - ] - } - done - ''; - }; -in - { programs.tmux = { enable = true; @@ -102,15 +71,6 @@ in unbind v bind v choose-tree -Zw "join-pane -t '%%'" - - # Custom plugins - set -g @compile-mode-key "C-b" - set -g @compile-mode-recompile-key "C-r" - set -g @compile-mode-kill-key "C-k" - set -g @compile-mode-height "30%" - set -g @compile-mode-history-file "$HOME/.config/tmux-compile-mode/compile-history" - set -g @compile-mode-open-file-key "Enter" - run-shell ${tmux-compile}/share/tmux-plugins/compile-mode/compile-mode.tmux ''; }; } diff --git a/modules/tmuxinator/personal-layouts/proglog.yml b/modules/tmuxinator/personal-layouts/proglog.yml index 82f2f68..4d0f235 100644 --- a/modules/tmuxinator/personal-layouts/proglog.yml +++ b/modules/tmuxinator/personal-layouts/proglog.yml @@ -5,7 +5,6 @@ windows: layout: main-horizontal panes: - nvim +"lua Snacks.picker.files({ hidden = true })" - - bun dev - run: layout: main-vertical panes: