From bb6eb4c6d2349d1392aad72f3ad950c8626e7463 Mon Sep 17 00:00:00 2001 From: notohh Date: Wed, 11 Dec 2024 15:54:43 -0500 Subject: [PATCH] neovim: update plugins [WIP] --- .../editors/neovim/plugins/default.nix | 1 + .../neovim/plugins/editor/autoclose.nix | 4 +- .../neovim/plugins/editor/treesitter.nix | 15 +++- .../editors/neovim/plugins/lsp/lsp.nix | 3 + .../editors/neovim/plugins/misc/presence.nix | 5 +- .../editors/neovim/plugins/ui/whichkey.nix | 90 +++++++++++++++++++ 6 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 home/programs/editors/neovim/plugins/ui/whichkey.nix diff --git a/home/programs/editors/neovim/plugins/default.nix b/home/programs/editors/neovim/plugins/default.nix index 719b4f6..9c695b5 100644 --- a/home/programs/editors/neovim/plugins/default.nix +++ b/home/programs/editors/neovim/plugins/default.nix @@ -23,6 +23,7 @@ _: { ./ui/fidget.nix ./ui/dashboard.nix ./ui/toggleterm.nix + ./ui/whichkey.nix ]; programs.nixvim.plugins.web-devicons.enable = true; } diff --git a/home/programs/editors/neovim/plugins/editor/autoclose.nix b/home/programs/editors/neovim/plugins/editor/autoclose.nix index c217c06..3802ad6 100644 --- a/home/programs/editors/neovim/plugins/editor/autoclose.nix +++ b/home/programs/editors/neovim/plugins/editor/autoclose.nix @@ -1,5 +1,3 @@ _: { - programs.nixvim.plugins.autoclose = { - enable = true; - }; + programs.nixvim.plugins.nvim-autopairs.enable = true; } diff --git a/home/programs/editors/neovim/plugins/editor/treesitter.nix b/home/programs/editors/neovim/plugins/editor/treesitter.nix index 869456f..baee549 100644 --- a/home/programs/editors/neovim/plugins/editor/treesitter.nix +++ b/home/programs/editors/neovim/plugins/editor/treesitter.nix @@ -1,4 +1,16 @@ -{pkgs, ...}: { +{pkgs, ...}: let + treesitter-nu-grammar = pkgs.tree-sitter.buildGrammar { + language = "nu"; + version = "0.0.0+rev=1561a94"; + src = pkgs.fetchFromGitHub { + owner = "nushell"; + repo = "tree-sitter-nu"; + rev = "1561a947a5505d373e11ca337898e048ac2e389e"; + hash = "sha256-RAAMBVov4q8b8MJZVlf1qwbLK8hE5AxPK1IV9TMCrTs="; + }; + meta.homepage = "https://github.com/nushell/tree-sitter-nu"; + }; +in { programs.nixvim.plugins.treesitter = { enable = true; grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ @@ -14,6 +26,7 @@ rust go gomod + treesitter-nu-grammar ]; settings = { highlight.enable = true; diff --git a/home/programs/editors/neovim/plugins/lsp/lsp.nix b/home/programs/editors/neovim/plugins/lsp/lsp.nix index 00bee59..18a05b3 100644 --- a/home/programs/editors/neovim/plugins/lsp/lsp.nix +++ b/home/programs/editors/neovim/plugins/lsp/lsp.nix @@ -34,6 +34,9 @@ _: { nushell = { enable = true; }; + lua_ls = { + enable = true; + }; }; }; }; diff --git a/home/programs/editors/neovim/plugins/misc/presence.nix b/home/programs/editors/neovim/plugins/misc/presence.nix index da9b401..02cf605 100644 --- a/home/programs/editors/neovim/plugins/misc/presence.nix +++ b/home/programs/editors/neovim/plugins/misc/presence.nix @@ -5,8 +5,11 @@ ]; extraConfigLua = '' require('cord').setup { + timer = { + interval = 500, + }, editor = { - tooltip = 'Neovim' + tooltip = 'Neovim', }, display = { show_time = true, diff --git a/home/programs/editors/neovim/plugins/ui/whichkey.nix b/home/programs/editors/neovim/plugins/ui/whichkey.nix new file mode 100644 index 0000000..350c384 --- /dev/null +++ b/home/programs/editors/neovim/plugins/ui/whichkey.nix @@ -0,0 +1,90 @@ +_: { + programs.nixvim.plugins.which-key = { + enable = true; + settings = { + preset = "helix"; + replace = { + desc = [ + [ + "" + "SPACE" + ] + [ + "" + "SPACE" + ] + [ + "<[cC][rR]>" + "RETURN" + ] + [ + "<[tT][aA][bB]>" + "TAB" + ] + [ + "<[bB][sS]>" + "BACKSPACE" + ] + ]; + spec = [ + { + __unkeyed-1 = "b"; + group = "Buffers"; + icon = "󰓩 "; + } + { + __unkeyed = "c"; + group = "Codesnap"; + icon = "󰄄 "; + mode = "v"; + } + { + __unkeyed-1 = "bs"; + group = "Sort"; + icon = "󰒺 "; + } + { + __unkeyed-1 = [ + { + __unkeyed-1 = "f"; + group = "Normal Visual Group"; + } + { + __unkeyed-1 = "f"; + group = "Normal Visual Group in Group"; + } + ]; + mode = [ + "n" + "v" + ]; + } + { + __unkeyed-1 = "w"; + group = "windows"; + proxy = ""; + } + { + __unkeyed-1 = "cS"; + __unkeyed-2 = "CodeSnapSave"; + desc = "Save"; + mode = "v"; + } + { + __unkeyed-1 = "db"; + __unkeyed-2 = { + __raw = '' + function() + require("dap").toggle_breakpoint() + end + ''; + }; + desc = "Breakpoint toggle"; + mode = "n"; + silent = true; + } + ]; + }; + }; + }; +}