Update gitconfig and nvimrc

This commit is contained in:
Rob Watson 2021-12-16 20:23:10 +01:00
parent 17129976de
commit f150038717
3 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@
sqls = !git sq $(git ls) sqls = !git sq $(git ls)
sqt = merge --squash -s recursive -X theirs sqt = merge --squash -s recursive -X theirs
ss = stash save ss = stash save
st = status st = stash
sy = !gitsha1yank -s sy = !gitsha1yank -s
sum = show --stat sum = show --stat
undo = reset --soft HEAD^ undo = reset --soft HEAD^

7
nvimrc
View File

@ -287,6 +287,13 @@ vim.api.nvim_set_keymap("n", "<leader>cq", [[:lua _G.close_tests()<cr>]], {norem
vim.api.nvim_set_keymap("n", "<leader>cc", [[:lua _G.copy_test_cmd()<cr>]], {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<leader>cc", [[:lua _G.copy_test_cmd()<cr>]], {noremap = true, silent = true})
EOF EOF
" Function to eat trailing character when applying iabbrevs.
" https://stackoverflow.com/questions/11858927/preventing-trailing-whitespace-when-using-vim-abbreviations
func Eatchar(pat)
let c = nr2char(getchar(0))
return (c =~ a:pat) ? '' : c
endfunc
" Git mappings " Git mappings
" "
" Copy Git permalink to clipboard for either current line or range " Copy Git permalink to clipboard for either current line or range

View File

@ -1,11 +1,4 @@
" https://stackoverflow.com/questions/11858927/preventing-trailing-whitespace-when-using-vim-abbreviations
func Eatchar(pat)
let c = nr2char(getchar(0))
return (c =~ a:pat) ? '' : c
endfunc
iabbrev clog console.log("<c-r>=Eatchar('\s')<cr> iabbrev clog console.log("<c-r>=Eatchar('\s')<cr>
iabbrev cdeb console.debug("<c-r>=Eatchar('\s')<cr> iabbrev cdeb console.debug("<c-r>=Eatchar('\s')<cr>
iabbrev cerr console.error("<c-r>=Eatchar('\s')<cr> iabbrev cerr console.error("<c-r>=Eatchar('\s')<cr>
iabbrev cwar console.warn("<c-r>=Eatchar('\s')<cr> iabbrev cwar console.warn("<c-r>=Eatchar('\s')<cr>