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.

92 lines
2.4 KiB

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