From 321213894bdbbeb42cb62586c804c30c82f6cd41 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 23 Apr 2020 09:37:02 +0530 Subject: [PATCH] nvim: Add a key binding to save files with sudo Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/init.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index c038feb..dd68e3a 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -186,6 +186,8 @@ set sessionoptions-=blank set grepprg=rg\ --vimgrep " --------------------------- Key Bindings ----------------------------------- +" Allow saving of files as sudo when I forgot to start vim using sudo +cmap w!! w !sudo tee > /dev/null % " Remap escape keys to something usable on home row inoremap jk cnoremap jk