New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaks other plugins that map <CR> in insert mode #33
Comments
It looks like the extra newline is coming from endwise's
You could just omit this by changing [update] .......except that won't work because vim-endwise wants to be invoked after So instead of return "\<CR>" we could do if exists('*EndwiseDiscretionary')
return "\<CR>\<C-R>=EndwiseDiscretionary()\<CR>"
else
return "\<CR>"
endif |
Hello! It appears that putting I don't really like the idea of having plugin-specific compatibility code in Pear Tree, so if putting the above in your vimrc does work, I would consider that the official solution. |
This plugin (or precisely the imap ) also breaks vim-clap. Is there any general solution that is agnostic of other plugins but preserves the mapping chian? |
Since Pear Tree isn't really useful in vim-clap's popup I disabled Pear Tree in that filetype: let g:pear_tree_ft_disabled = ['clap_input'] But that kind of an approach only works for some use cases though. |
Well, just to add something to the list of stuff that breaks with the |
I think I have solve my mapping issue for neosnippet and ncm2 with the following mappings: let g:pear_tree_map_special_keys = 0
imap <BS> <Plug>(PearTreeBackspace)
imap <Esc> <Plug>(PearTreeFinishExpansion)
imap <expr><CR> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<Plug>(PearTreeExpand)" |
For anyone using this is coc.nvim, here's how I got the autocomplete window to work properly with PearTreeExpand (much thanks to jounathaen above): " Disable automapping so we can fix Coc mapping.
let g:pear_tree_map_special_keys = 0
" Default mappings:
imap <BS> <Plug>(PearTreeBackspace)
imap <Esc> <Plug>(PearTreeFinishExpansion)
" Get PearTreeExpand working with coc.nvim
imap <expr> <CR> pumvisible() ? coc#_select_confirm() : "\<Plug>(PearTreeExpand)" Note: you have to use |
This worked for me. In markdown documents using vimwiki, hitting in a list is expected to continue the list, but pear-tree was interfering with that functionality before using this fix. |
the |
@mellery451 did you fix it? I am facing the same problem now |
@Leo310 my fix was to remove this plugin - I need Telescope more than I need this so it was not a big loss of productivity. |
Ah ok I see. I switched to auto-pair plugin |
You can disable pear-tree in telescope prompt with
|
for lua nvim I used the following: vim.g.pear_tree_ft_disabled = 'TelescopePrompt' |
This code wasn't working for me (would just paste function! CustomCR() abort
" Make <CR> to accept selected completion item or notify coc.nvim to format.
if coc#pum#visible()
return coc#_select_confirm()
else
" Undo each individual enter action as opposed to undo in blocks.
" call feedkeys("\<C-g>u")
call coc#on_enter()
return "\<Plug>(PearTreeExpand)"
endfunction
" Get PearTreeExpand working with coc.nvim
imap <silent><expr> <CR> CustomCR() I haven't fully tested it but from the 5 minutes of playing around with it, it seems to work. |
...specifically, endwise.vim, a vital plugin for languages like ruby and viml that use
end
(and its variants) to close code blocks.A quickfix is to change:
to
...though this adds an extra blank line, for example, typing
def foo<CR>hi!
produces:...so this isn't a full solution.
This plugin, along with its great config, is the only one of its type that actually does what I want so I'm pretty invested in resolving this! I'd be happy to take it on myself I wanted to file an issue first to get your thoughts and see if you'd even be amenable to a PR.
The text was updated successfully, but these errors were encountered: