.vimrc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. "NO, I don't want ANSI.
  17. set fileencodings=utf-8
  18. set encoding=utf-8
  19. set fileencoding=utf-8
  20. "turn on syntax highlighting and indentation
  21. "syntax on
  22. filetype indent plugin on
  23. "for indentating html - otherwise these tags are not recognized
  24. let g:html_indent_inctags = "html,body,head,tbody,table,td,tr,th,canvas"
  25. "whitespace
  26. set tabstop=4
  27. set shiftwidth=4
  28. set list
  29. set listchars=tab:>~,trail:~,extends:>,precedes:<
  30. "don't wrap - duh. - maybe I should change this, it seems actually quite
  31. "practical for keeping the right width for readability.
  32. set nowrap
  33. set textwidth=0
  34. set wrapmargin=0
  35. "line numbers
  36. set nu
  37. set rnu
  38. "colors
  39. syntax on
  40. colorscheme desert
  41. " colorscheme industry
  42. "send all backups to home/vimbackups
  43. set backupdir=./vimbackups,../vimbackups,~/vim/backups,.
  44. set directory=./vimbackups,../vimbackups,~/vim/backups,.
  45. " Persistent undo
  46. set undodir=~/.vim/undofiles
  47. set undofile
  48. "search and replace options ignore case, except if there's something uppercase
  49. "in it
  50. set ignorecase
  51. set smartcase
  52. "set the current working directory when entering a new file
  53. autocmd BufEnter * silent! :lcd%:p:h
  54. "update ctags for this file upon saving
  55. autocmd BufWritePost * silent! !ctags -a %
  56. set tags=./tags,tags;$HOME
  57. "trailing space is important
  58. nnoremap <C-f> :tag *
  59. "remove all trailing whitespace on lines with non-whitespace characters
  60. " autocmd BufEnter * silent! :call <SID>StripTrailingWhitespaces()
  61. "____________MAPPINGS______________
  62. "
  63. "disable the fucking F1 key
  64. nmap <F1> <nop>
  65. "remap leader to space
  66. nnoremap <SPACE> <nop>
  67. "let mapleader = "\<SPACE>"
  68. let mapleader = " "
  69. "move screen
  70. nnoremap <C-h> 4zh
  71. nnoremap <C-l> 4zl
  72. nnoremap<C-j> 4<C-E>
  73. nnoremap <C-k> 4<C-Y>
  74. "getting the next match of f or t, but more logical - at least on a german
  75. "keyboard
  76. nnoremap ; ,
  77. nnoremap , ;
  78. "copying and pasting the standard windows way - doesn't really work if I don't
  79. "have a clipboard manager
  80. inoremap <silent> <C-v> <C-R>+
  81. nnoremap <silent> <C-v> "+p
  82. nnoremap <silent> <C-c> "+Y<esc>
  83. vnoremap <silent> <C-c> "+y<esc>
  84. vnoremap <silent> <C-v> "+p
  85. " nnoremap <silent> <C-a> <esc>ggVG
  86. "removes the highlighting after search
  87. "until I can fix the escape codes sent by the terminal, I'll have to press esc
  88. "twice
  89. nnoremap <silent> <esc><esc> :noh<CR>
  90. " nnoremap <silent> <esc> :noh<CR>
  91. "_____________AUX FUNCTIONS_________________
  92. "doesn't remove lines with ONLY whitespace
  93. fun! <SID>StripTrailingWhitespaces()
  94. let l = line(".")
  95. let c = col(".")
  96. %s/\v([^\t])(\t|\s)+$/\1/g
  97. call cursor(l, c)
  98. endfun
  99. "PLUGINS
  100. let g:NERDSpaceDelims = 1
  101. "txt - Language is turned to German
  102. "z= to get suggestions for wrong word
  103. "zg to add word to dictionary
  104. "zw to add word as incorrect
  105. autocmd Filetype txt setlocal spell spelllang=de_DE
  106. "C#
  107. autocmd Filetype cs setlocal expandtab