3

So I went digging for this one and as far as I can tell this behavior has been present ever since the user-defined command feature was introduced in Vim 5.2. Initially I thought this was present because a user comand takes its arguments from <...> special sequences, such as <args> or <bang>, which makes it so that it takes <lt> to ...


3

You can use :cnoremap, which works for search / but also for Ex commands, that you enter with :. See :help :map-modes for more information on the map modes available. (To be exact, there are a few more cases where the command-line mappings apply, such as the input() function, or entering an expression for the expression register with <C-R>= from Insert ...


2

All you need to do is insert <C-\> before the <C-o>. inoremap <C-_> <C-\><C-o>dB Help for i_CTRL-\_CTRL-O says: CTRL-\ CTRL-O : like CTRL-O but don't move the cursor That's it. Well except for a caveat or two which I'll reproduce here for your convenience ;) ... The CTRL-O command sometimes has a side effect: If the cursor ...


2

Since you're looking at pairing open/close tags across multiple lines (enclosing a block) and in your case it makes sense to insert the closing tag when breaking the line, my suggestion is to add a mapping to the Enter key in Insert mode and then use an <expr> to decide whether we need to add the closing tag. You can make that decision based on the ...


2

Use nmap instead of nnoremap for <Plug> mappings: nmap mk <Plug>MarkdownPreviewToggle The <Plug> mappings are defined by plug-ins, so you need to be able to expand other mappings in your expansion in this case.


1

When I try your mapping for <C-/> nothing happens for me either. I've also had my own issues when I wanted to use <A-/> as well. As @b-layer and @filbranden pointed out, there are certain key combinations that are difficult to map, if not impossible. If you need more mapping key combinations, @b-layer referenced how to set up mapping the Alt key ...


1

Rather than rolling your own mappings for this purpose, I'd recommend adopting the excellent vim-unimpaired plug-in, which defined two specific mappings for this purpose: [n Go to the previous SCM conflict marker or diff/patch hunk. Try d[n inside a conflict. ]n Go to the next SCM conflict ...


Only top voted, non community-wiki answers of a minimum length are eligible