.vimrc 2.9 KB

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