From d4808d9572de15fa526452c0bd59c199ae31709e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 18 Sep 2023 11:49:35 +0200 Subject: Add git-worktree --- fnl/plugins/editor/git-worktree.fnl | 17 +++++++++++++++++ fnl/plugins/editor/telescope.fnl | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 fnl/plugins/editor/git-worktree.fnl (limited to 'fnl/plugins/editor') diff --git a/fnl/plugins/editor/git-worktree.fnl b/fnl/plugins/editor/git-worktree.fnl new file mode 100644 index 0000000..508d42a --- /dev/null +++ b/fnl/plugins/editor/git-worktree.fnl @@ -0,0 +1,17 @@ +;; Plugins for working with git-worktrees. + +(local keys [{1 :ge + 2 "lua require('telescope').extensions.git_worktree.git_worktrees()" + :mode :n + :desc "Switch between worktrees"} + {1 :gi + 2 "lua require('telescope').extensions.git_worktree.create_git_worktree()" + :mode :n + :desc "Create a worktree"}]) + +{1 :ThePrimeagen/git-worktree.nvim + :event :VeryLazy + : keys + :init (fn [] + (let [telescope (require :telescope)] + (telescope.load_extension :git_worktree)))} diff --git a/fnl/plugins/editor/telescope.fnl b/fnl/plugins/editor/telescope.fnl index c823474..dafb48c 100644 --- a/fnl/plugins/editor/telescope.fnl +++ b/fnl/plugins/editor/telescope.fnl @@ -19,7 +19,7 @@ {1 :fS 2 "Telescope grep_string theme=dropdown" :desc "Find String"} - {1 :fb + {1 :gb 2 "Telescope git_branches theme=dropdown" :desc "Checkout Branch"} {1 :ff 2 :FindFiles :desc "Find files"} @@ -44,7 +44,7 @@ {1 :js 2 "Telescope diagnostics theme=dropdown" :desc "Telescope Diagnostics"} - {1 :fc + {1 :gc 2 "Telescope git_commits theme=dropdown" :desc "Checkout Commit"} {1 :lS -- cgit v1.2.3-70-g09d2