From 4ee876d8ef866bd42c123b07d36107fc70a0679b Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 29 Nov 2023 15:52:16 +0100 Subject: [PATCH] nvim: Plugin changes --- flake.lock | 38 +++++------ home/config/nvim/nifoc/keymap.fnl | 12 +++- home/config/nvim/plugins/mini.fnl | 27 -------- home/config/nvim/plugins/todo-comments.fnl | 2 + home/config/nvim/plugins/which-key.fnl | 1 + home/programs/nvim/default.nix | 22 ++++-- home/programs/nvim/plugins.nix | 79 +++++++++++++++------- home/programs/nvim/plugins.yaml | 5 +- 8 files changed, 109 insertions(+), 77 deletions(-) delete mode 100644 home/config/nvim/plugins/mini.fnl create mode 100644 home/config/nvim/plugins/todo-comments.fnl create mode 100644 home/config/nvim/plugins/which-key.fnl diff --git a/flake.lock b/flake.lock index a58b95b..b033b31 100644 --- a/flake.lock +++ b/flake.lock @@ -13,11 +13,11 @@ ] }, "locked": { - "lastModified": 1696775529, - "narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=", + "lastModified": 1701216516, + "narHash": "sha256-jKSeJn+7hZ1dZdiH1L+NWUGT2i/BGomKAJ54B9kT06Q=", "owner": "ryantm", "repo": "agenix", - "rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4", + "rev": "13ac9ac6d68b9a0896e3d43a082947233189e247", "type": "github" }, "original": { @@ -287,11 +287,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1701150737, - "narHash": "sha256-yM9nRmr07ByKuwMieqxDccdcHz5ZK7E2EYB8oeMz1NM=", + "lastModified": 1701213733, + "narHash": "sha256-sTUFA4n+A3vU1eOoO/6jgSUjg/xWilUw5Ju1ZdqZsxY=", "owner": "neovim", "repo": "neovim", - "rev": "570367ac83cdceeee7d43dadcff7652bd5cc93c5", + "rev": "8868ecd401f6a45d005fe68c57fbba79d32af192", "type": "github" }, "original": { @@ -312,11 +312,11 @@ ] }, "locked": { - "lastModified": 1701158360, - "narHash": "sha256-FW2ItGTvpVD+2kbZa7ABU9GL/BC85t4tIMBOCSXRNB8=", + "lastModified": 1701256439, + "narHash": "sha256-hvTFIaFOXwgyHvlRcSnqxj7C4fnrTc43oCHNdhW29kE=", "ref": "refs/heads/master", - "rev": "9da473e5b5ebd96bb9c5e0b7ce9c4db10108ab25", - "revCount": 600, + "rev": "8d3075fa95b6b67317619569c625ccaea2c2e2f7", + "revCount": 602, "type": "git", "url": "https://git.kempkens.io/daniel/nix-overlay" }, @@ -347,11 +347,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1701020860, - "narHash": "sha256-NwnRn04C8s+hH+KdVtGmVB1FFNIG7DtPJmQSCBDaET4=", + "lastModified": 1701250978, + "narHash": "sha256-ohu3cz4edjpGxs2qUTgbs0WrnewOX4crnUJNEB6Jox4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b006ec52fce23b1d57f6ab4a42d7400732e9a0a2", + "rev": "8772491ed75f150f02552c60694e1beff9f46013", "type": "github" }, "original": { @@ -363,11 +363,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1701127912, - "narHash": "sha256-x/UtyZX/ep6YVENzwcLn+71rwhl70vnUZTuZq7/XFYg=", + "lastModified": 1701239926, + "narHash": "sha256-k5R3QQJMGU11nhTPctbpqWenAkRnqngH5VnGMQCtHyg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c76b72caa421e31d998e4a05387ebd3b40454327", + "rev": "e2fa3d60550627938495aa368a1d4635c9cf64ff", "type": "github" }, "original": { @@ -379,11 +379,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701040486, - "narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=", + "lastModified": 1701174899, + "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "45827faa2132b8eade424f6bdd48d8828754341a", + "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", "type": "github" }, "original": { diff --git a/home/config/nvim/nifoc/keymap.fnl b/home/config/nvim/nifoc/keymap.fnl index e87c346..6172779 100644 --- a/home/config/nvim/nifoc/keymap.fnl +++ b/home/config/nvim/nifoc/keymap.fnl @@ -8,6 +8,7 @@ telescope-dropdown (telescope-themes.get_dropdown) npairs (require :nvim-autopairs) gitsigns (require :gitsigns) + wk (require :which-key) repl (require :nifoc.repl) formatting (require :nifoc.formatting)] (fn mod.setup [] @@ -61,6 +62,11 @@ (keymap.set :i : :w) (keymap.set :i : :^) (keymap.set :i : :$) + (keymap.set :n : "MoveLine -1" {:noremap true :silent true}) + (keymap.set :n : "MoveLine 1" {:noremap true :silent true}) + (keymap.set :x : "MoveBlock -1" {:noremap true :silent true}) + (keymap.set :x : "MoveBlock 1" + {:noremap true :silent true}) (keymap.set :n :p "(YankyPutAfter)") (keymap.set :n :P "(YankyPutBefore)") (keymap.set :x :p substitute.visual) @@ -71,7 +77,11 @@ (keymap.set :x :gP "(YankyGPutBefore)") (keymap.set :n :y "(YankyYank)") (keymap.set :x :y "(YankyYank)") - (keymap.set :n "-" :Oil {:desc "Open Oil"})) + (keymap.set :n "-" :Oil {:desc "Open Oil"}) + ;; Label + (wk.register {:v {:name :+vcs} + :l {:name :+list/lsp} + :d {:name :+debug}})) (fn mod.lsp-attach [_client bufnr] (keymap.set :n :t diff --git a/home/config/nvim/plugins/mini.fnl b/home/config/nvim/plugins/mini.fnl deleted file mode 100644 index 5b073e9..0000000 --- a/home/config/nvim/plugins/mini.fnl +++ /dev/null @@ -1,27 +0,0 @@ -(let [miniclue (require :mini.clue) - hipatterns (require :mini.hipatterns)] - ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md - ((. (require :mini.ai) :setup) {}) - ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-clue.md - (miniclue.setup {:triggers [; Leader - {:mode :n :keys :} - {:mode :x :keys :}] - :clues [(miniclue.gen_clues.builtin_completion)]}) - ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md - (hipatterns.setup {:highlighters {: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} - :hex_color (hipatterns.gen_highlighter.hex_color)}}) - ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md - ((. (require :mini.jump2d) :setup) {:hooks {:before_start (fn [] - (vim.cmd :nohlsearch))}}) - ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md - ((. (require :mini.move) :setup) {:mappings {:down : - :up : - :line_down : - :line_up :}})) diff --git a/home/config/nvim/plugins/todo-comments.fnl b/home/config/nvim/plugins/todo-comments.fnl new file mode 100644 index 0000000..15e576d --- /dev/null +++ b/home/config/nvim/plugins/todo-comments.fnl @@ -0,0 +1,2 @@ +(let [todo-comments (require :todo-comments)] + (todo-comments.setup {:signs false})) diff --git a/home/config/nvim/plugins/which-key.fnl b/home/config/nvim/plugins/which-key.fnl new file mode 100644 index 0000000..a4d8195 --- /dev/null +++ b/home/config/nvim/plugins/which-key.fnl @@ -0,0 +1 @@ +(let [wk (require :which-key)] (wk.setup {})) diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 9fb248c..b8f5b12 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -110,12 +110,6 @@ in popup-nvim plenary-nvim - { - plugin = mini-nvim; - config = builtins.readFile ../../config/nvim/plugins/mini.fnl; - type = "fennel"; - } - nvim-web-devicons { @@ -124,6 +118,8 @@ in type = "fennel"; } + vim-cool + # Keybindings { plugin = yanky-nvim; @@ -143,6 +139,8 @@ in type = "fennel"; } + move-nvim + # Themes dracula-nvim @@ -161,6 +159,12 @@ in type = "fennel"; } + { + plugin = todo-comments-nvim; + config = builtins.readFile ../../config/nvim/plugins/todo-comments.fnl; + type = "fennel"; + } + playground # Telescope @@ -318,6 +322,12 @@ in config = builtins.readFile ../../config/nvim/plugins/fidget.fnl; type = "fennel"; } + + { + plugin = which-key-nvim; + config = builtins.readFile ../../config/nvim/plugins/which-key.fnl; + type = "fennel"; + } ] ++ optionals isDarwin [ { plugin = pkgs.vimPlugins.cmp-tabnine; diff --git a/home/programs/nvim/plugins.nix b/home/programs/nvim/plugins.nix index f95de96..77bd0f0 100644 --- a/home/programs/nvim/plugins.nix +++ b/home/programs/nvim/plugins.nix @@ -27,17 +27,6 @@ in fetchSubmodules = false; }; }; - mini-nvim = buildVimPlugin { - pname = "mini.nvim"; - version = "2023-11-28"; - src = fetchFromGitHub { - owner = "echasnovski"; - repo = "mini.nvim"; - rev = "964fab7fecd14f66a69a96162f8aa816480690fd"; - sha256 = "1vxbjidpxhjbrbhg5kl4x4dcsn77nfybzbnlq4yjcpcsrmf8ms5i"; - fetchSubmodules = false; - }; - }; nvim-web-devicons = buildVimPlugin { pname = "nvim-web-devicons"; version = "2023-11-27"; @@ -60,6 +49,17 @@ in fetchSubmodules = false; }; }; + vim-cool = buildVimPlugin { + pname = "vim-cool"; + version = "2023-09-06"; + src = fetchFromGitHub { + owner = "romainl"; + repo = "vim-cool"; + rev = "662e7b11064cbeedad17c45d2fe926e78d3cd0b6"; + sha256 = "1ilddllx5riyzw4dx05rnvcxgngg7y2iydnkjn01wlddmid65p9k"; + fetchSubmodules = false; + }; + }; yanky-nvim = buildVimPlugin { pname = "yanky.nvim"; version = "2023-11-27"; @@ -93,6 +93,17 @@ in fetchSubmodules = false; }; }; + move-nvim = buildVimPlugin { + pname = "move.nvim"; + version = "2023-10-25"; + src = fetchFromGitHub { + owner = "hinell"; + repo = "move.nvim"; + rev = "30047fbb4ee0f3b79bf969d37d889085e96b44e6"; + sha256 = "1z0k361n41md768jxk9sngx06lv93hcnss64k7h5clg5khxf6pzg"; + fetchSubmodules = false; + }; + }; dracula-nvim = buildVimPlugin { pname = "dracula.nvim"; version = "2023-10-26"; @@ -106,12 +117,12 @@ in }; nvim-treesitter = buildVimPlugin { pname = "nvim-treesitter"; - version = "2023-11-28"; + version = "2023-11-29"; src = fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter"; - rev = "582a92ee120532a603b75239f40cba06b9a5ec07"; - sha256 = "0xwdakmd6cjks284a399civhbj195mmlk28yzzv0bxjxa9y9q6af"; + rev = "8f16c39f5b439bd9540336c4d5da705d180e34b9"; + sha256 = "06qka2mzxqk379dk5dlgrmx1g898xyp1fdbwn4gii81ag4mpmigj"; fetchSubmodules = false; }; }; @@ -137,6 +148,17 @@ in fetchSubmodules = false; }; }; + todo-comments-nvim = buildVimPlugin { + pname = "todo-comments.nvim"; + version = "2023-10-25"; + src = fetchFromGitHub { + owner = "folke"; + repo = "todo-comments.nvim"; + rev = "4a6737a8d70fe1ac55c64dfa47fcb189ca431872"; + sha256 = "1wf19rahk713qv834gpaw18w8a4ydl44m6jz6l933ns89q1kakk7"; + fetchSubmodules = false; + }; + }; playground = buildVimPlugin { pname = "playground"; version = "2023-09-15"; @@ -219,12 +241,12 @@ in }; nvim-jdtls = buildVimPlugin { pname = "nvim-jdtls"; - version = "2023-11-21"; + version = "2023-11-28"; src = fetchFromGitHub { owner = "mfussenegger"; repo = "nvim-jdtls"; - rev = "44403b2ef6c6285cfd9a3b4fa9a0d746ddae4b45"; - sha256 = "0d6icxcy9rx7dcdx821apwz1mrdl3vr3s547y9xw1m7idljij1cv"; + rev = "66b5ace68a5d1c45fdfb1afa8d847e87af2aa1f8"; + sha256 = "1cycasjvms1m58vcb3sk01dp4dzjjchds20yq0c6vq1s98wir0y6"; fetchSubmodules = false; }; }; @@ -494,23 +516,34 @@ in }; gitsigns-nvim = buildVimPlugin { pname = "gitsigns.nvim"; - version = "2023-11-28"; + version = "2023-11-29"; src = fetchFromGitHub { owner = "lewis6991"; repo = "gitsigns.nvim"; - rev = "175e74f87d3d2e4d20952d390af5f2a794f5ed7e"; - sha256 = "1s131xr3vvfr5a19nvf1f7330bjzn6yj615q7yi0z7wr1s6kndp4"; + rev = "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2"; + sha256 = "086jmhzgpavwjvp7ssd8ga0wxgnz480zzjiv84h4ivva2nv3lnvi"; fetchSubmodules = false; }; }; fidget-nvim = buildVimPlugin { pname = "fidget.nvim"; - version = "2023-11-27"; + version = "2023-11-28"; src = fetchFromGitHub { owner = "j-hui"; repo = "fidget.nvim"; - rev = "5eb5bf68bcdcd45940ad3d7155c0630476ee63cc"; - sha256 = "0x3pgghbhysc7ix543zi3w0w3gfjl9z11skx56vjy6gkw1vkd08z"; + rev = "785efc604f6ffe3c3fdd2ea86262804d48863ee1"; + sha256 = "01c0pcfvr2acpc70ljmr2dcmg6mvfyvsr9inxgwxv347pdi8phll"; + fetchSubmodules = false; + }; + }; + which-key-nvim = buildVimPlugin { + pname = "which-key.nvim"; + version = "2023-10-20"; + src = fetchFromGitHub { + owner = "folke"; + repo = "which-key.nvim"; + rev = "4433e5ec9a507e5097571ed55c02ea9658fb268a"; + sha256 = "1inm7szfhji6l9k4khq9fvddbwj348gilgbd6b8nlygd7wz23y5s"; fetchSubmodules = false; }; }; diff --git a/home/programs/nvim/plugins.yaml b/home/programs/nvim/plugins.yaml index 91d155d..18fc704 100644 --- a/home/programs/nvim/plugins.yaml +++ b/home/programs/nvim/plugins.yaml @@ -1,19 +1,21 @@ # Utils - src: nvim-lua/popup.nvim - src: nvim-lua/plenary.nvim -- src: echasnovski/mini.nvim - src: kyazdani42/nvim-web-devicons - src: willothy/wezterm.nvim +- src: romainl/vim-cool # Keybindings - src: gbprod/yanky.nvim - src: gbprod/cutlass.nvim - src: gbprod/substitute.nvim +- src: hinell/move.nvim # Themes - src: Mofiqul/dracula.nvim # Syntax - src: nvim-treesitter/nvim-treesitter - src: NoahTheDuke/vim-just - src: HiPhish/rainbow-delimiters.nvim +- src: folke/todo-comments.nvim - src: nvim-treesitter/playground # Telescope - src: nvim-telescope/telescope.nvim @@ -60,3 +62,4 @@ - src: axieax/urlview.nvim - src: lewis6991/gitsigns.nvim - src: j-hui/fidget.nvim +- src: folke/which-key.nvim