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.

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