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.

100 lines
2.7 KiB

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. " Plugin section
  48. call plug#begin('~/.config/nvim/plugged')
  49. Plug 'lervag/vimtex' , { 'for' : 'tex'} " Tex library for coc autocompletion
  50. Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
  51. Plug 'preservim/nerdtree' " Filetree
  52. Plug 'majutsushi/tagbar' " Show tags
  53. Plug 'airblade/vim-gitgutter' " Git Upgrades
  54. Plug 'FredKSchott/CoVim' "Use vim together
  55. Plug 'qpkorr/vim-renamer' " Bulk renamer
  56. Plug 'sirver/ultisnips' " Snippets
  57. call plug#end()
  58. " Colorscheme
  59. source /home/tiynger/.config/nvim/codedark.vim
  60. " You complete me
  61. let g:ycm_global_ycm_extra_conf = '/home/tiynger/.config/nvim/ycm_extra_conf.py'
  62. let g:ycm_semantic_triggers = {
  63. \ 'tex' : ['{']
  64. \}
  65. if !exists('g:ycm_semantic_triggers')
  66. let g:ycm_semantic_triggers = {}
  67. endif
  68. let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
  69. " Tagbar
  70. map <F3> :TagbarToggle<CR>
  71. " Nerdtree
  72. map <F2> :NERDTreeToggle<CR>
  73. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  74. let g:NERDTreeWinPos = "left"
  75. " Neotex
  76. let g:neotex_enabled = 2
  77. " CoVim
  78. let CoVim_default_name = "TiynGER"
  79. let CoVim_default_port = "7000"