vimrc 4.2 KB

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