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.

112 lines
3.0 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
8 months ago
11 months ago
11 months ago
  1. let mapleader =","
  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. autocmd VimEnter * PlugInstall
  7. endif
  8. set go=a
  9. set mouse=a
  10. set nohlsearch
  11. set clipboard=unnamedplus
  12. " Some basics:
  13. nnoremap c "_c
  14. set nocompatible
  15. filetype plugin on
  16. syntax on
  17. set encoding=utf-8
  18. set number relativenumber
  19. " Enable autocompletion:
  20. set wildmode=longest,list,full
  21. " Disables automatic commenting on newline:
  22. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  23. " Setting Tab-length
  24. set tabstop=4
  25. set softtabstop=4
  26. set shiftwidth=4
  27. " Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
  28. set splitbelow splitright
  29. " Clean LaTex build files
  30. autocmd VimLeave *.tex !texclear %
  31. " Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
  32. vnoremap <C-c> "+y
  33. map <C-p> "+P
  34. " Save file as sudo on files that require root permission
  35. cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
  36. " Mapping Dictionaries
  37. map <F5> :setlocal spell! spelllang=de<CR>
  38. map <F6> :set spelllang=en_us<CR>
  39. " Read files correctly
  40. autocmd BufRead,BufNewFile *.tex set filetype=tex
  41. " Compiler for languages
  42. map <leader>c :w! \| !compiler <c-r>%<CR>
  43. " Open corresponding file (pdf/html/...)
  44. map <leader>p :!opout <c-r>%<CR><CR>
  45. " Delete trailing whitespaces on save
  46. autocmd BufWritePre * %s/\s\+$//e
  47. " Shortcut for split navigation
  48. map <C-h> <C-w>h
  49. map <C-j> <C-w>j
  50. map <C-k> <C-w>k
  51. map <C-l> <C-w>l
  52. " Plugin section
  53. call plug#begin('~/.local/share/nvim/plugged')
  54. Plug 'lervag/vimtex' , { 'for' : 'tex'} " Tex library for coc autocompletion
  55. Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
  56. Plug 'scrooloose/nerdtree' " Filetree
  57. Plug 'majutsushi/tagbar' " Show tags
  58. Plug 'airblade/vim-gitgutter' " Git Upgrades
  59. Plug 'FredKSchott/CoVim' "Use vim together
  60. Plug 'qpkorr/vim-renamer' " Bulk renamer
  61. Plug 'sirver/ultisnips' " Snippets
  62. Plug 'uiiaoo/java-syntax.vim' , { 'for': 'java'} " Better syntax highlight for java than default
  63. Plug 'frazrepo/vim-rainbow' " Colorized matching brackets
  64. Plug 'junegunn/fzf.vim' " Quickly jump files using fzf
  65. call plug#end()
  66. " Colorscheme
  67. source /home/tiynger/.config/nvim/codedark.vim
  68. " Rainbow
  69. au FileType java,c,cpp,py call rainbow#load()
  70. " You complete me
  71. let g:ycm_global_ycm_extra_conf = '/home/tiynger/.config/nvim/ycm_extra_conf.py'
  72. let g:ycm_semantic_triggers = {
  73. \ 'tex' : ['{']
  74. \}
  75. if !exists('g:ycm_semantic_triggers')
  76. let g:ycm_semantic_triggers = {}
  77. endif
  78. let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
  79. " Tagbar
  80. map <F3> :TagbarToggle<CR>
  81. " Nerdtree
  82. map <F2> :NERDTreeToggle<CR>
  83. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  84. let g:NERDTreeWinPos = "left"
  85. " Neotex
  86. let g:neotex_enabled = 2
  87. " CoVim
  88. let CoVim_default_name = "TiynGER"
  89. let CoVim_default_port = "7000"