On Thu, 7 Dec 2006, Jürgen Krämer wrote:

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>

Hm, this seems to be echoing the command, therefore interrupting me, whenever it is called (regardless of linewise mode or not):

vnoremap h :<c-u>if visualmode() == 'V' <bar> set foldmethod=manual <bar> 
1,'<lt>-fold<bar>'>+,$fold <bar> endif <cr>

Taken from a previous suggestion that folds text above and below the selection. I want to use 'h' but obviously I don't want it to be called in visual mode because h is used to move the cursor leftward.

--

.

Reply via email to