From afc2913270c56041b51d09c601a9833d4b6f21ec Mon Sep 17 00:00:00 2001 From: Przemyslaw Grondek Date: Wed, 18 Sep 2019 11:09:26 +0200 Subject: [PATCH] [vim] Added configuration for saving file as root --- vim/vimrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 9dbb991..d362e20 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -21,3 +21,11 @@ set showcmd " show command in bar set number " show line numbers set wildmenu " visual autocomplete for command menu set tabpagemax=10 + +function Xsudo() + :w !sudo tee % + :q! +endfunction + +command Wsudo :w !sudo tee % +command Xsudo exec Xsudo()