vimrc: add WW cmd

remap sudo write cmd to be WW, as hitting just W (instead of w)
inadvertently is easy enough and often leads to undesired calls to sudo,
which should be harder to do with the WW one.
in the meanwhile, map W to just write normally.
This commit is contained in:
surtur 2022-10-30 03:12:43 +01:00
parent 07a2dae198
commit 83cd8a1a55
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -526,7 +526,8 @@ map gp :bp<cr>
"""autocmd VimLeave * silent !echo -ne "\033]112\007" """autocmd VimLeave * silent !echo -ne "\033]112\007"
command! W execute 'silent w !sudo tee % >/dev/null' | edit! command! W execute 'w' | edit!
command! WW execute 'silent w !sudo tee % >/dev/null' | edit!
command! -nargs=* Make write | make! <args> | cwindow command! -nargs=* Make write | make! <args> | cwindow
command Note execute 'e ~/Sync/notes/' . strftime('%y-%m-%d-%H:%M:%S') . '.md' command Note execute 'e ~/Sync/notes/' . strftime('%y-%m-%d-%H:%M:%S') . '.md'
command LocalNote execute 'e ./' . strftime('%y-%m-%d-%H:%M:%S') . '.md' command LocalNote execute 'e ./' . strftime('%y-%m-%d-%H:%M:%S') . '.md'