blob: ae7e1742adef181e610773131809160b418e9e69 [file] [log] [blame]
Skyler Grey3d1b4502022-10-31 00:11:11 +00001nmap <silent> ]c :silent! call CocAction('diagnosticNext')<cr>
2nmap <silent> [c :silent! call CocAction('diagnosticPrevious')<cr>
Skyler Greya7feb6e2022-08-26 06:51:55 +01003nmap <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>
32
33
Skyler Greya7feb6e2022-08-26 06:51:55 +010034function! s:show_documentation()
35if (index(['vim','help'], &filetype) >= 0)
36execute 'h '.expand('<cword>')
37else
38call CocAction('doHover')
39endif
40endfunction
41
42nnoremap <silent> K :call <SID>show_documentation()<CR>
Skyler Grey3d1b4502022-10-31 00:11:11 +000043
44command Snippets CocFzfList snippets
45
46autocmd FileType tex let b:coc_pairs = [["$", "$"]]
47autocmd FileType markdown let b:coc_pairs = [["$", "$"]]