Compare commits

...

4 Commits

Author SHA1 Message Date
4aceb7aca9 Update build#dir() to configure coc-clangd 2021-01-28 13:33:55 +00:00
f23db08d92 Replace remaining YouCompleteMe mappings 2021-01-28 13:33:55 +00:00
8bdb7b7054 Replace YouCompleteMe with coc.nvim 2021-01-27 21:05:06 +00:00
ae30cf3a09 fresh: NonText as SpecialKey
Don't use `set highlight` to highlight `NonText` like `SpecialKey`,
instead simply set the color of `NonText` in the colorscheme.
2021-01-27 19:50:11 +00:00
6 changed files with 15 additions and 32 deletions

View File

@@ -37,8 +37,11 @@ function! build#dir(...) abort
if exists('l:dir')
" Set build directory and restart YouCompleteMe.
let $BUILD_DIR = getcwd().'/'.substitute(l:dir, '\/$', '', '')
let g:ycm_clangd_args = ['--compile-commands-dir='.$BUILD_DIR]
YcmRestartServer
" TODO: Check .vim/coc-settings.json exists, create it if not
let l:coc_settings = json_decode(join(readfile('.vim/coc-settings.json'), ''))
let l:coc_settings['clangd.compilationDatabasePath'] = $BUILD_DIR
call writefile([json_encode(l:coc_settings)], '.vim/coc-settings.json')
CocRestart
endif
endfunction

View File

@@ -112,7 +112,7 @@ if has('gui_running') || &t_Co == 256
call s:hi('MatchParen', '', '', '')
call s:hi('ModeMsg', '', '', '')
call s:hi('MoreMsg', '12', '', '')
call s:hi('NonText', '', '', '')
call s:hi('NonText', '238', '', '')
call s:hi('Normal', '7', '232', '')
call s:hi('Pmenu', '', '235', '')
call s:hi('PmenuSel', '', '', 'reverse')

1
init.vim Symbolic link
View File

@@ -0,0 +1 @@
vimrc

View File

@@ -1,9 +1,9 @@
" YouCompleteMe
nnoremap <leader>fi :YcmCompleter FixIt<CR>
nnoremap <leader>gd :YcmCompleter GoTo<CR>
nnoremap <leader>gt :YcmCompleter GetType<CR>
nnoremap <leader>sd :YcmShowDetailedDiagnostic<CR>
nnoremap <leader>D <plug>(YCMHover)
" coc.nvim
nmap <leader>fi <Plug>(coc-fix-current)
nmap <leader>gd <Plug>(coc-definition)
nmap <leader>gt <Plug>(coc-type-definition)
nmap <leader>sd <Plug>(coc-diagnostic-info)
nmap <leader>gr <Plug>(coc-references)
" termdebug
" TODO: Detecet if termdebug is loaded, if not do the default action.

View File

@@ -68,8 +68,6 @@ if has('linebreak')
set linebreak
" Downwards Arrow With Tip Rightwards (U+21B3, utf-8: E2 86 B3)
let &showbreak='↳ '
" Use same highlight group as listchars for showbreak
set highlight+=@:SpecialKey
endif
" TODO: spellcapcheck

23
vimrc
View File

@@ -34,22 +34,8 @@ endfor
" tabline.vim - sanely numbered tabs
Pack 'mkitt/tabline.vim'
" YouCompleteMe
Pack 'ycm-core/YouCompleteMe', {'type': 'opt'}
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:ycm_min_num_of_chars_for_completion = 1
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_always_populate_location_list = 1
let g:ycm_error_symbol = '▸'
let g:ycm_warning_symbol = '▸'
let g:ycm_goto_buffer_command = 'horizontal-split'
let g:ycm_use_clangd = 0
let g:ycm_auto_hover = 0
" coc.nvim Conqueror of Completion
Pack 'neoclide/coc.nvim', {'branch': 'release'}
" ultisnips - snippet engine
Pack 'SirVer/ultisnips'
@@ -200,8 +186,3 @@ Pack 'greymd/oscyank.vim', {'type': 'opt'}
if tmux#isOption('set-clipboard', 'on')
packadd oscyank.vim
endif
" Load YouComplteMe if termdebug plugin is not loaded.
if isdirectory(expand('~/.vim/pack/minpac/opt/YouCompleteMe'))
packadd YouCompleteMe
endif