Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Completion breaks jumping to the next placeholder in ultisnips #389

Open
devenv opened this issue Jul 28, 2021 · 3 comments
Open

Completion breaks jumping to the next placeholder in ultisnips #389

devenv opened this issue Jul 28, 2021 · 3 comments

Comments

@devenv
Copy link

devenv commented Jul 28, 2021

Jumping to the next placeholder in a snippet doesn't work after a completion.

My testing minimal init.vim

call plug#begin('~/test') 
    Plug 'SirVer/ultisnips'
    Plug 'honza/vim-snippets'
    Plug 'neovim/nvim-lsp'
    Plug 'nvim-lua/completion-nvim'
    Plug 'nvim-lua/completion-nvim'
call plug#end()
lua require'nvim_lsp'.pyls.setup{on_attach=require'completion'.on_attach}
au Filetype lua setl omnifunc=v:lua.vim.lsp.omnifunc
" Use <Tab> and <S-Tab> to navigate through popup menu
inoremap <expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

" Set completeopt to have a better completion experience
set completeopt=menuone,noinsert,noselect

Tried without inoremap <tab> too.

How to reproduce
Expand any snippet with two or more placeholders, autocomplete anything then press tab, it doesn't work.
e.g. from ${1} import ${2}
from<tab><c-n><c-n><cr><tab>
while from<tab><tab> does work.

@ranjithshegde
Copy link
Contributor

This is a known Utlisnip problem. Whatever "expand" imap you have for snippets in UltiSnips (default is tab), you cant use that key anywhere else.
So I would suggest something like C-n and C-p for pumvisible popup and Tab S-Tab for UtliSnip expansion

@devenv
Copy link
Author

devenv commented Jul 29, 2021

Thanks for reply :)
But I don't use tab for completion, I use C-n.

@devenv
Copy link
Author

devenv commented Jul 29, 2021

I changed utlisnips mapping to

let g:UltiSnipsExpandTrigger = "<C-l>"
let g:UltiSnipsJumpForwardTrigger = "<C-l>"
let g:UltiSnipsJumpBackwardTrigger = "<C-h>"

same behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants