How do I check if a selection has EOL spaces and remove them only if there are?
I need to remove the EOL spaces of a selection in order to do an other operation.
I would like to check if there are but don’t know how to do this.
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.
You can suppress errors in the
:substitutecommand using theeflag.So eckes’ suggestion would become:
Then any errors are ignored, and scripts are not interrupted. See
:help s_flagsfor more information.If you really want to check if there are trailing spaces you could try using something like