vimrc 4.3 KB

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