Hot answers tagged

5

I want to end up in insert mode after a macro. Is there a way to do that? Yes! You can stop recording a macro using Ctrl+O, q (Ctrl+O is a sequence to enter a single Normal-mode command from Insert mode, see :help i_CTRL-O.) This will result In a macro that, when replayed, will leave you in Insert mode, after inserting any characters you have inserted as ...


3

I think you're missing some fundamentals from vim (and I don't mean this in a "one true way to Vim" sense, although my first point does come close to that). As statox mentions in the comments, running vimtutor might be a good starting point. Here's a faster process: You're already in normal mode. It's the default (hence "normal"). So no ...


3

In Vim there are :h [p and :h ]p key bindings which do both "put" and "indent adjust" with respect to the current line. Normally that's exactly what one wants.


3

Here's a pure Vim solution: Put the cursor on the first line on the leftmost column you want to yank Hit Ctrl+V Move the cursor down to the last line Hit $ Yank away.


2

While I normally advise against remapping <CR> I think here that could be a correct solution: cnoremap <expr> <CR> (getcmdtype() == ':' && getcmdline() =~ '^w$')? '<BS>echoerr "Dont use :w"<CR>' : "<CR>" cnoremap greats an mapping only in command mode (i.e. :, / or ?) when you type <CR>. (...


1

Yes there is. Yesterday I gave this answer on the mother site: SO. TL;DR: Bracketing plugins usually provide the right mapping to jump over the closing bracket character that is just after the cursor, and moreover what these plugins provide can be redone -- unlike the usual 90's mapping-snippets that many copy and share around. Snippet engines usually ...


1

This bug has been documented on the VsCode/Vim repo. Bugs #5636 and #5123 both show that this is a current limitation in this extension. As stated in the above comments, recording and replaying macros across different buffers (whether they be splits or tabs) work just fine in vim itself.


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