diff --git a/coc-settings.json b/coc-settings.json new file mode 100644 index 0000000..c1e478b --- /dev/null +++ b/coc-settings.json @@ -0,0 +1,13 @@ +{ + "languageserver": { + "cquery": { + "command": "cquery", + "args": ["--log-file=/tmp/cq.log"], + "filetypes": ["c", "cpp"], + "rootPatterns": ["compile_flags.txt", "compile_commands.json", ".vim/", ".git/", ".hg/"], + "initializationOptions": { + "cacheDirectory": "/tmp/cquery" + } + } + } +} diff --git a/init.vim b/init.vim index 97603a0..79e8aaa 100644 --- a/init.vim +++ b/init.vim @@ -2,6 +2,8 @@ let hostname = substitute(system('hostname'), '\n', '', '') " =============Plugins================== call plug#begin() Plug 'morhetz/gruvbox' +Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'chemzqm/denite-git' Plug 'tomtom/tcomment_vim' Plug 'bling/vim-airline' Plug 'vim-airline/vim-airline-themes' @@ -9,7 +11,7 @@ Plug 'vim-airline/vim-airline-themes' Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} Plug 'tpope/vim-fugitive' Plug 'airblade/vim-gitgutter' -" Plug 'Shougo/neosnippet.vim' +Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' Plug 'vim-scripts/a.vim' Plug 'luochen1990/rainbow' @@ -143,13 +145,6 @@ end let g:deoplete#enable_at_startup = 1 let g:deoplete#auto_complete_start_length = 1 let g:deoplete#enable_smart_case = 1 -" =========================neosnippet================== -" " Enable snipMate compatibility feature. -let g:neosnippet#enable_snipmate_compatibility = 1 -" Tell Neosnippet about the other snippets -imap neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : pumvisible() ? "\" : "\" -smap neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : "\" -" conceal neosnippet markers " =====================A====================== " Function for switching between header and c* files map :wa :A @@ -162,6 +157,10 @@ let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,../../inclu " Dont create the file if the .cpp or .h is not found let g:alternateNoDefaultAlternate = 1 +" ===================UltiSnips================ +let g:UltiSnipsExpandTrigger = "(ultisnips_expand)" +let g:UltiSnipsJumpForwardTrigger = "" +let g:UltiSnipsJumpBackwardTrigger = "" " ===========RAINBOW==================== let g:rainbow_active = 1 let g:rainbow_conf = { @@ -210,3 +209,27 @@ if has("win32") let g:chromatica#libclang_path='D:\Tools\LLVM\bin\libclang.dll' end end + +" ===================COC============================= +inoremap coc#refresh() +autocmd CursorHold * silent call CocActionAsync('highlight') +" Remap for format selected region +vmap f (coc-format-selected) +nmap f (coc-format-selected) +" Use `:Format` for format current buffer +command! -nargs=0 Format :call CocAction('format') +" Shortcuts for denite interface +" Show extension list +nnoremap e :Denite coc-extension +" Show symbols of current buffer +nnoremap o :Denite coc-symbols +" Search symbols of current workspace +nnoremap t :Denite coc-workspace +" Show diagnostics of current workspace +nnoremap a :Denite coc-diagnostic +" Show available commands +nnoremap c :Denite coc-command +" Show available services +nnoremap s :Denite coc-service +" Show links of current buffer +nnoremap l :Denite coc-link