nvimrc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. " set the runtime path to include Vundle and initialize
  2. call plug#begin('~/.config/nvim/plugged')
  3. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  4. Plug 'zchee/deoplete-jedi'
  5. Plug 'zchee/deoplete-clang'
  6. Plug 'majutsushi/tagbar'
  7. Plug 'scrooloose/nerdtree'
  8. Plug 'tpope/vim-fugitive'
  9. Plug 'airblade/vim-gitgutter'
  10. Plug 'mhinz/vim-startify'
  11. " Define runtime-path (rtp) if there is no explicit repo for vim
  12. Plug 'altercation/vim-colors-solarized'
  13. Plug 'vim-airline/vim-airline'
  14. Plug 'vim-airline/vim-airline-themes'
  15. Plug 'suan/vim-instant-markdown'
  16. Plug 'godlygeek/tabular'
  17. Plug 'tpope/vim-markdown'
  18. Plug 'KabbAmine/vCoolor.vim'
  19. Plug 'nvie/vim-flake8'
  20. Plug 'SirVer/ultisnips'
  21. Plug 'octol/vim-cpp-enhanced-highlight'
  22. Plug 'junegunn/goyo.vim'
  23. Plug 'junegunn/limelight.vim'
  24. Plug 'lervag/vimtex'
  25. Plug 'ap/vim-css-color'
  26. Plug 'mattn/emmet-vim'
  27. Plug 'ctrlpvim/ctrlp.vim'
  28. "Plug 'scrooloose/nerdcommenter'
  29. Plug 'tpope/vim-commentary'
  30. Plug 'pangloss/vim-javascript'
  31. Plug 'easymotion/vim-easymotion'
  32. Plug 'tpope/vim-unimpaired'
  33. Plug 'othree/yajs.vim'
  34. Plug 'tpope/vim-surround'
  35. Plug 'christoomey/vim-tmux-navigator'
  36. Plug 'roxma/vim-tmux-clipboard'
  37. Plug 'Chiel92/vim-autoformat'
  38. Plug 'apple/swift', { 'rtp': 'utils/vim' }
  39. " All of your Plugins must be added before the following line
  40. call plug#end() " required
  41. "
  42. " U S E R S E T U P
  43. "
  44. " Recursive file search
  45. set path+=**
  46. " Ignore some stuff esp. for ctrlP
  47. set wildignore+=*/node_modules/*,*/build*/*,*/InstallArea/*
  48. " Make watchdogs possible
  49. set backupcopy=yes
  50. " jump between split lines
  51. map j gj
  52. map k gk
  53. nnoremap <silent> <BS> :TmuxNavigateLeft<cr>
  54. set relativenumber " aka :set rnu
  55. "map mapleader / to (german layout)
  56. let mapleader = ","
  57. " execute current file
  58. nnoremap <leader>e :!'%:p'<CR>
  59. " Run `make` in current directory
  60. nnoremap <leader>m :!make<CR>
  61. " open build/*.pdf
  62. nnoremap <leader>o :!open build/*.pdf<CR>
  63. " open Nerdtree with CTRL+n
  64. map <C-n> :NERDTreeToggle<CR>
  65. " open Tagbar with CTRL+m
  66. map <C-m> :TagbarToggle<CR>
  67. " toggle background with CTRL+I
  68. map <C-I> :let &background = (&background == "dark" ? "light" : "dark")<CR>
  69. " :w for :W
  70. command W w
  71. command Wq wq
  72. command Q q
  73. command Qa qa
  74. command WQ wq
  75. " color scheme
  76. colo solarized
  77. set ai " Set auto inline on
  78. set number " Show line numbers
  79. syntax on " Set syntax highlighting on
  80. set tabstop=4 " width of tab
  81. " should be redundant after tabstop and expandtab,
  82. " but vim-snipmate is messing up (?)
  83. set softtabstop=4
  84. set shiftwidth=4
  85. set expandtab " use 'tabstop' spaces instead of tab
  86. set colorcolumn=80 " Bar hinting for 80 chars
  87. set breakindent "baby, yeah!
  88. set mouse=a " activate mouse support
  89. set ignorecase " ignore case while searching
  90. " handling backupfiles
  91. set backupdir=~/.config/nvim/backup//
  92. set directory=~/.config/nvim/swap//
  93. set undodir=~/.config/nvim/undo//
  94. " YCM Configuration
  95. " dont use python-mode autocomplete obsolete now, because of YCM
  96. let g:ycm_filetype_whitelist = {'cpp': 1, 'py': 1, 'python': 1, 'arduino': 1, 'js': 1}
  97. " set ycm_extra_conf
  98. let g:ycm_global_ycm_extra_conf = '~/.ycm.py'
  99. " turn off the ycm diagnostic because of struggling with root
  100. let g:ycm_autoclose_preview_window_after_insertion = 1
  101. let g:ycm_autoclose_preview_window_after_completion = 1
  102. " NERDTree Configuration
  103. " hide some fileextenxions
  104. let NERDTreeIgnore = ['\.pyc$']
  105. " vim-fugitive
  106. " gdiff vertical instead of horizontal
  107. set diffopt+=vertical
  108. " Airline stuff
  109. let g:airline_powerline_fonts = 1
  110. let g:airline#extensions#tabline#enabled = 1
  111. let g:airline#extensions#tabline#buffer_nr_show = 1
  112. " multiple-cursors mapping
  113. let g:multi_cursor_use_default_mapping=0
  114. let g:multi_cursor_next_key='<C-d>'
  115. let g:multi_cursor_quit_key='<Esc>'
  116. " configure UltiSnips
  117. let g:UltiSnipsExpandTrigger='<C-j>'
  118. let g:UltiSnipsJumpForwardTrigger='<C-j>'
  119. let g:UltiSnipsJumpBackwardTrigger='<C-k>'
  120. " vCoolor config
  121. let g:vcoolor_map = '<C-c>'
  122. let g:vcool_ins_rgb_map = '' " Insert rgb color.
  123. let g:vcool_ins_hsl_map = '' " Insert hsl color.
  124. let g:vcool_ins_rgba_map = '' " Insert rgba color.
  125. " vim-javascript config
  126. let g:javascript_enable_domhtmlcss = 1
  127. " limelight+goyo settings, automatically fire up limelight with goyo
  128. let g:limelight_conceal_ctermfg = 'gray'
  129. autocmd! User GoyoEnter Limelight
  130. autocmd! User GoyoLeave Limelight!
  131. " map `,g` to start goyo
  132. nnoremap <leader>g :Goyo<CR>
  133. " Enable emmet-vim just for html/css
  134. let g:user_emmet_isntall_global = 0
  135. autocmd FileType html,css,md EmmetInstall
  136. " configure flake8
  137. " bind `,f` to Flake8
  138. nnoremap <leader>f :call Flake8()<CR>
  139. " instant markdown
  140. let g:instant_markdown_autostart = 0
  141. " activate mouse support
  142. set mouse=a
  143. set scrolloff=5
  144. " add some cpp-keywords
  145. syn keyword cppExceptions noexcept using
  146. " allow mouse clicks to change cursor position
  147. set noequalalways
  148. " list whitespaces and some other characters
  149. set listchars=tab:>-,trail:~
  150. set list
  151. " use latex flavour for plaintex files
  152. let g:tex_flavour="latex"
  153. " set some default options for my personal latexmk
  154. let g:vimtex_latexmk_options=" -lualatex
  155. \ -jobname=./build/document
  156. \ -interaction=nonstopmode
  157. \ -halt-on-error
  158. \ -pvc"
  159. " use deoplete
  160. let g:deoplete#enable_at_startup = 1
  161. " deoplete tab-complete
  162. inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
  163. let g:deoplete#sources#jedi#show_docstrnp = 1
  164. " deoplete clang completion
  165. let g:deoplete#sources#clang#clang_complete_database = '/net/nfshome/home/kheinicke/DevEnvironments/FTDevelopment/PHYS/PHYS_flavtagmaster/build.x86_64-centos7-gcc62-opt/'
  166. let g:deoplete#sources#clang#libclang_path = '/net/nfshome/home/kheinicke/.local/lib/libclang.so'
  167. " vimtex settings
  168. let g:vimtex_matchparen_enabled=0 " turn off folding to speed up things
  169. set nocursorline " speedup navigation tex documents further