vimrc 4.3 KB

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