New answers tagged

0

A programmatic approach: for mode in ['n', 'i'] for key in ['<up>', '<down>', '<left>', '<right>'] execute printf('%snoremap %s <nop>', mode, key) endfor endfor


2

filbranden’s answer is more general for acting on a range of lines when you’ve already done one command. Some alternatives, some general, some specific: record a macro: qq.jq and then @q followed by @@ to replay. But you can give a large count in this case; the macro will fail (and thus the counted macro) when it reaches the end of the file. It may stop at ...


2

Using Visual mode (in particular Blockwise Visual mode) seems to be a perfect solution for me, here. Since you're only replacing a single character, personally I'd go with Ctrl+V followed by the motion (such as G for the end of the buffer), then ri. That replaces a single character and doesn't go into Insert mode, so you don't need an <Esc> to leave it....


Top 50 recent answers are included