set nomodified
endif
unlet fenc ftype mod
+
+elseif filereadable($VIMRUNTIME . "/defaults.vim")
+ unlet! skip_defaults_vim
+ source $VIMRUNTIME/defaults.vim
endif
" No, it is not VI, it is VIM! It is important to set this first, because this
" 2 moving around, searching and patterns
set ignorecase " Ignore case in search patterns
+set noincsearch " No incremental searching
set smartcase " Match 'word' case-insensitive and 'Word' case-sensitive
set nostartofline " Keep cursor's column
" Show tabs, non-breaking/trailing spaces, long lines
set listchars=tab:>_,nbsp:_,trail:_,extends:+,precedes:+
" Another usefull additions: eol:$,space:_
+set scrolloff=0 " number of screen lines to show around the cursor
set wrap " Visually wrap long lines
" With 'set wrap' wrap long lines at a character in 'breakat'
" 9 using the mouse
-set mouse=ar " Use mouse in all modes, plus hit-return
+if has('mouse')
+ set mouse=ar " Use mouse in all modes, plus hit-return
+endif
" 12 messages and info
" Save all files before running any quickfix command (grep, makeprg, etc.)
autocmd QuickFixCmdPre * wall
" automatically close quickfix if it's the only window left
-autocmd WinEnter * if winnr('$') == 1 && &buftype == "quickfix" | quit | endif
+autocmd WinEnter * if winnr('$') == 1 &&
+ \ index(["nofile", "quickfix"], &buftype) >= 0 | quit | endif
endif
" Syntax highlighting
set nowildmenu
set wildmode=list:longest
set viminfo=!,h,'10,<100,s5
+ if has("iconv")
+ set viminfo^=c
+ endif
syntax off
highlight NonText cterm=NONE ctermfg=NONE
endfunction
" From Tip 212:
-" http://vim.wikia.com/wiki/Setting_file_attributes_without_reloading_a_buffer
+" http://vim.fandom.com/wiki/Setting_file_attributes_without_reloading_a_buffer
if executable('chmod')
function! SetExecutableBit(x)
" Called automagically after every buffer read, enables fileencoding
" setting from modeline (see Tip #911:
-" http://vim.wikia.com/wiki/How_to_make_fileencoding_work_in_the_modeline)
+" http://vim.fandom.com/wiki/How_to_make_fileencoding_work_in_the_modeline)
function! AutoEncoding()
if &modified && &fileencoding != ""
call SetupEncoding(&fileencoding)