.vimrc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. "set guifont=font-3270
  16. "make backspace behave normally in insert mode
  17. set backspace=indent,eol,start
  18. "highlight search
  19. set hlsearch
  20. "search while entering the search query
  21. set incsearch
  22. "show me the options to autocomplete while in command mode
  23. set wildmenu
  24. "autocomplete stuff by giving me the match up to the first differing character
  25. "then tab through the options
  26. set wildmode=longest:list,full
  27. "put new windows to the right/below
  28. set splitright
  29. set splitbelow
  30. "NO, I don't want ANSI.
  31. set fileencodings=utf-8
  32. set encoding=utf-8
  33. set fileencoding=utf-8
  34. "turn on syntax highlighting and indentation
  35. syntax on
  36. filetype indent plugin on
  37. "ignore whitespace when diffing
  38. set diffopt+=iwhite
  39. "Akin to intellisense
  40. "I should set this up to work with <C-N>
  41. filetype plugin on
  42. set omnifunc=syntaxcomplete#Complete
  43. "colorscheme zellner
  44. "available in the void-package vim-colorschemes
  45. "colorscheme gentooish
  46. "colorscheme holokai
  47. "colorscheme maui "the line numbers here are terribly faint
  48. colorscheme elda
  49. "always underline spelling errors instead of making their background red
  50. hi clear SpellBad
  51. hi SpellBad cterm=underline ctermfg=red
  52. "warn me when I get over 140 columns
  53. "highlight OverLength ctermbg=red ctermfg=white guibg=#592929
  54. "match OverLength /\%141v.\+/
  55. "for indenting html - otherwise these tags are not recognized
  56. let g:html_indent_inctags = "html,body,head,tbody,table,td,tr,th,canvas"
  57. "whitespace
  58. set tabstop=4
  59. set shiftwidth=4
  60. set list
  61. set listchars=tab:>~,trail:~,extends:>,precedes:<
  62. "don't wrap - duh. - maybe I should change this, it seems actually quite
  63. "practical for keeping the right width for readability.
  64. set nowrap
  65. set textwidth=0
  66. set wrapmargin=0
  67. "line numbers
  68. set nu
  69. set rnu
  70. "send all backups to home/vimbackups
  71. set backupdir=~/.vim/backups,.
  72. set directory=~/.vim/swapfiles,.
  73. " Persistent undo
  74. set undodir=~/.vim/undofiles,.
  75. set undofile
  76. "search and replace options ignore case, except if there's something uppercase
  77. "in it
  78. set ignorecase
  79. set smartcase
  80. "remove all trailing whitespace on lines with non-whitespace characters
  81. " autocmd BufEnter * silent! :call <SID>StripTrailingWhitespaces()
  82. "____________MAPPINGS______________
  83. "
  84. "disable the fucking F1 key
  85. nmap <F1> <nop>
  86. "remap leader to space
  87. nnoremap <SPACE> <nop>
  88. let mapleader = " "
  89. "insert line-break
  90. nnoremap <leader><CR> o<esc>
  91. "move screen
  92. nnoremap <C-h> 4zh
  93. nnoremap <C-l> 4zl
  94. nnoremap <C-j> 4<C-E>
  95. nnoremap <C-k> 4<C-Y>
  96. "getting the next match of f or t, but more logically - at least on a german
  97. "keyboard
  98. nnoremap ; ,
  99. nnoremap , ;
  100. "removes the highlighting after search
  101. "until I can fix the escape codes sent by the terminal, I'll have to press esc
  102. "twice
  103. nnoremap <silent> <esc><esc> :noh<CR>
  104. " nnoremap <silent> <esc> :noh<CR>
  105. "add custom/unknown filetypes
  106. autocmd BufNewFile,BufRead *.plan set filetype=plan
  107. autocmd BufNewFile,BufRead *.tsv set filetype=tsv
  108. "config of ale for linting and stuff
  109. let g:ale_linters = {
  110. \ 'javascript': ['eslint'],
  111. \}
  112. let g:ale_lint_on_text_changed = 'never'
  113. let g:ale_lintdelay = 1000
  114. "FINALLY YES
  115. nnoremap gd :ALEGoToDefinition<CR>
  116. nnoremap gfr :ALEFindReferences<CR>