sensible.vim 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. " sensible.vim - Defaults everyone can agree on
  2. " Maintainer: Tim Pope <http://tpo.pe/>
  3. " Version: 1.1
  4. if exists('g:loaded_sensible') || &compatible
  5. finish
  6. else
  7. let g:loaded_sensible = 1
  8. endif
  9. if has('autocmd')
  10. filetype plugin indent on
  11. endif
  12. if has('syntax') && !exists('g:syntax_on')
  13. syntax enable
  14. endif
  15. " Use :help 'option' to see the documentation for the given option.
  16. set autoindent
  17. set backspace=indent,eol,start
  18. set complete-=i
  19. set smarttab
  20. set nrformats-=octal
  21. set ttimeout
  22. set ttimeoutlen=100
  23. set incsearch
  24. " Use <C-L> to clear the highlighting of :set hlsearch.
  25. if maparg('<C-L>', 'n') ==# ''
  26. nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
  27. endif
  28. set laststatus=2
  29. set ruler
  30. set showcmd
  31. set wildmenu
  32. if !&scrolloff
  33. set scrolloff=1
  34. endif
  35. if !&sidescrolloff
  36. set sidescrolloff=5
  37. endif
  38. set display+=lastline
  39. if &encoding ==# 'latin1' && has('gui_running')
  40. set encoding=utf-8
  41. endif
  42. if &listchars ==# 'eol:$'
  43. set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
  44. endif
  45. if has('path_extra')
  46. setglobal tags-=./tags tags^=./tags;
  47. endif
  48. if &shell =~# 'fish$'
  49. set shell=/bin/bash
  50. endif
  51. set autoread
  52. set fileformats+=mac
  53. if &history < 1000
  54. set history=1000
  55. endif
  56. if &tabpagemax < 50
  57. set tabpagemax=50
  58. endif
  59. if !empty(&viminfo)
  60. set viminfo^=!
  61. endif
  62. set sessionoptions-=options
  63. " Allow color schemes to do bright colors without forcing bold.
  64. if &t_Co == 8 && $TERM !~# '^linux'
  65. set t_Co=16
  66. endif
  67. " Load matchit.vim, but only if the user hasn't installed a newer version.
  68. if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
  69. runtime! macros/matchit.vim
  70. endif
  71. inoremap <C-U> <C-G>u<C-U>
  72. " vim:set ft=vim et sw=2: