Hi, Vigil wrote: > vnoremap doesn't appear to care whether the text was selected blockwise or > linewise. How can I make a map work in linewise mode only?
you can use the visualmode() function and wrap your actual mapping with an if-statement: :vnoremap <F2> :<c-u>if visualmode() == 'V' <bar> echo 'linewise' <bar> endif <cr> The <c-u> at the start of the mapping removes the visual range that is supplied by VIM automatically when a colon is entered while in visual mode. If you need this range you will have to re-supply it in your original mapping. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)
