.vimrc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. "not VI compatible
  2. set nocompatible
  3. "set the path where the plugins live
  4. "in this case in the folder .vim in home
  5. set packpath+=~/.vim
  6. "lets vim search for files to open recursively
  7. "for use with the find command
  8. set path+=**
  9. "turn off the taskbar in gvim
  10. set guioptions-=m
  11. "a bit more readable
  12. set guifont=Lucida_Console:h10
  13. "make backspace behave normally in insert mode
  14. set backspace=indent,eol,start
  15. "highlight search
  16. set hlsearch
  17. "search while entering the search query
  18. set incsearch
  19. "show me the options to autocomplete while in command mode
  20. set wildmenu
  21. "autocomplete stuff by giving me the match up to the first differing character
  22. "then tab through the options
  23. set wildmode=longest:list,full
  24. "NO, I don't want ANSI.
  25. set fileencodings=utf-8
  26. set encoding=utf-8
  27. set fileencoding=utf-8
  28. "turn on syntax highlighting and indentation
  29. syntax on
  30. filetype indent plugin on
  31. "Akin to intellisense
  32. "I should set this up to work with <C-N>
  33. filetype plugin on
  34. set omnifunc=syntaxcomplete#Complete
  35. "also autocomplete words which are hyphen-separated
  36. set iskeyword+=\-
  37. "colorscheme zellner
  38. colorscheme gentooish "available in the void-package vim-colorschemes
  39. "colorscheme holokai "available in the void-package vim-colorschemes
  40. "always underline spelling errors instead of making their background red
  41. hi clear SpellBad
  42. hi SpellBad cterm=underline ctermfg=red
  43. "for indentating html - otherwise these tags are not recognized
  44. let g:html_indent_inctags = "html,body,head,tbody,table,td,tr,th,canvas"
  45. "whitespace
  46. set tabstop=4
  47. set shiftwidth=4
  48. set list
  49. set listchars=tab:>~,trail:~,extends:>,precedes:<
  50. "don't wrap - duh. - maybe I should change this, it seems actually quite
  51. "practical for keeping the right width for readability.
  52. set nowrap
  53. set textwidth=0
  54. set wrapmargin=0
  55. "line numbers
  56. set nu
  57. set rnu
  58. "send all backups to home/vimbackups
  59. set backupdir=~/.vim/backups,.
  60. set directory=~/.vim/swapfiles,.
  61. " Persistent undo
  62. set undodir=~/.vim/undofiles,.
  63. set undofile
  64. "search and replace options ignore case, except if there's something uppercase
  65. "in it
  66. set ignorecase
  67. set smartcase
  68. "remove all trailing whitespace on lines with non-whitespace characters
  69. " autocmd BufEnter * silent! :call <SID>StripTrailingWhitespaces()
  70. "____________MAPPINGS______________
  71. "
  72. "disable the fucking F1 key
  73. nmap <F1> <nop>
  74. "remap leader to space
  75. nnoremap <SPACE> <nop>
  76. let mapleader = " "
  77. "insert line-break
  78. nnoremap <leader><CR> o<esc>
  79. "move screen
  80. nnoremap <C-h> 4zh
  81. nnoremap <C-l> 4zl
  82. nnoremap <C-j> 4<C-E>
  83. nnoremap <C-k> 4<C-Y>
  84. "getting the next match of f or t, but more logically - at least on a german
  85. "keyboard
  86. nnoremap ; ,
  87. nnoremap , ;
  88. "removes the highlighting after search
  89. "until I can fix the escape codes sent by the terminal, I'll have to press esc
  90. "twice
  91. nnoremap <silent> <esc><esc> :noh<CR>
  92. " nnoremap <silent> <esc> :noh<CR>
  93. "AUTOCOMMANDS
  94. "for povray files
  95. augroup pov
  96. autocmd!
  97. au BufWritePost *.pov !povray .
  98. augroup END
  99. "for the regular text
  100. augroup txt
  101. autocmd!
  102. au BufReadPost *.txt setlocal spell
  103. au BufReadPost *.txt setlocal tw=80
  104. au BufReadPost *.txt highlight Checked ctermfg=White ctermbg=DarkGreen
  105. au BufReadPost *.txt highlight Unchecked ctermfg=White ctermbg=DarkRed
  106. au BufReadPost *.txt syn match Unchecked /\[ \]/
  107. au BufReadPost *.txt syn match Checked /\[x\]/
  108. augroup END
  109. "for the regular text
  110. augroup md
  111. autocmd!
  112. au BufReadPost *.md setlocal spell
  113. au BufReadPost *.md setlocal tw=80
  114. augroup END
  115. "for tsv files - which I like to be nicely aligned
  116. augroup tsv
  117. autocmd!
  118. au BufReadPost *.tsv setlocal tabstop=20
  119. augroup END
  120. "for the twig templating language
  121. augroup twig
  122. autocmd!
  123. au BufReadPost *.twig set ft=html
  124. augroup END