From 7b35dd4e78883d103ad8fb60d49a78ed29667197 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 16 Jun 2020 10:47:00 +0530 Subject: [PATCH] nvim: keymappings: Fix the sudo write command We actually haven't tested this. https://dev.to/jovica/the-vim-trick-which-will-save-your-time-and-nerves-45pg Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/keymappings.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/keymappings.vim b/nvim/.config/nvim/keymappings.vim index 0b67198..24c8b0c 100644 --- a/nvim/.config/nvim/keymappings.vim +++ b/nvim/.config/nvim/keymappings.vim @@ -1,5 +1,5 @@ " Allow saving of files as sudo when I forgot to start vim using sudo -cmap w!! w !sudo tee > /dev/null % +cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! " Remap escape keys to something usable on home row inoremap jk cnoremap jk