vimrc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. " Vundle plugin manager
  2. set nocompatible
  3. filetype off
  4. set rtp+=~/.vim/bundle/Vundle.vim
  5. call vundle#begin()
  6. Plugin 'VundleVim/Vundle.vim'
  7. Plugin 'captbaritone/better-indent-support-for-php-with-html'
  8. Plugin 'https://gogs.jovian-hersemeule.eu/Vim/BonitaLog.git'
  9. Plugin 'dag/vim-fish'
  10. call vundle#end()
  11. " Make hard tab look like 4 spaces tabs
  12. set shiftwidth=4
  13. set tabstop=4
  14. " When started as "evim", evim.vim will already have done these settings.
  15. if v:progname =~? "evim"
  16. finish
  17. endif
  18. " Use Vim settings, rather than Vi settings (much better!).
  19. " This must be first, because it changes other options as a side effect.
  20. " Avoid side effects when it was already reset.
  21. if &compatible
  22. set nocompatible
  23. endif
  24. " When the +eval feature is missing, the set command above will be skipped.
  25. " Use a trick to reset compatible only when the +eval feature is missing.
  26. silent! while 0
  27. set nocompatible
  28. silent! endwhile
  29. " Allow backspacing over everything in insert mode.
  30. set backspace=indent,eol,start
  31. set history=200
  32. set ruler
  33. set showcmd " display incomplete commands
  34. set wildmenu " display completion matches in a status line
  35. set ttimeout " time out for key codes
  36. set ttimeoutlen=100 " wait up to 100ms after Esc for special key
  37. " Show @@@ in the last line if it is truncated.
  38. set display=truncate
  39. " Show a few lines of context around the cursor. Note that this makes the
  40. " text scroll if you mouse-click near the start or end of the window.
  41. set scrolloff=5
  42. " Do incremental searching when it's possible to timeout.
  43. if has('reltime')
  44. set incsearch
  45. endif
  46. " Do not recognize octal numbers for Ctrl-A and Ctrl-X
  47. set nrformats-=octal
  48. " Don't use Ex mode, use Q for formatting.
  49. " Revert with ":unmap Q".
  50. map Q gq
  51. " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
  52. " so that you can undo CTRL-U after inserting a line break.
  53. " Revert with ":iunmap <C-U>".
  54. inoremap <C-U> <C-G>u<C-U>
  55. " Switch syntax highlighting on when available
  56. if &t_Co > 2 || has("gui_running")
  57. " Revert with ":syntax off".
  58. syntax on
  59. " I like highlighting strings inside C comments.
  60. " Revert with ":unlet c_comment_strings".
  61. let c_comment_strings=1
  62. endif
  63. " Only do this part when compiled with support for autocommands.
  64. if has("autocmd")
  65. " Enable file type detection.
  66. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  67. " 'cindent' is on in C files, etc.
  68. " Also load indent files, to automatically do language-dependent indenting.
  69. " Revert with ":filetype off".
  70. filetype plugin indent on
  71. " Put these in an autocmd group, so that you can revert them with:
  72. " ":augroup vimStartup | au! | augroup END"
  73. augroup vimrcEx
  74. au!
  75. " When editing a file, always jump to the last known cursor position.
  76. " Don't do it when the position is invalid, when inside an event handler
  77. " (happens when dropping a file on gvim) and for a commit message (it's
  78. " likely a different one than last time).
  79. autocmd BufReadPost *
  80. \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
  81. \ | exe "normal! g`\""
  82. \ | endif
  83. " For all text files set 'textwidth' to 78 characters.
  84. autocmd FileType text setlocal textwidth=78
  85. augroup END
  86. else
  87. set autoindent " always set autoindenting on
  88. endif " has("autocmd")
  89. " Convenient command to see the difference between the current buffer and the
  90. " file it was loaded from, thus the changes you made.
  91. " Only define it when not defined already.
  92. " Revert with: ":delcommand DiffOrig".
  93. if !exists(":DiffOrig")
  94. command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  95. \ | wincmd p | diffthis
  96. endif
  97. if has('langmap') && exists('+langremap')
  98. " Prevent that the langmap option applies to characters that result from a
  99. " mapping. If set (default), this may break plugins (but it's backward
  100. " compatible).
  101. set nolangremap
  102. endif
  103. set nobackup " do not keep a backup file, use versions instead
  104. if has('persistent_undo')
  105. set undofile " keep an undo file (undo changes after closing)
  106. set undodir=/tmp/
  107. endif
  108. " Add optional packages.
  109. "
  110. " The matchit plugin makes the % command work better, but it is not backwards
  111. " compatible.
  112. " The ! means the package won't be loaded right away but when plugins are
  113. " loaded during initialization.
  114. if has('syntax') && has('eval')
  115. packadd! matchit
  116. endif