diff --git a/home/common/core/nixvim/plugins/default.nix b/home/common/core/nixvim/plugins/default.nix index 0397ee1..bc87197 100644 --- a/home/common/core/nixvim/plugins/default.nix +++ b/home/common/core/nixvim/plugins/default.nix @@ -23,6 +23,7 @@ in { ./todo-comments.nix ./oil.nix ./comment.nix + ./git-workree.nix ]; programs.nixvim.plugins.web-devicons.enable = true; diff --git a/home/common/core/nixvim/plugins/git-workree.nix b/home/common/core/nixvim/plugins/git-workree.nix index 3c2bbff..53cc72e 100644 --- a/home/common/core/nixvim/plugins/git-workree.nix +++ b/home/common/core/nixvim/plugins/git-workree.nix @@ -1,11 +1,44 @@ +{pkgs, ...}: { - programs.nixvim.plugins.git-worktree = { - enable = true; - enableTelescope = true; - autopush = true; - changeDirectoryCommand = "cd"; - clearJumpsOnChange = true; - updateOnChange = true; - updateOnChangeCommand = "e ."; - }; + programs.nixvim.keymaps = [ + # Switching worktrees + { + mode = ["n"]; + key = "fws"; + action = "lua require('telescope').extensions.git_worktree.git_worktrees()"; + options = {noremap = true;}; + } + { + mode = ["n"]; + key = "fwc"; + action = "lua require('telescope').extensions.git_worktree.create_git_worktree()"; + options = {noremap = true;}; + } + ]; + + programs.nixvim.extraPlugins = [ + + (pkgs.vimUtils.buildVimPlugin + { + name = "git-worktree.nvim"; + src = pkgs.fetchFromGitHub { + owner = "glow.nvim"; + repo = "git-worktree.nvim"; + rev = "bac72c2"; + sha256 = ""; + }; + }) + ]; + + programs.nixvim.extraConfigLua = '' + ''; + # programs.nixvim.plugins.git-worktree = { + # enable = true; + # enableTelescope = true; + # autopush = true; + # changeDirectoryCommand = "cd"; + # clearJumpsOnChange = true; + # updateOnChange = true; + # updateOnChangeCommand = "e ."; + # }; } diff --git a/home/common/core/nixvim/plugins/telescope.nix b/home/common/core/nixvim/plugins/telescope.nix index e35310a..728a828 100644 --- a/home/common/core/nixvim/plugins/telescope.nix +++ b/home/common/core/nixvim/plugins/telescope.nix @@ -46,5 +46,12 @@ action = "Telescope oldfiles"; options = {noremap = true;}; } + { + # show recently opened files + mode = ["n"]; + key = "fk"; + action = "Telescope keymaps"; + options = {noremap = true;}; + } ]; }