X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vimrc;h=2823246d4cec2a54d449c3801756f7fa8f5bf85e;hb=da7ed32dc51735766944436c96d03a7d6822f659;hp=040dad1286c37be94e92062ea81ef471b6e034da;hpb=6a44ab1cf2b37c6954e53b9336a76f6e1ac26130;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 040dad1..2823246 100644 --- a/vimrc +++ b/vimrc @@ -3,6 +3,13 @@ " EDITOR SETTINGS +" Prevent editing as root as it may cause security problems. Use sudoedit +" instead. Thanks to godlygeek in #vim on Freenode (2009-06-19 22:21). +if $HOME == '/root' || exists('$SUDO_USER') + echomsg 'Running as root is forbidden! Use sudoedit.' + qa +endif + " Make sure Vim (and not Vi) settings are used. set nocompatible @@ -99,7 +106,8 @@ set background=dark " Display line numbers. set number -" Display the ruler with current line/file position. +" Display the ruler with current line/file position. If 'statusline' is used +" then this only affects . set ruler " Display partial commands in the status line. set showcmd @@ -117,9 +125,27 @@ if v:version >= 700 set listchars+=nbsp:! endif -" Always display the status line even if there is only one window. if has('statusline') + " Always display the status line even if there is only one window. set laststatus=2 + + set statusline= + " on the left + set statusline+=%02n: " buffer number + set statusline+=%f\ " path to current file in buffer + set statusline+=%h " [help] if buffer is help file + set statusline+=%w " [Preview] if buffer is preview buffer + set statusline+=%m " [+] if buffer was modified, + " [-] if 'modifiable' is off + set statusline+=%r " [RO] if buffer is read only + + " on the right + set statusline+=%= " right align + set statusline+=%-12.(%l,%c%V%)\ " line number (%l), + " column number (%c), + " virtual column number if different + " than %c (%V) + set statusline+=%P " position in file in percent endif