From 83cd8a1a55af364a519582acf300cc20cccbfb18 Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 30 Oct 2022 03:12:43 +0100 Subject: [PATCH] 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. --- .vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vim/vimrc b/.vim/vimrc index 5b5fe6e..299cc6b 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -526,7 +526,8 @@ map gp :bp """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! | cwindow 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'