From b4987eec8d0c8525c29083b4eb3b1be00a42b2e3 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 17 May 2021 21:08:28 +0100 Subject: [PATCH] Allow saving files as sudo --- init.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index ecb4ae5..1beb7ee 100644 --- a/init.vim +++ b/init.vim @@ -128,7 +128,11 @@ nnoremap { mzF[`a``%i`z nnoremap } mzF[`a``%i`zvi[:s/,\s*/,\r/gvi[=`z:nohlsearch "A command to properly indent json code -com! FormatJSON %!python -m json.tool +command! FormatJSON %!python -m json.tool + +" Allow saving of files as sudo +command! W execute 'silent! w !sudo /usr/bin/tee % >/dev/nuull' edit! + " }}} " Plugins --- {{{