Skip to content

Commit

Permalink
Protect home directory permissions during sudo vim
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Jul 15, 2014
1 parent ae6972c commit cd86f4c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vimrc
Expand Up @@ -82,6 +82,11 @@ if v:version >= 600
set mouse=nvi
endif

if !empty($SUDO_USER) && $USER !=# $SUDO_USER
set viminfo=
set directory-=~/tmp
set backupdir-=~/tmp
endif

if !has("gui_running") && $DISPLAY == '' || !has("gui")
set mouse=
Expand Down

0 comments on commit cd86f4c

Please sign in to comment.