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.

140 lines
4.7 KiB

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