Skip to content

Improve setup of mappings #50

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 3, 2014

  • Use <unique> maps, catch already-exists error and provide help
  • Prefer remapping of <Plug> over <CR>
  • Only call maparg once

`<CR>` might be mapped to `<CR><Plug>Foo` and must then not get
remapped with `<script>`.
Instead of silently overwriting any (not previously handled) existing
mappings, use `<unique>` inside a `try` block and provide help to fix
it.
@jonahx
Copy link

jonahx commented Jan 15, 2016

Hi blueyed, I'm trying to get endwise to work with neocomplete, which I use the following mapping with, in order to use <CR> to accept the first autosuggestion:

imap <silent> <expr> <CR> <SID>my_cr_function()
function! s:my_cr_function()
  return pumvisible() ? "\<c-y>\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
endfunction

I've tried your patch, and I get the endwise: not overwriting existing map (mapping already exists for ^M). error with it. Can you suggest a solution? Thanks.

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

Successfully merging this pull request may close these issues.

2 participants