Skip to content
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

Conflict with viki #25

Closed
fschwach opened this issue Oct 23, 2012 · 3 comments
Closed

Conflict with viki #25

fschwach opened this issue Oct 23, 2012 · 3 comments

Comments

@fschwach
Copy link

Hi jiangmiao,

I know this is not your script's fault but I was wondering if you maybe have a solution for it or if it would be possible to even modify your script to avoid this problem?

I am using viki/Deplate (http://www.vim.org/scripts/script.php?script_id=861)
and just noticed that auto-pairs causes a serious issue in viki, probably because of the remapping of ?

When I have auot-pairs in my plugin folder and open a page in viki then whenever I hit ENTER, I get this:

viki#ExprMarkInexistentInElement('ParagraphVisible','
')

I don't know how to explore further what is going on and whether there could be a workaround. I tried toggling auto-pairs in viki files but even when auto-pairs is off I get the above problem. It only goes away if I remove auto-pairs from the plugin folder.

@jiangmiao
Copy link
Owner

viki use <expr> to map keys, so it is conflict with auto-pairs. currently there is no easy solution to solve it. there is 2 way

  1. easier way: disable <CR> mapping. addlet g:AutoPairsMapCR = 0` to .vimrc
  2. compatible viki and auto-pairs mapping
    add
autocmd filetype viki inoremap <buffer> <silent> <CR> <C-R>=viki#ExprMarkInexistentInElement('ParagraphVisible',"\n")<CR><C-R>=AutoPairsReturn()<CR>

.vimrc (need not add let g:AutoPairsMapCR = 0)

for solution 2, I didn't know how to trigger viki's <CR> effect, so only test AutoPairsReturn(). if still cannot work, then have to use solution 1.

@fschwach
Copy link
Author

Thank you so much jiangmiao, solution 2 works perfectly! I I don't need auto-pairs in vki files anyway, so no problem if I don't have the mapping. As this could be a more general problem with other plugins as well I think it would be great if you could add the above into your README file.
Let me take the opportunity to say that I really like your plugin. Have been trying similar ones for ages and somehow missed yours but yours is the only one I came across that actually gets the formatting right and does what I would expect. Nice work!

@jiangmiao
Copy link
Owner

Thank you. Glad you like it. the README file has updated and added viki compatible hints.

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

No branches or pull requests

2 participants