.vimrc 3.7 KB

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