Quantcast
Channel: passing command-range to a function - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by HanleyLee for passing command-range to a function

If you want use the range of currently selected line in visual mode, you can use the below:command! -range PassRange '<,'> call PrintGivenRange()'<: the first line of the current selected...

View Article



Answer by Raimondi for passing command-range to a function

You need to explicitly pass the range, try with:command! -range PassRange <line1>,<line2>call PrintGivenRange()

View Article

passing command-range to a function

I'm trying to define a command that can take a range and pass it to a function. This is what I thought I should have:function! PrintGivenRange() range echo "firstline ".a:firstline." lastline...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images