diff --git a/.config/git/config b/.config/git/config index d1c097b..9a12e64 100644 --- a/.config/git/config +++ b/.config/git/config @@ -76,6 +76,10 @@ # Shortcut for checkout, we are all lazy co = checkout + # A utility to push right after a commit (I use that for my vimwiki with the key ,ws) + commit-and-push = "!git commit && git push" + cap = "!git commit && git push" + # Show the changes which will be committed dc = diff --cached diff --git a/.config/nvim/lua/plugins/vimwiki.lua b/.config/nvim/lua/plugins/vimwiki.lua index a4aab83..65b58e0 100644 --- a/.config/nvim/lua/plugins/vimwiki.lua +++ b/.config/nvim/lua/plugins/vimwiki.lua @@ -34,9 +34,7 @@ vim.api.nvim_create_autocmd("FileType", { vim.opt_local.wrap = true vim.opt_local.number = false vim.opt_local.relativenumber = false - vim.keymap.set("n", "ws", function() - vim.cmd("call system('sleep 2 && cd " .. wikipath .. " && git add . && git commit -m " .. '"Auto commit"' .. " && git push')") - end) + vim.keymap.set("n", "ws", "Gw | G commit-and-push") end, })