2

Alternately, keep your original Fill definition, and always type (or enter from a mapping) :call Fill() When in normal mode, this works fine (as you’ve observed). From visual mode, with a mapping or typed out the range is preserved, so you actually ru :'<,'>call Fill() And a function that is not declared range but given one by :call will simply be ...


2

You are almost there. I would do it the following: Define the command as taking an explicit range: command -range Fill :<line1>,<line2>call Fill() This will call the function with the range that you supplied to the command (and in case no range was given, it will just call the function with the current line). Make the function aware of ...


2

First thing you need to do is get the syntax of :command right. This is what it's supposed to be... :com[mand][!] [{attr}...] {cmd} {rep} {attr} means attributes. That includes the -nargs value. Following that is {cmd} which is the command name. That gives us this... :command -nargs=1 Tab call SetTab(<args>) Problem is, it still won't work. What you ...


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