When mapping is executed multiple times in vim selection mode
漂亮男人
漂亮男人 2017-05-16 16:41:58
0
1
724
function Hello()
        echo "hello world\n"
endfunction

map <leader>w :call Hello()<CR>

In normal mode, I press <leader>w to call the Hello() function once, but if I am in the selection mode, the Hello() function will be called n times, the number of n times and the selection The number of rows is the same. If I now want to call the function only once in selection mode, how should I deal with it?

漂亮男人
漂亮男人

reply all(1)
大家讲道理

Processing range by yourself:

function Hello() range

See also:

:help :call
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template