0

I want to define a map for a several-words expression.

In ~/.config/nvim/init.vim :

:map abc a-b-c

works perfectly well.

But I want to do something like

:map a\ b\ c a-b-c

If I type "a b c", I want to see "a-b-c".

I've tried some combinations with the slashes, quotation marks, etc.

NOTE: My real use case is (in French) to auto-replace "c'est à dire" by "c'est-à-dire"; thus I also need to be able to insert a simple quote ' in the expressions.

2
  • Do you want this to occur in insert mode? Because if you do you need to use inoremap or for recursive mapping imap. You can see what commands to use for each mode by doing :help map-modes in vim or online here Commented Oct 16 at 15:33
  • Yes, I need it in insert mode. Commented Oct 17 at 3:14

0

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.