From c8b43e3298711a13751252651def75f646411860 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Tue, 25 Apr 2023 16:28:58 +0200 Subject: fixup --- fnl/conf/init.fnl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'fnl') diff --git a/fnl/conf/init.fnl b/fnl/conf/init.fnl index 18b8561..d59b6ae 100644 --- a/fnl/conf/init.fnl +++ b/fnl/conf/init.fnl @@ -40,6 +40,29 @@ (each [_ printer (ipairs inspected)] (print printer))))) +(local git-worktree (require :git-worktree)) +(git-worktree:setup {:command :tcd :update_on_change true :autopush true}) + +(vim.keymap.set [:n] :w ":Worktree ") +(vim.api.nvim_create_user_command :Worktree + (fn [ctx] + (match ctx.fargs + [:create tree branch upstream] (git-worktree.create_worktree tree + branch + upstream) + [:switch tree] (git-worktree.switch_worktree tree) + [:delete tree] (git-worktree.delete_worktree tree))) + {:nargs "*" + :complete (fn [lead cmdline cursor] + (local cmds + [:create :switch :delete]) + (if (accumulate [cmd-given false _ cmd (ipairs cmds)] + (or cmd-given + (string.find cmdline + cmd))) + [] + cmds))}) + (vim.api.nvim_create_user_command :HomeManager (fn [ctx] (vim.cmd (.. ":Dispatch home-manager switch --impure " -- cgit v1.2.3