New answers tagged


My preferred method here is to just let you enter the range from the place you normally do: on the Ex command line: nnoremap <leader>t :Test<C-b> Since <C-b> puts your cursor between at the beginning of the line, you can type \t.,81<CR>.


Assuming the cursor is on line #80 and <leader> defaults to backslash, type directly 2\t. The point is that typing N: in Normal mode, where N is arbitrary number, is converted by Vim to :.,.+N-1. So you have to supply number of lines in range (rather than last line number).


There are typically two ways to pass a range to a Normal-mode command. One is to use a Visual selection (which is not exactly a Normal-mode command, but a Visual-mode one, but still pretty close) and the other is to create a mapping that takes an operator and acts on the range resulting of the operator or motions that follows it. For the Visual-mode command, ...

Top 50 recent answers are included