Selaa lähdekoodia

refactor(nvim): migrate to NvChad and remove old configuration

- Migrate from custom kickstart-style config to NvChad
- Implement modular configs/ and plugins/ structure following NvChad patterns
- Add comprehensive NvChad integration with kanagawa-dragon theme
- Configure enhanced LSP support with nixvim lsp module
- Add minuet AI completion with OpenRouter integration
- Include rustaceanvim for improved Rust development experience
- Remove old kickstart-style configuration files
- Clean up redundant plugin configurations
Zander Hawke 5 kuukautta sitten
vanhempi
sitoutus
99cde162d0
31 muutettua tiedostoa jossa 1110 lisäystä ja 648 poistoa
  1. 32 0
      home/features/nvim/autocmds.nix
  2. 116 0
      home/features/nvim/configs/cmp.nix
  3. 60 0
      home/features/nvim/configs/default.nix
  4. 12 0
      home/features/nvim/configs/gitsigns.nix
  5. 18 0
      home/features/nvim/configs/indent-blankline.nix
  6. 117 0
      home/features/nvim/configs/lspconfig.nix
  7. 19 0
      home/features/nvim/configs/minuet.nix
  8. 38 0
      home/features/nvim/configs/nvim-tree.nix
  9. 68 0
      home/features/nvim/configs/opencode.nix
  10. 31 0
      home/features/nvim/configs/rustaceanvim.nix
  11. 26 0
      home/features/nvim/configs/telescope.nix
  12. 19 0
      home/features/nvim/configs/treesitter.nix
  13. 11 0
      home/features/nvim/configs/web-devicons.nix
  14. 9 0
      home/features/nvim/configs/which-key.nix
  15. 0 31
      home/features/nvim/copilot.nix
  16. 13 168
      home/features/nvim/default.nix
  17. 0 157
      home/features/nvim/lsp.nix
  18. 160 0
      home/features/nvim/mapping.nix
  19. 0 71
      home/features/nvim/mini.nix
  20. 0 40
      home/features/nvim/opencode.nix
  21. 66 0
      home/features/nvim/options.nix
  22. 30 0
      home/features/nvim/plugins/base46.nix
  23. 10 0
      home/features/nvim/plugins/default.nix
  24. 216 0
      home/features/nvim/plugins/nvchad.nix
  25. 10 0
      home/features/nvim/plugins/nvzone-menu.nix
  26. 10 0
      home/features/nvim/plugins/nvzone-minty.nix
  27. 10 0
      home/features/nvim/plugins/nvzone-volt.nix
  28. 9 0
      home/features/nvim/plugins/rust.nix
  29. 0 119
      home/features/nvim/telescope.nix
  30. 0 16
      home/features/nvim/treesitter.nix
  31. 0 46
      home/features/nvim/which-key.nix

+ 32 - 0
home/features/nvim/autocmds.nix

@@ -0,0 +1,32 @@
+{
+  autoGroups = { NvFilePost.clear = true; };
+  autoCmd = [
+    {
+      event = [ "UIEnter" "BufReadPost" "BufNewFile" ];
+      group = "NvFilePost";
+      callback.__raw = ''
+        function(args)
+          local file = vim.api.nvim_buf_get_name(args.buf)
+          local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
+
+          if not vim.g.ui_entered and args.event == "UIEnter" then
+            vim.g.ui_entered = true
+          end
+
+          if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then
+            vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false })
+            vim.api.nvim_del_augroup_by_name "NvFilePost"
+
+            vim.schedule(function()
+              vim.api.nvim_exec_autocmds("FileType", {})
+
+              if vim.g.editorconfig then
+                require("editorconfig").config(args.buf)
+              end
+            end)
+          end
+        end
+      '';
+    }
+  ];
+}

+ 116 - 0
home/features/nvim/configs/cmp.nix

@@ -0,0 +1,116 @@
+{ lib
+, config
+, ...
+}:
+let
+  inherit (lib.nixvim) toLuaObject;
+  cfg = config.plugins.cmp;
+in
+{
+  plugins.friendly-snippets.enable = true;
+
+  plugins.luasnip = {
+    enable = true;
+    settings = {
+      history = true;
+      update_events = "TextChanged,TextChangedI";
+    };
+    fromVscode = [
+      { exclude.__raw = ''vim.g.vscode_snippets_exclude or {}''; }
+      { paths.__raw = ''vim.g.vscode_snippets_path or ""''; }
+    ];
+    fromSnipmate = [
+      { paths.__raw = ''vim.g.snipmate_snippets_path or ""''; }
+    ];
+    fromLua = [
+      { paths.__raw = ''vim.g.lua_snippets_path or ""''; }
+    ];
+  };
+
+  # fix luasnip #258
+  autoCmd = [
+    {
+      event = [ "InsertLeave" ];
+      callback.__raw = ''
+        function()
+          if
+            require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
+            and not require("luasnip").session.jump_active
+          then
+            require("luasnip").unlink_current()
+          end
+        end
+      '';
+    }
+  ];
+
+  plugins.nvim-autopairs = {
+    enable = true;
+    settings = {
+      fast_wrap = { };
+      disable_filetype = [ "TelescopePrompt" "vim" ];
+    };
+    luaConfig.post = ''
+      -- setup cmp for autopairs
+      local cmp_autopairs = require "nvim-autopairs.completion.cmp"
+      require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
+    '';
+  };
+
+  plugins.cmp = {
+    enable = true;
+    autoEnableSources = true;
+    settings = {
+      completion.completeopt = "menu,menuone";
+      snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
+      mapping = {
+        "<C-p>" = "cmp.mapping.select_prev_item()";
+        "<C-n>" = "cmp.mapping.select_next_item()";
+        "<C-d>" = "cmp.mapping.scroll_docs(-4)";
+        "<C-f>" = "cmp.mapping.scroll_docs(4)";
+        "<C-Space>" = "cmp.mapping.complete()";
+        "<C-e>" = "cmp.mapping.close()";
+
+        "<CR>" = ''cmp.mapping.confirm({
+          behavior = cmp.ConfirmBehavior.Insert,
+          select = true,
+        })'';
+
+        "<Tab>" = ''cmp.mapping(function(fallback)
+          if cmp.visible() then
+            cmp.select_next_item()
+          elseif require("luasnip").expand_or_jumpable() then
+            require("luasnip").expand_or_jump()
+          else
+            fallback()
+          end
+        end, { "i", "s" })'';
+
+        "<S-Tab>" = ''cmp.mapping(function(fallback)
+          if cmp.visible() then
+            cmp.select_prev_item()
+          elseif require("luasnip").jumpable(-1) then
+            require("luasnip").jump(-1)
+          else
+            fallback()
+          end
+        end, { "i", "s" })'';
+      };
+
+      sources = [
+        { name = "nvim_lsp"; }
+        { name = "luasnip"; }
+        { name = "buffer"; }
+        { name = "nvim_lua"; }
+        { name = "async_path"; }
+      ];
+    };
+
+    luaConfig.pre = "dofile(vim.g.base46_cache .. 'cmp')";
+    luaConfig.post = ''
+      local options = ${toLuaObject cfg.settings}
+      options = vim.tbl_deep_extend("force", options, require "nvchad.cmp")
+      cmp.setup(options)
+    '';
+  };
+}

+ 60 - 0
home/features/nvim/configs/default.nix

@@ -0,0 +1,60 @@
+{
+  imports = [
+    ./cmp.nix
+    ./gitsigns.nix
+    ./indent-blankline.nix
+    ./lspconfig.nix
+    ./minuet.nix
+    ./nvim-tree.nix
+    ./opencode.nix
+    ./rustaceanvim.nix
+    ./telescope.nix
+    ./treesitter.nix
+    ./web-devicons.nix
+    ./which-key.nix
+  ];
+
+  plugins = {
+    lz-n.enable = true;
+    base46.enable = true;
+
+    nvchad = {
+      enable = true;
+      settings = {
+        base46 = {
+          theme = "kanagawa-dragon";
+          transparency = true;
+        };
+        ui.statusline.theme = "default";
+        nvdash = {
+          header = [
+            "                        "
+            "▄▄▄▄▄  ▄▄▄  ▗▞▀▀▘▄ ▗▞▀▚▖"
+            " ▄▄▄▀ █   █ ▐▌   ▄ ▐▛▀▀▘"
+            "█▄▄▄▄ ▀▄▄▄▀ ▐▛▀▘ █ ▝▚▄▄▖"
+            "            ▐▌   █      "
+            "                        "
+          ];
+          load_on_startup = true;
+        };
+      };
+    };
+
+    nvzone-volt.enable = true;
+    nvzone-menu.enable = true;
+    nvzone-minty = {
+      enable = true;
+      lazyLoad.settings.cmd = [ "Huefy" "Shades" ];
+    };
+
+    conform-nvim = {
+      enable = true;
+      settings = {
+        formatters_by_ft = { lua = [ "stylua" ]; };
+      };
+    };
+
+    tmux-navigator.enable = true;
+    todo-comments.enable = true;
+  };
+}

+ 12 - 0
home/features/nvim/configs/gitsigns.nix

@@ -0,0 +1,12 @@
+{
+  plugins.gitsigns = {
+    enable = true;
+    lazyLoad.settings.event = "User FilePost";
+    settings = {
+      signs = {
+        delete = { text = "󰍵"; };
+        changedelete = { text = "󱕖"; };
+      };
+    };
+  };
+}

+ 18 - 0
home/features/nvim/configs/indent-blankline.nix

@@ -0,0 +1,18 @@
+{
+  plugins.indent-blankline = {
+    enable = true;
+    settings = {
+      indent = { char = "│"; highlight = "IblChar"; };
+      scope = { char = "│"; highlight = "IblScopeChar"; };
+    };
+    lazyLoad.settings.event = "User FilePost";
+    luaConfig.pre = ''
+      dofile(vim.g.base46_cache .. "blankline")
+      local hooks = require("ibl.hooks")
+      hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
+    '';
+    luaConfig.post = ''
+      dofile(vim.g.base46_cache .. "blankline")
+    '';
+  };
+}

+ 117 - 0
home/features/nvim/configs/lspconfig.nix

@@ -0,0 +1,117 @@
+{
+  lsp = {
+    keymaps = [
+      { key = "gD"; lspBufAction = "declaration"; }
+      { key = "gd"; lspBufAction = "definition"; }
+      { key = "<leader>wa"; lspBufAction = "add_workspace_folder"; }
+      { key = "<leader>wr"; lspBufAction = "remove_workspace_folder"; }
+
+      {
+        key = "<leader>wl";
+        action.__raw = ''
+          function()
+            print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
+          end
+        '';
+      }
+
+      { key = "<leader>D"; lspBufAction = "type_definition"; }
+      { key = "<leader>ra"; action.__raw = "require('nvchad.lsp.renamer')"; }
+    ];
+
+    servers = {
+      "*".config = {
+        capabilities.textDocument.completion.completionItem = {
+          documentationFormat = [ "markdown" "plaintext" ];
+          snippetSupport = true;
+          preselectSupport = true;
+          insertReplaceSupport = true;
+          labelDetailsSupport = true;
+          deprecatedSupport = true;
+          commitCharactersSupport = true;
+          tagSupport.valueSet = [ 1 ];
+          resolveSupport = {
+            properties = [
+              "documentation"
+              "detail"
+              "additionalTextEdits"
+            ];
+          };
+        };
+
+        # disable semanticTokens
+        on_init.__raw = ''
+          function(client, _)
+            if vim.fn.has "nvim-0.11" ~= 1 then
+              if client.supports_method "textDocument/semanticTokens" then
+                client.server_capabilities.semanticTokensProvider = nil
+              end
+            else
+              if client:supports_method "textDocument/semanticTokens" then
+                client.server_capabilities.semanticTokensProvider = nil
+              end
+            end
+          end
+        '';
+      };
+
+      lua_ls = {
+        enable = true;
+        config.settings = {
+          Lua = {
+            runtime = { version = "LuaJIT"; };
+            workspace = {
+              library.__raw = ''
+                {
+                  vim.fn.expand "$VIMRUNTIME/lua",
+                  vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
+                  vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
+                }
+              '';
+            };
+          };
+        };
+      };
+
+      astro.enable = true;
+      bashls.enable = true;
+      codelldb.enable = true;
+      cssls.enable = true;
+
+      denols = {
+        enable = true;
+        config.root_dir.__raw = ''
+          require("lspconfig.util").root_pattern("deno.json", "deno.jsonc", "deno.lock")
+        '';
+      };
+
+      gopls.enable = true;
+      html.enable = true;
+      nextls.enable = true;
+      nil_ls.enable = true;
+      phpactor = {
+        enable = true;
+        config.filetypes = [ "php" "blade" ];
+      };
+      rust-analyzer = {
+        enable = true;
+        # config.on_init = ''
+        #
+        # '';
+      };
+      tailwindcss.enable = true;
+      ts_ls = {
+        enable = true;
+        config = {
+          root_dir.__raw = ''
+            require("lspconfig.util").root_pattern("tsconfig.json", "jsconfig.json")
+          '';
+          single_file_support = false;
+        };
+      };
+      vue_ls.enable = true;
+    };
+  };
+
+  plugins.lspconfig.enable = true;
+}

+ 19 - 0
home/features/nvim/configs/minuet.nix

@@ -0,0 +1,19 @@
+{
+  plugins.minuet.enable = true;
+  plugins.minuet.settings = {
+    provider = "openai_compatible";
+    provider_options = {
+      openai_compatible = {
+        api_key = "OPENROUTER_API_KEY";
+        end_point = "https://openrouter.ai/api/v1/chat/completions";
+        model = "google/gemini-3-flash-preview";
+        name = "OpenRouter";
+        optional = {
+          max_tokens = 256;
+          top_p = 0.9;
+        };
+        stream = true;
+      };
+    };
+  };
+}

+ 38 - 0
home/features/nvim/configs/nvim-tree.nix

@@ -0,0 +1,38 @@
+{
+  plugins.nvim-tree = {
+    enable = true;
+    lazyLoad.settings.cmd = [ "NvimTreeToggle" "NvimTreeFocus" ];
+    settings = {
+      filters = { dotfiles = false; };
+      disable_netrw = true;
+      hijack_cursor = true;
+      sync_root_with_cwd = true;
+      update_focused_file = {
+        enable = true;
+        update_root = false;
+      };
+      view = {
+        width = 30;
+        preserve_window_proportions = true;
+      };
+      renderer = {
+        root_folder_label = false;
+        highlight_git = true;
+        indent_markers = { enable = true; };
+        icons = {
+          glyphs = {
+            default = "󰈚";
+            folder = {
+              default = "";
+              empty = "";
+              empty_open = "";
+              open = "";
+              symlink = "";
+            };
+            git = { unmerged = ""; };
+          };
+        };
+      };
+    };
+  };
+}

+ 68 - 0
home/features/nvim/configs/opencode.nix

@@ -0,0 +1,68 @@
+{ lib
+, ...
+}:
+let
+  inherit (lib.nixvim) mkRaw;
+  keyMap = mode: key: action: options: { inherit mode key action options; };
+in
+{
+  plugins.opencode.enable = true;
+
+  keymaps = [
+    (keyMap [ "n" "x" ] "<C-a>"
+      (mkRaw ''
+        function() 
+          require("opencode").ask("@this: ", { submit = true })
+        end
+      '')
+      { desc = "Ask opencode"; })
+    (keyMap [ "n" "x" ] "<C-x>"
+      (mkRaw ''
+        function ()
+          require("opencode").select()
+        end
+      '')
+      { desc = "Execute opencode action…"; })
+    (keyMap [ "n" "t" ] "<C-.>"
+      (mkRaw ''
+        function() 
+          require("opencode").toggle()
+        end
+      '')
+      { desc = "Toggle opencode"; })
+
+    (keyMap [ "n" "x" ] "go"
+      (mkRaw ''
+        function()
+          return require("opencode").operator("@this ")
+        end
+      '')
+      { expr = true; desc = "Add range to opencode"; })
+    (keyMap "n" "goo"
+      (mkRaw ''
+        function()
+          return require("opencode").operator("@this ") .. "_"
+        end
+      '')
+      { expr = true; desc = "Add line to opencode"; })
+
+    (keyMap "n" "<S-C-u>"
+      (mkRaw ''
+        function()
+          require("opencode").command("session.half.page.up")
+        end
+      '')
+      { desc = "opencode half page up"; })
+    (keyMap "n" "<S-C-d>"
+      (mkRaw ''
+        function()
+          require("opencode").command("session.half.page.down")
+        end
+      '')
+      { desc = "opencode half page down"; })
+
+    # You may want these if you stick with the opinionated "<C-a>" and "<C-x>" above — otherwise consider "<leader>o".
+    (keyMap "n" "+" "<C-a>" { desc = "Increment"; noremap = true; })
+    (keyMap "n" "-" "<C-x>" { desc = "Decrement"; noremap = true; })
+  ];
+}

+ 31 - 0
home/features/nvim/configs/rustaceanvim.nix

@@ -0,0 +1,31 @@
+{
+  plugins = {
+    crates = {
+      enable = true;
+      lazyLoad.settings.ft = "toml";
+    };
+    rust.enable = true;
+    rustaceanvim = {
+      enable = true;
+
+      settings = {
+        server = {
+          default_settings = {
+            "rust-analyzer" = {
+              cargo = {
+                allFeatures = true;
+                loadOutDirsFromCheck = true;
+              };
+              procMacro.enable = true;
+              checkOnSave = true;
+              check.command = "clippy";
+            };
+          };
+        };
+
+        inlay_hints.enable = true;
+        tools.hover_actions.replace_builtin = true;
+      };
+    };
+  };
+}

+ 26 - 0
home/features/nvim/configs/telescope.nix

@@ -0,0 +1,26 @@
+{
+  plugins.telescope = {
+    enable = true;
+    lazyLoad.settings.cmd = [ "Telescope" ];
+    settings = {
+      defaults = {
+        prompt_prefix = "   ";
+        selection_caret = " ";
+        entry_prefix = " ";
+        sorting_strategy = "ascending";
+        layout_config = {
+          horizontal = {
+            prompt_position = "top";
+            preview_width = 0.55;
+          };
+          width = 0.87;
+          height = 0.80;
+        };
+        mappings = {
+          n = { "q".__raw = ''require("telescope.actions").close''; };
+        };
+      };
+      # extensions_list = [ "themes" "terms" ];
+    };
+  };
+}

+ 19 - 0
home/features/nvim/configs/treesitter.nix

@@ -0,0 +1,19 @@
+{
+  plugins.treesitter = {
+    enable = true;
+    lazyLoad.settings = {
+      event = [ "BufReadPost" "BufNewFile" ];
+      cmd = [ "TSInstall" "TSBufEnable" "TSBufDisable" "TSModuleInfo" ];
+    };
+    settings = {
+      highlight.enable = true;
+      indent.enable = true;
+    };
+    luaConfig.pre = ''
+      pcall(function()
+        dofile(vim.g.base46_cache .. "syntax")
+        dofile(vim.g.base46_cache .. "treesitter")
+      end)
+    '';
+  };
+}

+ 11 - 0
home/features/nvim/configs/web-devicons.nix

@@ -0,0 +1,11 @@
+{
+  plugins.web-devicons = {
+    enable = true;
+    luaConfig.post = ''
+      dofile(vim.g.base46_cache .. "devicons")
+      require('nvim-web-devicons').set_icon(
+        require('nvchad.icons.devicons')
+      )
+    '';
+  };
+}

+ 9 - 0
home/features/nvim/configs/which-key.nix

@@ -0,0 +1,9 @@
+{
+  plugins.which-key = {
+    enable = true;
+    lazyLoad.settings = {
+      keys = [ "<leader>" "<c-w>" "\"" "'" "`" "c" "v" "g" ];
+      cmd = "WhichKey";
+    };
+  };
+}

+ 0 - 31
home/features/nvim/copilot.nix

@@ -1,31 +0,0 @@
-{
-  programs.nixvim = {
-    plugins.copilot-lua.enable = false;
-    plugins.copilot-lua.settings = {
-      suggestion = {
-        enabled = true;
-        auto_trigger = true;
-        accept = false;
-      };
-      panel.enabled = false;
-      filetypes."*" = true;
-    };
-
-    keymaps = [
-      {
-        key = "<C-f>";
-        action.__raw = ''
-          function()
-            if require("copilot.suggestion").is_visible() then
-              require("copilot.suggestion").accept()
-            else
-              vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-f>", true, false, true), "n", false)
-            end
-          end
-        '';
-        mode = "i";
-        options.silent = true;
-      }
-    ];
-  };
-}

+ 13 - 168
home/features/nvim/default.nix

@@ -1,183 +1,28 @@
-{ inputs
+{ config
+, inputs
 , pkgs
 , ...
 }:
 {
-  imports = [
-    inputs.nixvim.homeManagerModules.nixvim
+  imports = [ inputs.nixvim.homeModules.nixvim ];
 
-    ./copilot.nix # copilot plugin
-    ./lsp.nix
-    ./mini.nix # mini.nvim plugin
-    ./opencode.nix
-    ./telescope.nix # fuzzy find everything
-    ./treesitter.nix # treesitter support
-    ./which-key.nix # keybinding helper
-  ];
+  home.packages = [ pkgs.unstable.opencode ];
 
-  home.packages = [ pkgs.zig ];
-
-  programs.nixvim.plugins = {
-    tmux-navigator.enable = true;
-    todo-comments.enable = true; # todo comments eg TODO, FIXME, etc
-  };
+  programs.fish.interactiveShellInit = ''
+    set OPENROUTER_API_KEY $(cat ${config.age.secrets."meili/openrouter".path})
+  '';
 
   programs.nixvim = {
     enable = true;
     defaultEditor = true;
     vimdiffAlias = true;
 
-    extraPlugins = with pkgs; [
-      vimPlugins.kanagawa-nvim
-    ];
-
-    extraConfigLua = ''
-      require("kanagawa").setup({
-        transparent = true,
-      })
-      vim.cmd.colorscheme("kanagawa")
-    '';
-
-    globals.mapleader = " ";
-    globals.maplocalleader = " ";
-    globals.have_nerd_font = true;
-
-    clipboard.register = "unnamedplus";
-
-    opts = {
-      number = true;
-      relativenumber = true;
-      showmode = false;
-      breakindent = true;
-      undofile = true;
-      ignorecase = true;
-      smartcase = true;
-      signcolumn = "yes";
-      updatetime = 250;
-      timeoutlen = 300;
-      splitright = true;
-      splitbelow = true;
-      list = true;
-      listchars = {
-        tab = "» ";
-        trail = "·";
-        nbsp = "␣";
-      };
-      inccommand = "split";
-      cursorline = true;
-      scrolloff = 10;
-      hlsearch = true;
-      swapfile = false;
-      backup = false;
-      conceallevel = 1;
-      laststatus = 3;
-      cmdheight = 0;
-    };
-
-    autoCmd = [
-      {
-        event = "TextYankPost";
-        desc = "Highlight when yanking (copying) text";
-        group = "kickstart-highlight-yank";
-        callback.__raw = ''
-          function()
-            vim.highlight.on_yank()
-          end
-        '';
-      }
-    ];
-
-    autoGroups = {
-      "kickstart-highlight-yank".clear = true;
-    };
-
-    keymaps = [
-      {
-        key = "<Esc>";
-        action = "<cmd>nohlsearch<CR>";
-        mode = "n";
-      }
-      # Diagnostic keymaps
-      # { key = "<leader>q"; action.__raw = "vim.diagnostic.setloclist"; mode = "n"; options.desc = "Open diagnostic [Q]uickfix list"; }
-      # Exit terminal mode in the builtin terminal
-      # { key = "<Esc><Esc>"; action = "<C-\\><C-n>"; mode = "t"; option.desc = "Exit terminal mode"; }
-      # Keybinds to make split navigation easier. TODO: figure out if these work
-      {
-        key = "<C-h>";
-        action = "<C-w>h";
-        mode = "n";
-        options.desc = "Move focus to the left window";
-      }
-
-      {
-        key = "<C-l>";
-        action = "<C-w>l";
-        mode = "n";
-        options.desc = "Move focus to the right window";
-      }
-
-      {
-        key = "<C-j>";
-        action = "<C-w>j";
-        mode = "n";
-        options.desc = "Move focus to the lower window";
-      }
-
-      {
-        key = "<C-k>";
-        action = "<C-w>k";
-        mode = "n";
-        options.desc = "Move focus to the upper window";
-      }
-
-      # Move highlighed blocks of code up and down
-      {
-        key = "K";
-        action = ":m '<-2<CR>gv=gv";
-        mode = "v";
-        options.desc = "Move highlighted block up";
-      }
-      {
-        key = "J";
-        action = ":m '>+1<CR>gv=gv";
-        mode = "v";
-        options.desc = "Move highlighted block down";
-      }
-
-      {
-        key = "J";
-        action = "mzJ`z";
-        mode = "n";
-        options.desc = "Join lines without losing cursor position";
-      }
-
-      {
-        key = "<C-d>";
-        action = "<C-d>zz";
-        mode = "n";
-        options.desc = "Scroll down and center cursor";
-      }
-
-      {
-        key = "<C-u>";
-        action = "<C-u>zz";
-        mode = "n";
-        options.desc = "Scroll up and center cursor";
-      }
-
-      {
-        key = "n";
-        action = "nzzzv";
-        mode = "n";
-        options.desc = "Find next and center cursor";
-      }
-      {
-        key = "N";
-        action = "Nzzzv";
-        mode = "n";
-        options.desc = "Find previous and center cursor";
-      }
-
+    imports = [
+      ./autocmds.nix
+      ./configs
+      ./mapping.nix
+      ./options.nix
+      ./plugins
     ];
   };
 }

+ 0 - 157
home/features/nvim/lsp.nix

@@ -1,157 +0,0 @@
-{
-  programs.nixvim = {
-    autoCmd = [
-      {
-        event = "LspAttach";
-        desc = "Keymaps for when LSP is attached";
-        group = "kickstart-lsp-attach";
-        callback.__raw = ''
-          function(event)
-            local map = function(keys, func, desc)
-              vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
-            end
-
-            -- Jump to the definition of the word under your cursor.
-            --  This is where a variable was first declared, or where a function is defined, etc.
-            --  To jump back, press <C-t>.
-            map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-
-            -- Find references for the word under your cursor.
-            map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
-
-            -- Jump to the implementation of the word under your cursor.
-            --  Useful when your language has ways of declaring types without an actual implementation.
-            map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
-
-            -- Jump to the type of the word under your cursor.
-            --  Useful when you're not sure what type a variable is and you want to see
-            --  the definition of its *type*, not where it was *defined*.
-            map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
-
-            -- Fuzzy find all the symbols in your current document.
-            --  Symbols are things like variables, functions, types, etc.
-            map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
-
-            -- Fuzzy find all the symbols in your current workspace.
-            --  Similar to document symbols, except searches over your entire project.
-            map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-
-            -- Rename the variable under your cursor.
-            --  Most Language Servers support renaming across files, etc.
-            map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
-
-            -- Execute a code action, usually your cursor needs to be on top of an error
-            -- or a suggestion from your LSP for this to activate.
-            map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
-
-            -- WARN: This is not Goto Definition, this is Goto Declaration.
-            --  For example, in C this would take you to the header.
-            map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-
-            -- The following two autocommands are used to highlight references of the
-            -- word under your cursor when your cursor rests there for a little while.
-            --    See `:help CursorHold` for information about when this is executed
-            --
-            -- When you move your cursor, the highlights will be cleared (the second autocommand).
-            local client = vim.lsp.get_client_by_id(event.data.client_id)
-            if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
-              local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
-              vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
-                buffer = event.buf,
-                group = highlight_augroup,
-                callback = vim.lsp.buf.document_highlight,
-              })
-
-              vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
-                buffer = event.buf,
-                group = highlight_augroup,
-                callback = vim.lsp.buf.clear_references,
-              })
-
-              vim.api.nvim_create_autocmd('LspDetach', {
-                group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
-                callback = function(event2)
-                  vim.lsp.buf.clear_references()
-                  vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
-                end,
-              })
-            end
-
-            -- The following code creates a keymap to toggle inlay hints in your
-            -- code, if the language server you are using supports them
-            --
-            -- This may be unwanted, since they displace some of your code
-            if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
-              map('<leader>th', function()
-                vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
-              end, '[T]oggle Inlay [H]ints')
-            end
-          end
-        '';
-      }
-    ];
-
-    autoGroups = {
-      "kickstart-lsp-attach".clear = true;
-    };
-
-    keymaps = [
-      {
-        key = "<C-h>";
-        action.__raw = "vim.lsp.buf.signature_help";
-        mode = "i";
-      }
-    ];
-
-    plugins.lsp = {
-      enable = true;
-
-      keymaps = {
-        diagnostic = {
-          "<leader>vd" = "open_float";
-          "[d" = "goto_next";
-          "]d" = "goto_prev";
-        };
-
-        lspBuf = {
-          "<leader>f" = "format";
-          "gd" = "definition";
-          "K" = "hover";
-          "<leader>vws" = "workspace_symbol";
-          "<leader>vca" = "code_action";
-          "<leader>vrr" = "references";
-          "<leader>vrn" = "rename";
-        };
-      };
-
-      servers = {
-        astro.enable = true;
-        bashls.enable = true;
-        cssls.enable = true;
-        denols = {
-          enable = true;
-          extraOptions.root_dir.__raw = ''
-            require("lspconfig.util").root_pattern("deno.json", "deno.jsonc", "deno.lock")
-          '';
-        };
-        gopls.enable = true;
-        html.enable = true;
-        phpactor = {
-          enable = true;
-          filetypes = [ "php" "blade" ];
-        };
-        nextls.enable = true;
-        nil_ls.enable = true;
-        tailwindcss.enable = true;
-        ts_ls = {
-          enable = true;
-          extraOptions.root_dir.__raw = ''
-            require("lspconfig.util").root_pattern("tsconfig.json", "jsconfig.json")
-          '';
-          extraOptions.single_file_support = false;
-        };
-        volar.enable = true;
-      };
-    };
-  };
-}

+ 160 - 0
home/features/nvim/mapping.nix

@@ -0,0 +1,160 @@
+{ lib
+, ...
+}:
+let
+  inherit (lib.nixvim) mkRaw;
+  keyMap = mode: key: action: options: { inherit mode key action options; };
+in
+{
+  keymaps = [
+    (keyMap "i" "<C-b>" "<ESC>^i" { desc = "move beginning of line"; })
+    (keyMap "i" "<C-e>" "<End>" { desc = "move end of line"; })
+    (keyMap "i" "<C-h>" "<Left>" { desc = "move left"; })
+    (keyMap "i" "<C-l>" "<Right>" { desc = "move right"; })
+    (keyMap "i" "<C-j>" "<Down>" { desc = "move down"; })
+    (keyMap "i" "<C-k>" "<Up>" { desc = "move up"; })
+
+    (keyMap "v" "K" ":m '<-2<CR>gv=gv" { desc = "move highlighted block up"; })
+    (keyMap "v" "J" ":m '>+1<CR>gv=gv" { desc = "move highlighted block down"; })
+
+    (keyMap "n" "J" "mzJ`z" { desc = "join lines without losing cursor position"; })
+
+    (keyMap "n" "<C-h>" "<C-w>h" { desc = "switch window left"; })
+    (keyMap "n" "<C-l>" "<C-w>l" { desc = "switch window right"; })
+    (keyMap "n" "<C-j>" "<C-w>j" { desc = "switch window down"; })
+    (keyMap "n" "<C-k>" "<C-w>k" { desc = "switch window up"; })
+
+    (keyMap "n" "<Esc>" "<cmd>noh<CR>" { desc = "general clear highlights"; })
+
+    (keyMap "n" "<C-s>" "<cmd>w<CR>" { desc = "general save file"; })
+    (keyMap "n" "<C-c>" "<cmd>%y+<CR>" { desc = "general copy whole file"; })
+
+    (keyMap "n" "<leader>n" "<cmd>set nu!<CR>" { desc = "toggle line number"; })
+    (keyMap "n" "<leader>rn" "<cmd>set rnu!<CR>" { desc = "toggle relative number"; })
+    (keyMap "n" "<leader>ch" "<cmd>NvCheatsheet<CR>" { desc = "toggle nvcheatsheet"; })
+
+    (keyMap [ "n" "x" ] "<leader>fm"
+      (mkRaw ''
+        function ()
+          require("conform").format { lsp_fallback = true }
+        end
+      '')
+      { desc = "general format file"; })
+
+    # global lsp keyMappings
+    (keyMap "n" "<leader>ds" (mkRaw ''vim.diagnostic.setloclist'') { desc = "LSP diagnostic loclist"; })
+
+    # -- tabufline
+    (keyMap "n" "<leader>b" "<cmd>enew<CR>" { desc = "buffer new"; })
+
+    (keyMap "n" "<tab>"
+      (mkRaw ''
+        function()
+          require("nvchad.tabufline").next()
+        end
+      '')
+      { desc = "buffer goto next"; })
+
+    (keyMap "n" "<S-tab>"
+      (mkRaw ''
+        function()
+          require("nvchad.tabufline").prev()
+        end
+      '')
+      { desc = "buffer goto prev"; })
+
+    (keyMap "n" "<leader>x"
+      (mkRaw ''
+        function()
+          require("nvchad.tabufline").close_buffer()
+        end
+      '')
+      { desc = "buffer close"; })
+
+    # Comment
+    (keyMap "n" "<leader>/" "gcc" { desc = "toggle comment"; remap = true; })
+    (keyMap "v" "<leader>/" "gc" { desc = "toggle comment"; remap = true; })
+
+    # nvimtree
+    (keyMap "n" "<C-n>" "<cmd>NvimTreeToggle<CR>" { desc = "nvimtree toggle window"; })
+    (keyMap "n" "<leader>e" "<cmd>NvimTreeFocus<CR>" { desc = "nvimtree focus window"; })
+
+    # telescope
+    (keyMap "n" "<leader>fw" "<cmd>Telescope live_grep<CR>" { desc = "telescope live grep"; })
+    (keyMap "n" "<leader>fb" "<cmd>Telescope buffers<CR>" { desc = "telescope find buffers"; })
+    (keyMap "n" "<leader>fh" "<cmd>Telescope help_tags<CR>" { desc = "telescope help page"; })
+    (keyMap "n" "<leader>ma" "<cmd>Telescope marks<CR>" { desc = "telescope find marks"; })
+    (keyMap "n" "<leader>fo" "<cmd>Telescope oldfiles<CR>" { desc = "telescope find oldfiles"; })
+    (keyMap "n" "<leader>fz" "<cmd>Telescope current_buffer_fuzzy_find<CR>" { desc = "telescope find in current buffer"; })
+    (keyMap "n" "<leader>cm" "<cmd>Telescope git_commits<CR>" { desc = "telescope git commits"; })
+    (keyMap "n" "<leader>gt" "<cmd>Telescope git_status<CR>" { desc = "telescope git status"; })
+    (keyMap "n" "<leader>pt" "<cmd>Telescope terms<CR>" { desc = "telescope pick hidden term"; })
+
+    (keyMap "n" "<leader>th"
+      (mkRaw ''
+        function()
+          require("nvchad.themes").open()
+        end
+      '')
+      { desc = "telescope nvchad themes"; })
+
+    (keyMap "n" "<leader>ff" "<cmd>Telescope find_files<cr>" { desc = "telescope find files"; })
+    (keyMap "n" "<leader>fa" "<cmd>Telescope find_files follow=true no_ignore=true hidden=true<CR>" { desc = "telescope find all files"; })
+
+    # terminal
+    (keyMap "t" "<C-x>" "<C-\\><C-N>" { desc = "terminal escape terminal mode"; })
+
+    # new terminals
+    (keyMap "n" "<leader>h"
+      (mkRaw ''
+        function()
+          require("nvchad.term").new { pos = "sp" }
+        end
+      '')
+      { desc = "terminal new horizontal term"; })
+
+    (keyMap "n" "<leader>v"
+      (mkRaw ''
+        function()
+          require("nvchad.term").new { pos = "vsp" }
+        end
+      '')
+      { desc = "terminal new vertical term"; })
+
+    # toggleable
+    (keyMap [ "n" "t" ] "<A-v>"
+      (mkRaw ''
+        function()
+          require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" }
+        end
+      '')
+      { desc = "terminal toggleable vertical term"; })
+
+    (keyMap [ "n" "t" ] "<A-h>"
+      (mkRaw ''
+        function()
+          require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
+        end
+      '')
+      { desc = "terminal toggleable horizontal term"; })
+
+    (keyMap [ "n" "t" ] "<A-i>"
+      (mkRaw ''
+        function()
+          require("nvchad.term").toggle { pos = "float", id = "floatTerm" }
+        end
+      '')
+      { desc = "terminal toggle floating term"; })
+
+    # whichkey
+    (keyMap "n" "<leader>wK" "<cmd>WhichKey <CR>" { desc = "whichkey all keymaps"; })
+
+    (keyMap "n" "<leader>wk"
+      (mkRaw ''
+        function()
+          vim.cmd("WhichKey " .. vim.fn.input "WhichKey: ")
+        end
+      '')
+      { desc = "whichkey query lookup"; })
+  ];
+}

+ 0 - 71
home/features/nvim/mini.nix

@@ -1,71 +0,0 @@
-{
-  programs.nixvim = {
-    plugins.mini.enable = true;
-    plugins.mini.mockDevIcons = true;
-    plugins.mini.modules = {
-      comment = { };
-      diff = { };
-      icons = { };
-      indentscope = { };
-      notify = { };
-      statusline = { };
-
-      starter = {
-        content_hooks = {
-          "__unkeyed-1.adding_bullet" = {
-            __raw = "require('mini.starter').gen_hook.adding_bullet()";
-          };
-          "__unkeyed-2.indexing" = {
-            __raw = "require('mini.starter').gen_hook.indexing('all', { 'Builtin actions' })";
-          };
-          "__unkeyed-3.padding" = {
-            __raw = "require('mini.starter').gen_hook.aligning('center', 'center')";
-          };
-        };
-        evaluate_single = true;
-        header = ''
-
-
-
-
-                                    ░████ ░██                                              
-                                   ░██                                                     
-          ░█████████  ░███████  ░████████ ░██ ░███████       ░███████  ░██░████  ░████████ 
-               ░███  ░██    ░██    ░██    ░██░██    ░██     ░██    ░██ ░███     ░██    ░██ 
-             ░███    ░██    ░██    ░██    ░██░█████████     ░██    ░██ ░██      ░██    ░██ 
-           ░███      ░██    ░██    ░██    ░██░██            ░██    ░██ ░██      ░██   ░███ 
-          ░█████████  ░███████     ░██    ░██ ░███████  ░██  ░███████  ░██       ░█████░██ 
-                                                                                       ░██ 
-                                                                                 ░███████  
-                                                                                           
-
-
-
-        '';
-        items = {
-          "__unkeyed-1.buildtin_actions" = {
-            __raw = "require('mini.starter').sections.builtin_actions()";
-          };
-          "__unkeyed-2.recent_files_current_directory" = {
-            __raw = "require('mini.starter').sections.recent_files(10, false)";
-          };
-          "__unkeyed-3.recent_files" = {
-            __raw = "require('mini.starter').sections.recent_files(10, true)";
-          };
-        };
-      };
-
-      surround = {
-        mappings = {
-          add = "gsa";
-          delete = "gsd";
-          find = "gsf";
-          find_left = "gsF";
-          highlight = "gsh";
-          replace = "gsr";
-          update_n_lines = "gsn";
-        };
-      };
-    };
-  };
-}

+ 0 - 40
home/features/nvim/opencode.nix

@@ -1,40 +0,0 @@
-{ pkgs, ... }:
-{
-  home.packages = with pkgs; [ unstable.opencode ];
-
-  programs.nixvim = {
-    plugins.snacks.enable = true;
-    plugins.snacks.settings.terminal.enabled = true;
-
-    extraPlugins = with pkgs; [ unstable.vimPlugins.opencode-nvim ];
-
-    keymaps = [
-      {
-        key = "<leader>ot";
-        action = "<cmd>lua require('opencode').toggle()<CR>";
-      }
-      {
-        key = "<leader>oa";
-        action = "<cmd>lua require('opencode').ask()<CR>";
-        mode = "n";
-      }
-      {
-        key = "<leader>oa";
-        action = "<cmd>lua require('opencode').ask('@selection: ')<CR>";
-        mode = "v";
-      }
-      {
-        key = "<leader>oe";
-        action = "<cmd>lua require('opencode').select_prompt()<CR>";
-        mode = [
-          "n"
-          "v"
-        ];
-      }
-      {
-        key = "<leader>on";
-        action = "<cmd>lua require('opencode').command('session_new')<CR>";
-      }
-    ];
-  };
-}

+ 66 - 0
home/features/nvim/options.nix

@@ -0,0 +1,66 @@
+{
+
+  globals = {
+    mapleader = " ";
+    maplocalleader = " ";
+    have_nerd_font = true;
+
+    # disable some default providers
+    loaded_node_provider = 0;
+    loaded_python3_provider = 0;
+    loaded_perl_provider = 0;
+    loaded_ruby_provider = 0;
+
+    # auto-format rust on save
+    rustfmt_autosave = 1;
+  };
+
+  clipboard.register = "unnamedplus";
+
+  opts = {
+    laststatus = 3;
+    showmode = false;
+    splitkeep = "screen";
+
+    clipboard = "unnamedplus";
+    cursorline = true;
+    cursorlineopt = "number";
+
+    # Indenting
+    expandtab = true;
+    shiftwidth = 2;
+    smartindent = true;
+    tabstop = 2;
+    softtabstop = 2;
+
+    fillchars.eob = " ";
+    ignorecase = true;
+    smartcase = true;
+    mouse = "a";
+
+    # Numbers
+    number = true;
+    relativenumber = true;
+    numberwidth = 2;
+    ruler = false;
+
+    # disable nvim intro
+    # shortmess:append = "sI";
+
+    signcolumn = "yes";
+    splitbelow = true;
+    splitright = true;
+    timeoutlen = 400;
+    undofile = true;
+
+    # interval for writing swap file to disk, also used by gitsigns
+    updatetime = 250;
+    swapfile = false;
+    backup = false;
+
+    # go to previous/next line with h,l,left arrow and right arrow
+    # when cursor reaches end/beginning of line
+    # "whichwrap:append" = "<>[]hl";
+
+  };
+}

+ 30 - 0
home/features/nvim/plugins/base46.nix

@@ -0,0 +1,30 @@
+{ lib
+, ...
+}:
+lib.nixvim.plugins.mkVimPlugin {
+  name = "base46";
+  package = "base46";
+  globalPrefix = "base46_";
+  description = "NvChad's base46 theme plugin with caching ( Total re-write )";
+  maintainers = [ ];
+  extraOptions = {
+    luaConfig = lib.mkOption {
+      type = lib.types.submodule {
+        options = {
+          pre = lib.mkOption {
+            type = lib.types.lines;
+            default = "";
+            description = "Lua code to run before the plugin loads";
+          };
+
+          post = lib.mkOption {
+            type = lib.types.lines;
+            default = "";
+            description = "Lua code to run after the plugin loads";
+          };
+        };
+      };
+      default = { };
+    };
+  };
+}

+ 10 - 0
home/features/nvim/plugins/default.nix

@@ -0,0 +1,10 @@
+{
+  imports = [
+    ./base46.nix
+    ./nvchad.nix
+    ./nvzone-volt.nix
+    ./nvzone-menu.nix
+    ./nvzone-minty.nix
+    ./rust.nix
+  ];
+}

+ 216 - 0
home/features/nvim/plugins/nvchad.nix

@@ -0,0 +1,216 @@
+{ lib
+, ...
+}:
+let
+  inherit (lib) recursiveUpdate;
+  inherit (lib.nixvim) toLuaObject;
+
+  defaultConfig = {
+    base46 = {
+      theme = "onedark";
+      hl_add = [ ];
+      hl_override = [ ];
+      integrations = [ ];
+      changed_themes = [ ];
+      transparency = false;
+      theme_toggle = [
+        "onedark"
+        "one_light"
+      ];
+    };
+
+    ui = {
+      cmp = {
+        icons_left = false; # only for non-atom styles!
+        style = "default"; # default/flat_light/flat_dark/atom/atom_colored
+        abbr_maxwidth = 60;
+        # for tailwind, css lsp etc
+        format_colors = {
+          lsp = true;
+          icon = "󱓻";
+        };
+      };
+
+      telescope = {
+        style = "borderless";
+      }; # borderless / bordered
+
+      statusline = {
+        enabled = true;
+        theme = "default"; # default/vscode/vscode_colored/minimal
+        # default/round/block/arrow separators work only for default statusline theme
+        # round and block will work for minimal theme only
+        separator_style = "default";
+        order = null;
+        modules = null;
+      };
+
+      # lazyload it when there are 1+ buffers
+      tabufline = {
+        enabled = true;
+        lazyload = true;
+        order = [
+          "treeOffset"
+          "buffers"
+          "tabs"
+          "btns"
+        ];
+        modules = null;
+        bufwidth = 21;
+      };
+    };
+
+    nvdash = {
+      load_on_startup = false;
+
+      header = [
+        "                         "
+        "    ▄▄         ▄ ▄▄▄▄▄▄▄  "
+        "  ▄▀███▄     ▄██ █████▀   "
+        "  ██▄▀███▄   ███          "
+        "  ███  ▀███▄ ███          "
+        "  ███    ▀██ ███          "
+        "  ███      ▀ ███          "
+        "  ▀██ █████▄▀█▀▄██████▄   "
+        "    ▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀  "
+        "                         "
+        "    Powered By  eovim   "
+        "                         "
+      ];
+
+      buttons = [
+        {
+          txt = "  Find File";
+          keys = "ff";
+          cmd = "Telescope find_files";
+        }
+        {
+          txt = "  Recent Files";
+          keys = "fo";
+          cmd = "Telescope oldfiles";
+        }
+        {
+          txt = "󰈭  Find Word";
+          keys = "fw";
+          cmd = "Telescope live_grep";
+        }
+        {
+          txt = "󱥚  Themes";
+          keys = "th";
+          cmd = ":lua require('nvchad.themes').open()";
+        }
+        {
+          txt = "  Mappings";
+          keys = "ch";
+          cmd = "NvCheatsheet";
+        }
+
+        {
+          txt = "─";
+          hl = "NvDashFooter";
+          no_gap = true;
+          rep = true;
+        }
+
+        {
+          txt = "  Plugins managed by lz.n";
+          hl = "NvDashFooter";
+          no_gap = true;
+          content = "fit";
+        }
+
+        {
+          txt = "─";
+          hl = "NvDashFooter";
+          no_gap = true;
+          rep = true;
+        }
+      ];
+    };
+
+    term = {
+      startinsert = true;
+      base46_colors = true;
+      winopts = {
+        number = false;
+        relativenumber = false;
+      };
+      sizes = {
+        sp = 0.3;
+        vsp = 0.2;
+        "bo sp" = 0.3;
+        "bo vsp" = 0.2;
+      };
+      float = {
+        relative = "editor";
+        row = 0.3;
+        col = 0.25;
+        width = 0.5;
+        height = 0.4;
+        border = "single";
+      };
+    };
+
+    lsp = {
+      signature = true;
+    };
+
+    cheatsheet = {
+      theme = "grid"; # simple/grid
+      excluded_groups = [
+        "terminal (t)"
+        "autopairs"
+        "Nvim"
+        "Opens"
+      ]; # can add group name or with mode
+    };
+
+    colorify = {
+      enabled = true;
+      mode = "virtual"; # fg, bg, virtual
+      virt_text = "󱓻 ";
+      highlight = {
+        hex = true;
+        lspvars = true;
+      };
+    };
+  };
+in
+lib.nixvim.plugins.mkNeovimPlugin {
+  name = "nvchad";
+  package = "nvchad-ui";
+  description = "Lightweight & high performance UI plugin for nvchad";
+  maintainers = [ ];
+  callSetup = false;
+  settingsExample = defaultConfig;
+
+  extraConfig =
+    cfg:
+    let
+      # Deep merge: user settings override defaults
+      noLazy.nvdash.buttons = defaultConfig.nvdash.buttons;
+      finalConfig = recursiveUpdate noLazy (cfg.settings or { });
+    in
+    {
+      # Generate lua/chadrc.lua via extraFiles
+      extraFiles."lua/chadrc.lua" = {
+        text = ''
+          ---@type ChadrcConfig
+          local M = ${toLuaObject finalConfig}
+          return M
+        '';
+      };
+
+      # Initialize nvchad-ui after everything loads
+      extraConfigLuaPost = ''
+        require("nvchad")
+      '';
+
+      # Set base46 cache path early (required for themes/highlights)
+      extraConfigLuaPre = ''
+        vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46/"
+        dofile(vim.g.base46_cache .. "defaults")
+        dofile(vim.g.base46_cache .. "statusline")
+      '';
+    };
+}

+ 10 - 0
home/features/nvim/plugins/nvzone-menu.nix

@@ -0,0 +1,10 @@
+{ lib
+, ...
+}:
+lib.nixvim.plugins.mkNeovimPlugin {
+  name = "nvzone-menu";
+  package = "nvzone-menu";
+  description = "Menu plugin for neovim ( supports nested menus ) made using volt";
+  maintainers = [ ];
+  callSetup = false;
+}

+ 10 - 0
home/features/nvim/plugins/nvzone-minty.nix

@@ -0,0 +1,10 @@
+{ lib
+, ...
+}:
+lib.nixvim.plugins.mkNeovimPlugin {
+  name = "nvzone-minty";
+  package = "nvzone-minty";
+  description = "Most Beautifully crafted color tools for Neovim";
+  maintainers = [ ];
+  callSetup = false;
+}

+ 10 - 0
home/features/nvim/plugins/nvzone-volt.nix

@@ -0,0 +1,10 @@
+{ lib
+, ...
+}:
+lib.nixvim.plugins.mkNeovimPlugin {
+  name = "nvzone-volt";
+  package = "nvzone-volt";
+  description = "Create blazing fast & beautiful reactive UI in Neovim ";
+  maintainers = [ ];
+  callSetup = false;
+}

+ 9 - 0
home/features/nvim/plugins/rust.nix

@@ -0,0 +1,9 @@
+{ lib
+, ...
+}:
+lib.nixvim.plugins.mkVimPlugin {
+  name = "rust";
+  package = "rust-vim";
+  description = "Vim configuration for Rust.";
+  maintainers = [ ];
+}

+ 0 - 119
home/features/nvim/telescope.nix

@@ -1,119 +0,0 @@
-{
-  programs.nixvim = {
-    plugins.telescope = {
-      enable = true;
-
-      settings.pickers.find_files.follow = true;
-
-      extensions.media-files.enable = true;
-      extensions.media-files.settings.find_cmd = "rg";
-
-      extensions.fzf-native.enable = true;
-      extensions.ui-select.enable = true;
-    };
-
-    keymaps = [
-      {
-        mode = "n";
-        key = "<leader>sh";
-        action.__raw = "require('telescope.builtin').help_tags";
-        options.desc = "[S]earch [H]elp";
-      }
-      {
-        mode = "n";
-        key = "<leader>sk";
-        action.__raw = "require('telescope.builtin').keymaps";
-        options.desc = "[S]earch [K]eymaps";
-      }
-      {
-        mode = "n";
-        key = "<leader>sf";
-        action.__raw = "require('telescope.builtin').find_files";
-        options.desc = "[S]earch [F]iles";
-      }
-      {
-        mode = "n";
-        key = "<leader>ss";
-        action.__raw = "require('telescope.builtin').builtin";
-        options.desc = "[S]earch [S]elect Telescope";
-      }
-      {
-        mode = "n";
-        key = "<leader>sw";
-        action.__raw = "require('telescope.builtin').grep_string";
-        options.desc = "[S]earch current [W]ord";
-      }
-      {
-        mode = "n";
-        key = "<leader>sg";
-        action.__raw = "require('telescope.builtin').live_grep";
-        options.desc = "[S]earch by [G]rep";
-      }
-      {
-        mode = "n";
-        key = "<leader>s.";
-        action.__raw = "require('telescope.builtin').oldfiles";
-        options.desc = "[S]earch Recent Files (\".\" for repeat)";
-      }
-      {
-        mode = "n";
-        key = "<leader>sd";
-        action.__raw = "require('telescope.builtin').diagnostics";
-        options.desc = "[S]earch [D]iagnostics";
-      }
-      {
-        mode = "n";
-        key = "<leader>sr";
-        action.__raw = "require('telescope.builtin').resume";
-        options.desc = "[S]earch [R]esume";
-      }
-      {
-        mode = "n";
-        key = "<leader><leader>";
-        action.__raw = "require('telescope.builtin').buffers";
-        options.desc = "[ ] Find existing buffers";
-      }
-
-      {
-        mode = "n";
-        key = "<leader>/";
-        action.__raw = ''
-          function()
-            require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
-              winblend = 10,
-              previewer = false,
-            })
-          end
-        '';
-        options.desc = "[/] Fuzzily search in current buffer";
-      }
-
-      {
-        mode = "n";
-        key = "<leader>s/";
-        action.__raw = ''
-          function()
-            require('telescope.builtin').live_grep {
-              grep_open_files = true,
-              prompt_title = 'Live Grep in Open Files',
-            }
-          end
-        '';
-        options.desc = "[S]earch [/] in Open Files";
-      }
-
-      {
-        mode = "n";
-        key = "<leader>sn";
-        action.__raw = ''
-          function()
-            require('telescope.builtin').find_files {
-              cwd = vim.fn.stdpath 'config'
-            }
-          end
-        '';
-        options.desc = "[S]earch [N]eovim files";
-      }
-    ];
-  };
-}

+ 0 - 16
home/features/nvim/treesitter.nix

@@ -1,16 +0,0 @@
-{
-  programs.nixvim.plugins.treesitter = {
-    enable = true;
-    settings.ensure_installed = "all";
-    settings.ignore_install = [
-      "norg"
-      "ipkg"
-    ];
-    settings.highlight.enable = true;
-    settings.highlight.disable = [ ];
-    settings.incremental_selection.enable = true;
-    settings.indent.enable = true;
-    nixvimInjections = true;
-  };
-  programs.nixvim.plugins.treesitter-context.enable = true;
-}

+ 0 - 46
home/features/nvim/which-key.nix

@@ -1,46 +0,0 @@
-{
-  programs.nixvim = {
-    plugins.which-key.enable = true;
-    plugins.which-key.settings.spec = [
-      {
-        __unkeyed-1 = "<leader>c";
-        group = "[C]ode";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>d";
-        group = "[D]ocuments";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>r";
-        group = "[R]ename";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>s";
-        group = "[S]earch";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>w";
-        group = "[W]orkspace";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>t";
-        group = "[T]oggle";
-        icon = "󰄄 ";
-      }
-      {
-        __unkeyed-1 = "<leader>h";
-        group = "Git [H]unk";
-        icon = "󰄄 ";
-        mode = [
-          "n"
-          "v"
-        ];
-      }
-    ];
-  };
-}