Dotfiles for different machines on different branches.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.8 KiB

  1. " Begin Plugin section
  2. if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
  3. echo "Downloading junegunn/vim-plug to manage plugins..."
  4. silent !mkdir -p ~/.config/nvim/autoload/
  5. silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
  6. endif
  7. call plug#begin('~/.config/nvim/plugged')
  8. Plug 'qpkorr/vim-renamer'
  9. Plug 'tomasiser/vim-code-dark'
  10. call plug#end()
  11. " End Plugin section
  12. let mapleader =","
  13. set go=a
  14. set mouse=a
  15. set ignorecase
  16. " Some basics:
  17. nnoremap c "_c
  18. set nocompatible
  19. filetype plugin on
  20. syntax on
  21. set encoding=utf-8
  22. set number relativenumber
  23. " Enable autocompletion:
  24. set wildmode=longest,list,full
  25. " Disables automatic commenting on newline:
  26. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  27. " Setting Tab-length
  28. set tabstop=4
  29. set softtabstop=4
  30. set shiftwidth=4
  31. colorscheme codedark
  32. " Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
  33. set splitbelow splitright
  34. " Mapping Dictionaries
  35. map <F5> :setlocal spell! spelllang=de<CR>
  36. map <F6> :set spelllang=en_us<CR>
  37. """ Shortcuts
  38. " Navigating with guides
  39. inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
  40. vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
  41. map <leader><leader> <Esc>/<++><Enter>"_c4l
  42. " Navigating with guides
  43. inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
  44. vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
  45. map <leader><leader> <Esc>/<++><Enter>"_c4l
  46. """HTML
  47. autocmd BufRead,BufNewFile *.html set filetype=html
  48. autocmd FileType html inoremap ,b <b></b><Space><++><Esc>FbT>i
  49. autocmd FileType html inoremap ,it <em></em><Space><++><Esc>FeT>i
  50. autocmd FileType html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
  51. autocmd FileType html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
  52. autocmd FileType html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
  53. autocmd FileType html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
  54. autocmd FileType html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
  55. autocmd FileType html inoremap ,e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
  56. autocmd FileType html inoremap ,ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
  57. autocmd FileType html inoremap ,li <Esc>o<li></li><Esc>F>a
  58. autocmd FileType html inoremap ,ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
  59. autocmd FileType html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
  60. autocmd FileType html inoremap &<space> &amp;<space>
  61. autocmd FileType html inoremap ä &auml;
  62. autocmd FileType html inoremap ö &ouml;
  63. autocmd FileType html inoremap ü &uuml;
  64. autocmd FileType html inoremap Ä &Auml;
  65. autocmd FileType html inoremap Ö &Ouml;
  66. autocmd FileType html inoremap Ü &Uuml;
  67. " Delete trailing whitespaces on save
  68. autocmd BufWritePre * %s/\s\+$//e