nvimrc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. " set the runtime path to include Vundle and initialize
  2. call plug#begin('~/.config/nvim/plugged')
  3. Plug 'Valloric/YouCompleteMe'
  4. Plug 'majutsushi/tagbar'
  5. Plug 'scrooloose/nerdtree'
  6. Plug 'tpope/vim-fugitive'
  7. Plug 'rust-lang/rust.vim'
  8. Plug 'airblade/vim-gitgutter'
  9. Plug 'mhinz/vim-startify'
  10. " Define runtime-path (rtp) if there is no explicit repo for vim
  11. Plug 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
  12. Plug 'altercation/vim-colors-solarized'
  13. Plug 'vim-airline/vim-airline'
  14. Plug 'vim-airline/vim-airline-themes'
  15. Plug 'terryma/vim-multiple-cursors'
  16. Plug 'suan/vim-instant-markdown'
  17. Plug 'tpope/vim-markdown'
  18. Plug 'KabbAmine/vCoolor.vim'
  19. Plug 'nvie/vim-flake8'
  20. Plug 'Raimondi/delimitMate'
  21. Plug 'SirVer/ultisnips'
  22. Plug 'rizzatti/dash.vim'
  23. Plug 'octol/vim-cpp-enhanced-highlight'
  24. Plug 'junegunn/goyo.vim'
  25. Plug 'junegunn/limelight.vim'
  26. Plug 'lervag/vimtex'
  27. Plug 'ap/vim-css-color'
  28. " Plug 'gilligan/vim-lldb'
  29. Plug 'critiqjo/lldb.nvim'
  30. Plug 'mattn/emmet-vim'
  31. Plug 'ctrlpvim/ctrlp.vim'
  32. Plug 'scrooloose/nerdcommenter'
  33. Plug 'pangloss/vim-javascript'
  34. Plug 'easymotion/vim-easymotion'
  35. " All of your Plugins must be added before the following line
  36. call plug#end() " required
  37. "
  38. " U S E R S E T U P
  39. "
  40. " jump between split lines
  41. map j gj
  42. map k gk
  43. "map mapleader / to (german layout)
  44. let mapleader = ","
  45. " execute current file
  46. nnoremap <leader>e :!'%:p'<CR>
  47. " Run `make` in current directory
  48. nnoremap <leader>m :!make<CR>
  49. " open build/*.pdf
  50. nnoremap <leader>o :!open build/*.pdf<CR>
  51. " open Nerdtree with CTRL+n
  52. map <C-n> :NERDTreeToggle<CR>
  53. " open Tagbar with CTRL+m
  54. map <C-m> :TagbarToggle<CR>
  55. " toggle background with CTRL+I
  56. map <C-I> :let &background = (&background == "dark" ? "light" : "dark")<CR>
  57. " :w for :W
  58. command W w
  59. command Wq wq
  60. command Q q
  61. command Qa qa
  62. command WQ wq
  63. set ai " Set auto inline on
  64. set number " Show line numbers
  65. syntax on " Set syntax highlighting on
  66. set tabstop=4 " width of tab
  67. " should be redundant after tabstop and expandtab,
  68. " but vim-snipmate is messing up (?)
  69. set softtabstop=4
  70. set shiftwidth=4
  71. set expandtab " use 'tabstop' spaces instead of tab
  72. set colorcolumn=80 " Bar hinting for 80 chars
  73. set breakindent "baby, yeah!
  74. set mouse=a " activate mouse support
  75. set ignorecase " ignore case while searching
  76. " handling backupfiles
  77. set backupdir=~/.config/nvim/backup//
  78. set directory=~/.config/nvim/swap//
  79. set undodir=~/.config/nvim/undo//
  80. " color scheme
  81. set background=light
  82. colo solarized
  83. " YCM Configuration
  84. " dont use python-mode autocomplete obsolete now, because of YCM
  85. let g:ycm_filetype_whitelist = {'cpp': 1, 'py': 1, 'python': 1, 'arduino': 1}
  86. " set ycm_extra_conf
  87. let g:ycm_global_ycm_extra_conf = '~/.ycm.py'
  88. " turn off the ycm diagnostic because of struggling with root
  89. "let g:ycm_show_diagnostics_ui = 0
  90. let g:ycm_autoclose_preview_window_after_insertion = 1
  91. let g:ycm_autoclose_preview_window_after_completion = 1
  92. " NERDTree Configuration
  93. " hide some fileextenxions
  94. let NERDTreeIgnore = ['\.pyc$']
  95. " vim-fugitive
  96. " gdiff vertical instead of horizontal
  97. set diffopt+=vertical
  98. " Airline stuff
  99. set laststatus=2
  100. let g:airline_powerline_fonts = 1
  101. let g:airline#extensions#tabline#enabled = 1
  102. let g:airline#extensions#tabline#buffer_nr_show = 1
  103. " multiple-cursors mapping
  104. let g:multi_cursor_use_default_mapping=0
  105. let g:multi_cursor_next_key='<C-d>'
  106. let g:multi_cursor_prev_key='<C-p>'
  107. let g:multi_cursor_skip_key='<C-x>'
  108. let g:multi_cursor_quit_key='<Esc>'
  109. " configure UltiSnips
  110. let g:UltiSnipsExpandTrigger='<C-j>'
  111. let g:UltiSnipsJumpForwardTrigger='<C-j>'
  112. let g:UltiSnipsJumpBackwardTrigger='<C-k>'
  113. " vCoolor config
  114. let g:vcoolor_map = '<C-c>'
  115. let g:vcool_ins_rgb_map = '' " Insert rgb color.
  116. let g:vcool_ins_hsl_map = '' " Insert hsl color.
  117. let g:vcool_ins_rgba_map = '' " Insert rgba color.
  118. " vim-javascript config
  119. let g:javascript_enable_domhtmlcss = 1
  120. " limelight+goyo settings
  121. let g:limelight_conceal_ctermfg = 'gray'
  122. autocmd! User GoyoEnter Limelight
  123. autocmd! User GoyoLeave Limelight!
  124. " Enable emmet-vim just for html/css
  125. let g:user_emmet_isntall_global = 0
  126. autocmd FileType html,css EmmetInstall
  127. " configure flake8
  128. " bind `,f` to Flake8
  129. nnoremap <leader>f :call Flake8()<CR>
  130. " instant markdown
  131. let g:instant_markdown_autostart = 0
  132. " activate mouse support
  133. set mouse=a
  134. set scrolloff=5
  135. " add some cpp-keywords
  136. syn keyword cppExceptions noexcept using
  137. " allow mouse clicks to change cursor position
  138. set noequalalways
  139. " list whitespaces and some other characters
  140. set listchars=tab:>-,trail:~
  141. set list
  142. " use latex flavour for plaintex files
  143. let g:tex_flavour="latex"