.vimrc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. "not VI compatible
  2. set nocompatible
  3. "Workaround for pasting under wayland
  4. xnoremap "+y y:call system("wl-copy", @")<cr>
  5. nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
  6. nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
  7. "set the path where the plugins live
  8. "in this case in the folder .vim in home
  9. set packpath+=~/.vim
  10. "lets vim search for files to open recursively
  11. "for use with the find command
  12. set path+=**
  13. "Yeah, don't search through node_modules
  14. set wildignore+=**/node_modules/**
  15. "turn off the taskbar in gvim
  16. set guioptions-=m
  17. "a bit more readable
  18. set guifont=Lucida_Console:h10
  19. "set guifont=font-3270
  20. "make backspace behave normally in insert mode
  21. set backspace=indent,eol,start
  22. "highlight search
  23. set hlsearch
  24. "search while entering the search query
  25. set incsearch
  26. "show me the options to autocomplete while in command mode
  27. set wildmenu
  28. "autocomplete stuff by giving me the match up to the first differing character
  29. "then tab through the options
  30. set wildmode=longest:list,full
  31. "put new windows to the right/below
  32. set splitright
  33. set splitbelow
  34. "NO, I don't want ANSI.
  35. set fileencodings=utf-8
  36. set encoding=utf-8
  37. set fileencoding=utf-8
  38. "turn on syntax highlighting and indentation
  39. syntax on
  40. filetype indent plugin on
  41. "ignore whitespace when diffing
  42. set diffopt+=iwhite
  43. "Akin to intellisense
  44. "I should set this up to work with <C-N>
  45. filetype plugin on
  46. set omnifunc=syntaxcomplete#Complete
  47. colorscheme torte
  48. "always underline spelling errors instead of making their background red
  49. hi clear SpellBad
  50. hi SpellBad cterm=underline ctermfg=red
  51. "warn me when I get over 140 columns
  52. "highlight OverLength ctermbg=red ctermfg=white guibg=#592929
  53. "match OverLength /\%141v.\+/
  54. "for indenting html - otherwise these tags are not recognized
  55. let g:html_indent_inctags = "html,body,head,tbody,table,td,tr,th,canvas"
  56. "whitespace
  57. set tabstop=4
  58. set shiftwidth=4
  59. set list
  60. set listchars=tab:>~,trail:~,extends:>,precedes:<
  61. "don't wrap - duh. - maybe I should change this, it seems actually quite
  62. "practical for keeping the right width for readability.
  63. set nowrap
  64. set textwidth=0
  65. set wrapmargin=0
  66. "line numbers
  67. set nu
  68. set rnu
  69. "send all backups to home/vimbackups
  70. set backupdir=~/.vim/backups,.
  71. set directory=~/.vim/swapfiles,.
  72. " Persistent undo
  73. set undodir=~/.vim/undofiles,.
  74. set undofile
  75. "search and replace options ignore case, except if there's something uppercase
  76. "in it
  77. set ignorecase
  78. set smartcase
  79. "remove all trailing whitespace on lines with non-whitespace characters
  80. " autocmd BufEnter * silent! :call <SID>StripTrailingWhitespaces()
  81. "____________MAPPINGS______________
  82. "
  83. "disable the fucking F1 key
  84. nmap <F1> <nop>
  85. "remap leader to space
  86. nnoremap <SPACE> <nop>
  87. let mapleader = " "
  88. "insert line-break
  89. nnoremap <leader><CR> o<esc>
  90. "move screen
  91. nnoremap <C-h> 4zh
  92. nnoremap <C-l> 4zl
  93. nnoremap <C-j> 4<C-E>
  94. nnoremap <C-k> 4<C-Y>
  95. "getting the next match of f or t, but more logically - at least on a german
  96. "keyboard
  97. nnoremap ; ,
  98. nnoremap , ;
  99. "removes the highlighting after search
  100. "until I can fix the escape codes sent by the terminal, I'll have to press esc
  101. "twice
  102. nnoremap <silent> <esc><esc> :noh<CR>
  103. " nnoremap <silent> <esc> :noh<CR>
  104. "add custom/unknown filetypes
  105. autocmd BufNewFile,BufRead *.plan set filetype=plan
  106. autocmd BufNewFile,BufRead *.tsv set filetype=tsv