Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 1 | nmap <silent> ]c :silent! call CocAction('diagnosticNext')<cr> |
| 2 | nmap <silent> [c :silent! call CocAction('diagnosticPrevious')<cr> |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 3 | nmap <silent> <Leader>fs <Plug>(coc-codeaction-selected) |
Skyler Grey | 97efa1a | 2022-10-30 23:10:37 +0000 | [diff] [blame] | 4 | nmap <silent> <Leader>fb <Plug>(coc-codeaction) |
| 5 | nmap <silent> <Leader>ff <Plug>(coc-codeaction-cursor) |
| 6 | nmap <silent> <Leader>fc <Plug>(coc-codeaction-cursor) |
| 7 | nmap <silent> <Leader>fr <Plug>(coc-rename) |
| 8 | nmap <silent> <Leader>fi <Plug>(coc-fix-current) |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 9 | nmap <silent> <Leader>gd <Plug>(coc-definition)zz |
Skyler Grey | fab867f | 2023-01-25 21:45:01 +0000 | [diff] [blame] | 10 | nmap <silent> <Leader>gt <Plug>(coc-type-definition) |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 11 | nmap <silent> <Leader>gi <Plug>(coc-implementation)zz |
Skyler Grey | fab867f | 2023-01-25 21:45:01 +0000 | [diff] [blame] | 12 | nmap <silent> <Leader>gr <Plug>(coc-references) |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 13 | nmap <Leader>fe <Cmd>CocCommand explorer<CR> |
| 14 | |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 15 | let g:UltiSnipsExpandTrigger="<NUL>" |
| 16 | let g:UltiSnipsJumpForwardTrigger="<NUL>" |
| 17 | let g:UltiSnipsJumpBackwardTrigger="<NUL>" |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 18 | |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 19 | inoremap <silent><expr> <CR> coc#pum#visible() ? "\<C-G>u" . coc#pum#confirm() : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 20 | \ coc#jumpable() ? "\<Esc>:call coc#snippet#next()\<CR>" : |
| 21 | \ tablemode#table#IsTable('.') && !(tablemode#spreadsheet#GetLastRow(".") == line('.')) && !(tablemode#spreadsheet#GetLastRow(".") == 0) ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('j')\<CR>:call tablemode#spreadsheet#MoveToStartOfCell()\<CR>" . mode() : |
| 22 | \ tablemode#table#IsTable('.') ? "<Esc>$a<CR>" : |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 23 | \ "\<C-G>u\<Plug>(PearTreeExpand)" |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 24 | |
| 25 | inoremap <silent><expr> <S-CR> tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('k')\<CR>:call tablemode#spreadsheet#MoveToStartOfCell()\<CR>" . mode() : "\<S-CR>" |
| 26 | |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 27 | let g:codeium_no_map_tab = 1 |
| 28 | let g:codeium_tab_fallback = "" |
| 29 | inoremap <silent><expr> <Tab> |
| 30 | \ coc#pum#visible() ? coc#pum#next(0) : |
| 31 | \ coc#expandableOrJumpable() ? "\<C-G>u\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" : |
| 32 | \ codeium#Accept() != "" ? "\<C-G>u" . codeium#Accept() : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 33 | \ pear_tree#GetSurroundingPair() != [] ? pear_tree#insert_mode#JumpOut() : |
| 34 | \ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('l')\<CR>" . mode() : |
| 35 | \ CheckBackSpace() ? "\<TAB>" : coc#refresh() |
Skyler Grey | 81f4af6 | 2022-10-31 00:10:52 +0000 | [diff] [blame] | 36 | |
| 37 | function! CheckBackSpace() abort |
| 38 | let col = col('.') - 1 |
| 39 | return !col || getline('.')[col - 1] =~# '\s' |
| 40 | endfunction |
| 41 | |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 42 | inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(0) : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 43 | \ coc#jumpable() ? "\<Esc>:call coc#snippet#prev()\<CR>" : |
| 44 | \ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('h')\<CR>" . mode() : |
Skyler Grey | 8fd63d0 | 2022-10-31 00:26:44 +0000 | [diff] [blame] | 45 | \ "\<Plug>(PearTreeJump)" |
Skyler Grey | 81f4af6 | 2022-10-31 00:10:52 +0000 | [diff] [blame] | 46 | xnoremap <silent> <Tab> <Plug>(coc-snippets-select) |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 47 | |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 48 | nnoremap <silent><expr> <CR> coc#jumpable() ? |
| 49 | \ ":call coc#snippet#next()\<CR>" : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 50 | \ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('j')\<CR>:call tablemode#spreadsheet#MoveToStartOfCell()\<CR>" : |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 51 | \ "\<C-G>u\<CR>" |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 52 | |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 53 | nnoremap <silent><expr> <S-CR> tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('k')\<CR>:call tablemode#spreadsheet#MoveToStartOfCell()\<CR>" : "\<S-CR>" |
| 54 | |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 55 | nnoremap <silent><expr> <Tab> coc#jumpable() ? |
| 56 | \ ":call coc#snippet#next()\<CR>" : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 57 | \ pear_tree#GetSurroundingPair() != [] ? pear_tree#insert_mode#JumpOut() : |
| 58 | \ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('l')\<CR>" : |
| 59 | \ "\<Tab>" |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 60 | |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 61 | nnoremap <silent><expr> <S-Tab> coc#jumpable() ? |
| 62 | \ ":call coc#snippet#prev()\<CR>" : |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 63 | \ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('h')\<CR>" : |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 64 | \ "\<S-Tab>" |
| 65 | |
| 66 | snoremap <silent><expr> <CR> coc#jumpable() ? |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 67 | \ "\<Esc>:call coc#snippet#next()\<CR>" : |
Skyler Grey | 9febe7b | 2023-01-25 21:31:33 +0000 | [diff] [blame] | 68 | \ "\<C-G>u\<CR>" |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 69 | |
| 70 | snoremap <silent><expr> <Tab> coc#jumpable() ? |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 71 | \ "\<Esc>:call coc#snippet#next()\<CR>" : |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 72 | \ (pear_tree#GetSurroundingPair() != [] ? pear_tree#insert_mode#JumpOut() : "\<Tab>") |
| 73 | |
| 74 | snoremap <silent><expr> <S-Tab> coc#jumpable() ? |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 75 | \ "\<Esc>:call coc#snippet#prev()\<CR>" : |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 76 | \ "\<S-Tab>" |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 77 | |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 78 | noremap <C-CR> <CR> |
| 79 | |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 80 | inoremap <nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<C-f>" |
| 81 | inoremap <nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<C-b>" |
| 82 | |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 83 | function! s:show_documentation() |
| 84 | if (index(['vim','help'], &filetype) >= 0) |
| 85 | execute 'h '.expand('<cword>') |
| 86 | else |
| 87 | call CocAction('doHover') |
| 88 | endif |
| 89 | endfunction |
| 90 | |
| 91 | nnoremap <silent> K :call <SID>show_documentation()<CR> |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 92 | |
| 93 | command Snippets CocFzfList snippets |