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.

138 lines
4.1 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
11 months ago
11 months ago
  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. autocmd VimEnter * PlugInstall
  7. endif
  8. call plug#begin('~/.local/share/nvim/plugged')
  9. Plug 'lervag/vimtex' , { 'for' : 'tex'} " Tex library for coc autocompletion
  10. Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
  11. Plug 'scrooloose/nerdtree' " Filetree
  12. Plug 'majutsushi/tagbar' " Show tags
  13. Plug 'airblade/vim-gitgutter' " Git Upgrades
  14. Plug 'FredKSchott/CoVim' "Use vim together
  15. Plug 'qpkorr/vim-renamer' " Bulk renamer
  16. Plug 'sirver/ultisnips' " Snippets
  17. Plug 'uiiaoo/java-syntax.vim' , { 'for': 'java'} " Better syntax highlight for java than default
  18. Plug 'frazrepo/vim-rainbow' " Colorized matching brackets
  19. Plug 'junegunn/fzf.vim' " Quickly jump files using fzf
  20. Plug 'ryanoasis/vim-devicons' " Enable Icons for vim
  21. Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' } " Color Preview
  22. Plug 'tomasiser/vim-code-dark' " adding colorscheme
  23. call plug#end()
  24. " Rainbow
  25. au FileType java,c,cpp,py,h call rainbow#load()
  26. " You complete me
  27. let g:ycm_global_ycm_extra_conf = '/home/tiynger/.config/nvim/ycm_extra_conf.py'
  28. let g:ycm_semantic_triggers = {
  29. \ 'tex' : ['{']
  30. \}
  31. if !exists('g:ycm_semantic_triggers')
  32. let g:ycm_semantic_triggers = {}
  33. endif
  34. let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
  35. " Tagbar
  36. map <F3> :TagbarToggle<CR>
  37. " Nerdtree
  38. map <F2> :NERDTreeToggle<CR>
  39. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  40. let g:NERDTreeWinPos = "left"
  41. " Neotex
  42. let g:neotex_enabled = 2
  43. " CoVim
  44. let CoVim_default_name = "TiynGER"
  45. let CoVim_default_port = "7000"
  46. " Hexokinase
  47. let g:Hexokinase_refreshEvents = ['InsertLeave']
  48. let g:Hexokinase_optInPatterns = [
  49. \ 'full_hex',
  50. \ 'triple_hex',
  51. \ 'rgb',
  52. \ 'rgba',
  53. \ 'hsl',
  54. \ 'hsla',
  55. \ 'color_names'
  56. \]
  57. let g:Hexokinase_highlighters = ['backgroundfull']
  58. autocmd VimEnter * HexokinaseTurnOn
  59. " End Plugin section
  60. let mapleader =","
  61. set go=a
  62. " Enable mouse for all modes
  63. set mouse=a
  64. set clipboard+=unnamedplus
  65. " Enable command completion
  66. set wildmode=longest,list,full
  67. " Setting Tab-length
  68. set expandtab
  69. set tabstop=4
  70. set softtabstop=4
  71. set shiftwidth=4
  72. " Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
  73. set splitbelow splitright
  74. " Set lines and colors
  75. set cursorline
  76. set cursorcolumn
  77. " Disable case sensitive matching
  78. set ignorecase
  79. " Enable nocompatible mode
  80. set nocompatible
  81. " Enable Plugins
  82. filetype plugin on
  83. " Enable syntax highlighting
  84. syntax on
  85. " Enable true colors
  86. set termguicolors
  87. " Set utf-8 encoding
  88. set encoding=utf-8
  89. " Show relative numbers on left side
  90. set number relativenumber
  91. " Colorscheme
  92. colorscheme codedark
  93. highlight CursorLine ctermbg=Yellow cterm=bold guibg=#1b1b1b
  94. highlight CursorColumn ctermbg=Yellow cterm=bold guibg=#1b1b1b
  95. " Center screen on Insertion
  96. autocmd InsertEnter * norm zz
  97. " Delete trailing whitespaces on save
  98. autocmd BufWritePre * %s/\s\+$//e
  99. " Disables automatic commenting on newline:
  100. autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  101. " Clean LaTex build files
  102. autocmd VimLeave *.tex !texclear %
  103. " Read files correctly
  104. autocmd BufRead,BufNewFile *.tex set filetype=tex
  105. " Mapping Dictionaries
  106. map <F5> :setlocal spell! spelllang=de_de<CR>
  107. map <F6> :set spelllang=en_us<CR>
  108. " Compiler for languages
  109. map <leader>c :w! \| !compiler <c-r>%<CR>
  110. " Open corresponding file (pdf/html/...)
  111. map <leader>p :!opout <c-r>%<CR><CR>
  112. " Shortcut for split navigation
  113. map <C-h> <C-w>h
  114. map <C-j> <C-w>j
  115. map <C-k> <C-w>k
  116. map <C-l> <C-w>l
  117. " Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
  118. map <C-p> "+P
  119. vnoremap <C-c> "+y
  120. " Save file as sudo on files that require root permission
  121. cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
  122. " Alias for replacing
  123. nnoremap S :%s//gI<Left><Left><Left>