.vimrc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. "always underline spelling errors instead of making their background red
  45. hi clear SpellBad
  46. hi SpellBad cterm=underline ctermfg=red
  47. "warn me when I get over 140 columns
  48. "highlight OverLength ctermbg=red ctermfg=white guibg=#592929
  49. "match OverLength /\%141v.\+/
  50. "for indenting html - otherwise these tags are not recognized
  51. let g:html_indent_inctags = "html,body,head,tbody,table,td,tr,th,canvas"
  52. "whitespace
  53. set tabstop=4
  54. set shiftwidth=4
  55. set list
  56. set listchars=tab:>~,trail:~,extends:>,precedes:<
  57. "don't wrap - duh. - maybe I should change this, it seems actually quite
  58. "practical for keeping the right width for readability.
  59. set nowrap
  60. set textwidth=0
  61. set wrapmargin=0
  62. "line numbers
  63. set nu
  64. set rnu
  65. "send all backups to home/vimbackups
  66. set backupdir=~/.vim/backups,.
  67. set directory=~/.vim/swapfiles,.
  68. " Persistent undo
  69. set undodir=~/.vim/undofiles,.
  70. set undofile
  71. "search and replace options ignore case, except if there's something uppercase
  72. "in it
  73. set ignorecase
  74. set smartcase
  75. "remove all trailing whitespace on lines with non-whitespace characters
  76. " autocmd BufEnter * silent! :call <SID>StripTrailingWhitespaces()
  77. "____________MAPPINGS______________
  78. "
  79. "disable the fucking F1 key
  80. nmap <F1> <nop>
  81. "remap leader to space
  82. nnoremap <SPACE> <nop>
  83. let mapleader = " "
  84. "insert line-break
  85. nnoremap <leader><CR> o<esc>
  86. "move screen
  87. nnoremap <C-h> 4zh
  88. nnoremap <C-l> 4zl
  89. nnoremap <C-j> 4<C-E>
  90. nnoremap <C-k> 4<C-Y>
  91. "getting the next match of f or t, but more logically - at least on a german
  92. "keyboard
  93. nnoremap ; ,
  94. nnoremap , ;
  95. "removes the highlighting after search
  96. "until I can fix the escape codes sent by the terminal, I'll have to press esc
  97. "twice
  98. nnoremap <silent> <esc><esc> :noh<CR>
  99. " nnoremap <silent> <esc> :noh<CR>
  100. "add custom/unknown filetypes
  101. autocmd BufNewFile,BufRead *.plan set filetype=plan
  102. autocmd BufNewFile,BufRead *.tsv set filetype=tsv
  103. "config of ale for linting and stuff
  104. let g:ale_linters = {
  105. \ 'javascript': ['eslint'],
  106. \}
  107. let g:ale_lint_on_text_changed = 'never'
  108. let g:ale_lintdelay = 1000
  109. "FINALLY YES
  110. nnoremap gd :ALEGoToDefinition<CR>
  111. nnoremap gfr :ALEFindReferences<CR>