blob: 0116a91b31a6e77565f2e8d44a3d8eef6c7dca26 [file] [log] [blame]
Skyler Greya7feb6e2022-08-26 06:51:55 +01001nmap <silent> ]c :call CocAction('diagnosticNext')<cr>
2nmap <silent> [c :call CocAction('diagnosticPrevious')<cr>
3nmap <silent> <Leader>fs <Plug>(coc-codeaction-selected)
Skyler Grey97efa1a2022-10-30 23:10:37 +00004nmap <silent> <Leader>fb <Plug>(coc-codeaction)
5nmap <silent> <Leader>ff <Plug>(coc-codeaction-cursor)
6nmap <silent> <Leader>fc <Plug>(coc-codeaction-cursor)
7nmap <silent> <Leader>fr <Plug>(coc-rename)
8nmap <silent> <Leader>fi <Plug>(coc-fix-current)
Skyler Greya7feb6e2022-08-26 06:51:55 +01009nmap <Leader>fe <Cmd>CocCommand explorer<CR>
10
Skyler Greyf066b512022-10-31 00:02:48 +000011let g:UltiSnipsExpandTrigger="<NUL>"
12let g:UltiSnipsJumpForwardTrigger="<NUL>"
13let g:UltiSnipsJumpBackwardTrigger="<NUL>"
14inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
Skyler Grey81f4af62022-10-31 00:10:52 +000015inoremap <silent><expr> <Tab> coc#pum#visible() ? coc#pum#next(0) :
16 \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
17 \ CheckBackSpace() ? "\<TAB>" :
18 \ coc#refresh()
19
20function! CheckBackSpace() abort
21 let col = col('.') - 1
22 return !col || getline('.')[col - 1] =~# '\s'
23endfunction
24
25let g:coc_snippet_next = '<tab>'
26inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(0) : "\<S-Tab>"
27xnoremap <silent> <Tab> <Plug>(coc-snippets-select)
Skyler Greyf066b512022-10-31 00:02:48 +000028
29
30snoremap <nowait><silent> <Tab> <Esc>:call UltiSnips#JumpForwards()<cr>
31snoremap <nowait><silent> <S-Tab> <Esc>:call UltiSnips#JumpForwards()<cr>
Skyler Grey81f4af62022-10-31 00:10:52 +000032inoremap <silent><silent> <C-s> <Esc>l:Snippets<cr>
Skyler Greyf066b512022-10-31 00:02:48 +000033
34
Skyler Greya7feb6e2022-08-26 06:51:55 +010035function! s:show_documentation()
36if (index(['vim','help'], &filetype) >= 0)
37execute 'h '.expand('<cword>')
38else
39call CocAction('doHover')
40endif
41endfunction
42
43nnoremap <silent> K :call <SID>show_documentation()<CR>