diff --git a/modules/home/apps/cli-apps/fish/default.nix b/modules/home/apps/cli-apps/fish/default.nix index 0fae2e5..0d72f49 100644 --- a/modules/home/apps/cli-apps/fish/default.nix +++ b/modules/home/apps/cli-apps/fish/default.nix @@ -26,6 +26,7 @@ in { shellInit = " zoxide init fish | source starship init fish | source + source ~/.config/op/plugins.sh "; shellAliases = { vim = "nvim"; diff --git a/modules/nixos/apps/cli-apps/nixvim/default.nix b/modules/nixos/apps/cli-apps/nixvim/default.nix index 10d83e3..6a85a93 100644 --- a/modules/nixos/apps/cli-apps/nixvim/default.nix +++ b/modules/nixos/apps/cli-apps/nixvim/default.nix @@ -26,6 +26,163 @@ in { relativenumber = true; shiftwidth = 2; }; + + keymaps = [ + { + action = "Ex"; + key = "e"; + options.desc = "Open Explorer"; + } + { + mode = "n"; + action = "w"; + key = ""; + options.desc = "Save"; + } + { + mode = "n"; + action = "noh"; + key = ""; + options.silent = true; + } + { + mode = "n"; + action = "UndotreeToggle"; + key = "ut"; + options.desc = "Toggle Undotree"; + } + { + mode = "n"; + action = "UndotreeToggle"; + key = "uf"; + options.desc = "Focus Undotree"; + } + ]; + + plugins = { + telescope = { + enable = true; + keymaps = { + "sr" = { + action = "oldfiles"; + desc = "[s]earch [r]ecent"; + }; + + "sk" = { + action = "keymaps"; + desc = "[s]earch [k]eys"; + }; + + "sg" = { + action = "live_grep"; + desc = "[s]earch [g]rep"; + }; + }; + }; + + harpoon = { + enable = true; + enableTelescope = true; + keymaps = { + addFile = "a"; + toggleQuickMenu = "ha"; + navFile = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + }; + }; + }; + + treesitter = { + enable = true; + }; + + luasnip.enable = true; + + lualine.enable = true; + + lsp = { + enable = true; + + servers = { + nixd.enable = true; + }; + keymaps = { + lspBuf = { + "K" = "hover"; + "gf" = "references"; + "gd" = "definition"; + "gi" = "implementation"; + "gt" = "type_definition"; + }; + }; + }; + + lsp-format = { + enable = true; + setup = { + nix = { + }; + }; + }; + + nvim-cmp = { + enable = true; + autoEnableSources = true; + sources = [ + { + name = "nvim_lsp"; + } + { + name = "luasnip"; + } + { + name = "path"; + } + { + name = "buffer"; + } + ]; + mapping = { + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = { + modes = ["i" "s"]; + action = "cmp.mapping.select_next_item()"; + }; + "" = { + modes = ["i" "s"]; + action = "cmp.mapping.select_prev_item()"; + }; + "" = "cmp.mapping.confirm({ select = true })"; + }; + }; + + + rainbow-delimiters = { + enable = true; + }; + nvim-colorizer.enable = true; + + undotree.enable = true; + + which-key = { + enable = true; + registrations = { + "K" = "Code hover"; + "gf" = "Code references"; + "gd" = "Code definitions"; + "gi" = "Implementations"; + "gt" = "Type definition"; + }; + }; + + trouble.enable = true; + + markdown-preview.enable = true; + }; }; }; }