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.

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