From 59b6a1e414aef392d44dccdbbfcd3ccbc6ba8afd Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Thu, 13 Oct 2022 01:30:39 +0200 Subject: [PATCH] updates --- HOME/.gitconfig | 12 +++++++++++- nvim/init.lua | 11 ++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/HOME/.gitconfig b/HOME/.gitconfig index b5f8b8b..8764c41 100644 --- a/HOME/.gitconfig +++ b/HOME/.gitconfig @@ -1,3 +1,14 @@ +[alias] + save = "!f() { git add -u && git commit --no-verify -m "\"SAVEPOINT - $@\""; }; f" + undo = reset HEAD~1 --mixed + checkpoint = "!f() { git save ${1-CHECKPOINT}; git tag "\"checkpoint/${1-`date +%Y%m%d_%H%M%S`}\""; git undo; }; f" + checkpoints = tag -l "checkpoint/*" + delcheckpoint = "!f() { git tag -d checkpoint/$1; }; f" + loadcheckpoint = "!f() { git reset --hard checkpoint/$1 && git undo; }; f" + cp = checkpoint + cpls = loadcheckpoint + cpd = delcheckpoint + cpld = loadcheckpoint required = true [core] filemode = false pager = diff-so-fancy | less --tabs=4 -RFX @@ -10,4 +21,3 @@ clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process - required = true diff --git a/nvim/init.lua b/nvim/init.lua index b4d6b8b..8949f44 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -693,19 +693,20 @@ require("packer").startup { bmap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) bmap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) bmap(bufnr, "n", "", "lua vim.lsp.buf.rename()", opts) - bmap(bufnr, "n", "f", "lua vim.lsp.buf.formatting()", opts) + bmap(bufnr, "n", "f", "lua vim.lsp.buf.formatting()", + opts) if client.server_capabilities.documentFormattingProvider or client.server_capabilities.documentRangeFormattingProvider then vim.api.nvim_command [[augroup Format]] vim.api.nvim_command [[autocmd! * ]] vim.api - .nvim_command [[autocmd BufWritePost *.py lua vim.lsp.buf.formatting_seq_sync()]] + .nvim_command [[autocmd BufWritePost *.py lua vim.lsp.buf.format()]] vim.api - .nvim_command [[autocmd BufWritePost *.lua lua vim.lsp.buf.formatting_seq_sync()]] + .nvim_command [[autocmd BufWritePost *.lua lua vim.lsp.buf.format()]] vim.api - .nvim_command [[autocmd BufWritePost *.md lua vim.lsp.buf.formatting_seq_sync()]] + .nvim_command [[autocmd BufWritePost *.md lua vim.lsp.buf.format()]] vim.api - .nvim_command [[autocmd BufWritePost *.yaml lua vim.lsp.buf.formatting_seq_sync()]] + .nvim_command [[autocmd BufWritePost *.yaml lua vim.lsp.buf.format()]] vim.api.nvim_command [[augroup END]] end