Simply sync my vimwiki via shortcut

This commit is contained in:
2025-10-22 20:11:45 +02:00
parent 6d9356b686
commit fe582181f4
2 changed files with 5 additions and 3 deletions

View File

@@ -76,6 +76,10 @@
# Shortcut for checkout, we are all lazy # Shortcut for checkout, we are all lazy
co = checkout 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 # Show the changes which will be committed
dc = diff --cached dc = diff --cached

View File

@@ -34,9 +34,7 @@ vim.api.nvim_create_autocmd("FileType", {
vim.opt_local.wrap = true vim.opt_local.wrap = true
vim.opt_local.number = false vim.opt_local.number = false
vim.opt_local.relativenumber = false vim.opt_local.relativenumber = false
vim.keymap.set("n", "<Leader>ws", function() vim.keymap.set("n", "<Leader>ws", "<Cmd>Gw | G commit-and-push<CR>")
vim.cmd("call system('sleep 2 && cd " .. wikipath .. " && git add . && git commit -m " .. '"Auto commit"' .. " && git push')")
end)
end, end,
}) })