Map coc.nvim bindings only if coc is installed
This commit is contained in:
		
							parent
							
								
									601ba8f1ec
								
							
						
					
					
						commit
						37fb739795
					
				
					 2 changed files with 21 additions and 19 deletions
				
			
		|  | @ -1,6 +1,8 @@ | ||||||
|  | if exists(":CocAction") | ||||||
|  |   set signcolumn=yes | ||||||
|   map <silent> gd <Plug>(coc-definition) |   map <silent> gd <Plug>(coc-definition) | ||||||
| 
 | 
 | ||||||
| map <silent> <M-=> :call CocAction("doHover")<cr> |   map <silent> <M-=> <cmd>call CocAction("doHover")<cr> | ||||||
|   map <silent> <Leader>t <Plug>(coc-type-definition) |   map <silent> <Leader>t <Plug>(coc-type-definition) | ||||||
|   map <silent> <Leader>u <Plug>(coc-references) |   map <silent> <Leader>u <Plug>(coc-references) | ||||||
|   map <silent> <Leader>r <Plug>(coc-rename) |   map <silent> <Leader>r <Plug>(coc-rename) | ||||||
|  | @ -15,3 +17,4 @@ vmap <silent> <M-a> <Plug>(coc-codeaction-selected) | ||||||
| 
 | 
 | ||||||
|   omap <silent> af <Plug>(coc-funcobj-a) |   omap <silent> af <Plug>(coc-funcobj-a) | ||||||
|   omap <silent> if <Plug>(coc-funcobj-i) |   omap <silent> if <Plug>(coc-funcobj-i) | ||||||
|  | endif | ||||||
|  |  | ||||||
|  | @ -7,14 +7,13 @@ endif | ||||||
| "inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>" | "inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>" | ||||||
| "inoremap <expr><BS>  deoplete#smart_close_popup()."\<C-h>" | "inoremap <expr><BS>  deoplete#smart_close_popup()."\<C-h>" | ||||||
| 
 | 
 | ||||||
| inoremap <silent><expr> <TAB>  | "inoremap <silent><expr> <TAB> | ||||||
|       \ pumvisible() ? "\<C-n>" : | "      \ pumvisible() ? "\<C-n>" : | ||||||
|       \ <SID>check_back_space() ? "\<TAB>" : | "      \ <SID>check_back_space() ? "\<TAB>" : | ||||||
|       \ coc#refresh() |  | ||||||
| "      \ '\<C-x><C-o>' | "      \ '\<C-x><C-o>' | ||||||
| 
 | 
 | ||||||
| function! s:check_back_space() | function! s:check_back_space() | ||||||
|   let col = col('.') - 1 |   let col = col('.') - 1 | ||||||
|   return !col || getline('.')[col - 1]  =~ '\s' |   return !col || getline('.')[col - 1]  =~ '\s' | ||||||
| endfunction | endfunction | ||||||
| inoremap <silent><expr> <c-space> coc#refresh() | "inoremap <silent> <c-space> <C-x><C-o> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexander Gehrke
						Alexander Gehrke