Sorry if it’s a dull question, but why does execute function inserts a number of chars equal to number lines in selection when I do something like this:
execute "silent normal!`>a".some_char
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you type
:to enter normal mode from visual mode, vim inserts automatically a range corresponding to the visual selection before your command. It looks likeWhen prepended with a range, the
:normalcommand is executed for each line in the range.You should find another method for acting on the whole visual selection rather than on each line. Providing us with your complete function and a realist usecase would help us help you.
is probably not that much slower or more verbose than whatever you are trying to do.