Sunday, August 29, 2021

Re: [key combinations, shortcuts]

On Thu, Aug 26, 2021 at 04:08:49PM +0300, Maxim Abalenkov wrote:
>After further investigation I came up with the following solution:
>
>:imap <C-h> {% highlight perl %}<Enter><Enter>{% endhighlight %}<Up>
>
>Please correct me, if there are any obvious mistakes. Thank you!

Just one: you should use inoremap instead of imap. inoremap will prevent the expansion of further maps taking place on the right-hand side. For example, if you had mapped "e" to "X" (":inoremap e X"), you'd have ended up with

{% highlight pXrl %}

{% Xndhighlight %}

Also, bear in mind that in terminal vim, <c-h> is the same as control-backspace, so either one of those keystrokes would trigger your mapping.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YSu/W3AVwb9G%2B0VP%40rainslide.net.

No comments: