0

The vim binding I have created works well enough, although I would like the binding to actually execute the function for me. What currently happens is I enter the binding and my function shows up in the : prompt, then I press enter to activate the function. Is there some way to include the return character in my binding?

Here is the binding:

map <C-C> :call myfunc()

when I press ctrl+c, call myfunc() shows up in the : prompt and I can press enter to activate the function. Is there some way for me to simple press ctrl-c to activate myfunc?

Is there some way for me to add the return character to this

Edit: I tried to recreate this, and now the prompt doesn't show up. I want to create a key binding so that when I press ctrl+c, or ideally ctrl+shift+c, myfunc() is executed.

1
  • 1
    Beware that <C-c> is used by the interrupt signal. It's highly recommended to leave it alone. Commented Jul 13, 2015 at 8:02

1 Answer 1

1

It should be

map <C-C> :call myfunc()<CR>

CR is Carriage return or Enter

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Is there a way to bind cmd+shift+c? map <C-S-C> isn't working for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.