From 03360136b6fb9494847481442651e79e77e37eca Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Mon, 4 Jan 2016 11:22:40 -0800 Subject: [PATCH] Adding the VIM 'write with sudo' trick to vimrc as a mapping --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrc b/vimrc index c973379..89318dc 100644 --- a/vimrc +++ b/vimrc @@ -21,6 +21,11 @@ set nolist set listchars=tab:»-,trail:·,extends:>,precedes:<,eol:¬ noremap <F10> :set list!<CR> + +" Allow saving of files as sudo when I forgot to start vim using sudo +cmap w!! q !sudo tee > /dev/null % + + " Tab options set expandtab " Soft tabs, changes tabs to spaces set tabstop=4 " Number of spaces in a tab -- GitLab