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 new file mode 100644 index 0000000..b0085d1 --- /dev/null +++ b/home/common/core/nixvim/plugins/git-workree.nix @@ -0,0 +1,26 @@ +{ + 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.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;}; + } ]; }