coc-snippets icon indicating copy to clipboard operation
coc-snippets copied to clipboard

Can't expand snippets (neovim inside of powershell)

Open JBic9832 opened this issue 1 year ago • 3 comments

So I am using neovim inside of powershell and have gotten code snippets to appear properly but I am unable to expand them. I added the following to the snippet.vim file:

inoremap <silent><expr> <TAB>
      \ coc#pum#visible() ? coc#_select_confirm() :
      \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
      \ CheckBackSpace() ? "\<TAB>" :
      \ coc#refresh()

function! CheckBackSpace() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

let g:coc_snippet_next = '<tab>'

When I press tab it just tabs over and snippets dissapear. I dont know if its my config or powershell. Any help would be much appreciated.

JBic9832 avatar Sep 15 '22 23:09 JBic9832

:verbose imap <tab>

chemzqm avatar Sep 16 '22 01:09 chemzqm

Okay so now tab no longer tabs over but when in the snippets menu but it doesn't expand the snippets when i use

imap <C-l> <Plug>(coc-snippets-expand)

in coc.vim or snippet.vim

JBic9832 avatar Sep 16 '22 02:09 JBic9832

Don't know, you can debug it https://github.com/neoclide/coc.nvim/wiki/Debug-coc.nvim

chemzqm avatar Sep 16 '22 05:09 chemzqm

With imap <C-l> <Plug>(coc-snippets-expand), you have to make sure it's called and you have trigger ahead of cursor.

chemzqm avatar Nov 05 '22 09:11 chemzqm