Advertisement
Guest User

Untitled

a guest
Jan 8th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.19 KB | None | 0 0
  1. filetype indent on
  2. filetype plugin on
  3. syntax on
  4.  
  5. set secure
  6. set exrc
  7.  
  8. set expandtab
  9. set tabstop=4
  10. set shiftwidth=4
  11. set smartindent
  12. set copyindent
  13. set smarttab
  14.  
  15. set number relativenumber
  16. set signcolumn=yes
  17. set cursorline
  18.  
  19. set undodir=~/.config/nvim/undo
  20. set undofile
  21. set nobackup
  22. set nowritebackup
  23.  
  24. set shortmess+=Ic
  25.  
  26. set foldmethod=syntax
  27. set foldlevel=99
  28. nnoremap <tab> za
  29.  
  30. set mouse=a
  31.  
  32. set updatetime=300
  33.  
  34. set hidden
  35.  
  36. set smartcase
  37.  
  38. set completeopt+=preview
  39.  
  40. set termguicolors
  41.  
  42. nnoremap <silent> <esc> :noh<cr><esc>
  43. nnoremap <silent> <space> :FZF<cr>
  44.  
  45. "Plugins{{{
  46. call plug#begin('~/.config/nvim/plugged')
  47. Plug 'chriskempson/base16-vim'
  48. Plug 'octol/vim-cpp-enhanced-highlight'
  49. Plug 'jeffkreeftmeijer/vim-numbertoggle'
  50. Plug 'jiangmiao/auto-pairs'
  51. Plug 'ludovicchabant/vim-gutentags'
  52. Plug 'tpope/vim-unimpaired'
  53. Plug 'mkitt/tabline.vim'
  54. Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  55. Plug 'junegunn/fzf.vim'
  56. Plug 'dense-analysis/ale'
  57. Plug 'neoclide/coc.nvim', {'branch': 'release'}
  58. Plug 'vim-airline/vim-airline'
  59. Plug 'vim-airline/vim-airline-themes'
  60. Plug 'ctrlpvim/ctrlp.vim'
  61. Plug 'majutsushi/tagbar'
  62. "}}}
  63. "Plugin options{{{
  64. "auto-pairs options{{{
  65. let g:AutoPairsMapCR=0
  66. "}}}
  67. "gutentags options{{{
  68. let g:gutentags_project_root=[]
  69. cal add(g:gutentags_project_root, 'tags')
  70. "}}}
  71. "ale options{{{
  72. let g:ale_cpp_ccls_init_options={
  73.             \   'cache': {
  74.             \       'directory': '/tmp/ccls/cache'
  75.             \   }
  76.             \ }
  77. let g:ale_c_parse_compile_commands=1
  78. let g:ale_linters={
  79.             \   'cpp': ['ccls', 'clangtidy']
  80.             \}
  81. "}}}
  82. "coc.nvim options{{{
  83. inoremap <silent><expr> <TAB>
  84.       \ pumvisible() ? "\<C-n>" :
  85.       \ <SID>check_back_space() ? "\<TAB>" :
  86.       \ coc#refresh()
  87. inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
  88.  
  89. function! s:check_back_space() abort
  90.   let col = col('.') - 1
  91.   return !col || getline('.')[col - 1]  =~# '\s'
  92. endfunction
  93.  
  94. inoremap <silent><expr> <c-space> coc#refresh()
  95. inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
  96.  
  97. nnoremap <silent> K :call <SID>show_documentation()<CR>
  98.  
  99. function! s:show_documentation()
  100.   if (index(['vim','help'], &filetype) >= 0)
  101.     execute 'h '.expand('<cword>')
  102.   else
  103.     call CocAction('doHover')
  104.   endif
  105. endfunction
  106.  
  107. autocmd CursorHold * silent call CocActionAsync('highlight')
  108.  
  109. nmap <leader>rn <Plug>(coc-rename)
  110. nmap <silent> gd <Plug>(coc-definition)
  111. nmap <silent> gy <Plug>(coc-type-definition)
  112. nmap <silent> gi <Plug>(coc-implementation)
  113. nmap <silent> gr <Plug>(coc-references)
  114. "}}}
  115. "airline options{{{
  116. let g:airline#extensions#tabline#enabled=1
  117. let g:airline#extensions#tabline#formatter='unique_tail_improved'
  118. let g:airline_powerline_fonts=1
  119. let g:airline_left_sep=''
  120. let g:airline_left_alt_sep=''
  121. let g:airline_right_sep=''
  122. let g:airline_right_alt_sep=''
  123. "}}}
  124. "ctrlpvim options{{{
  125. let g:ctrlp_map='<c-p>'
  126. "}}}
  127. "}}}
  128.  
  129. call plug#end()
  130.  
  131. colorscheme base16-default-dark
  132. let g:airline_theme='base16_default'
  133. "Extra theme customization{{{
  134. hi! clear SignColumn
  135. hi! LineNr guibg=NONE
  136. hi! StatusLine guibg=#1F1F1F guifg=#909090
  137. hi! Folded guibg=Normal
  138. "}}}
  139.  
  140. " vim: fdm=marker: fdl=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement