[question] is there an option to keep just the empty lines at the end of file
Closed this issue · 3 comments
alexzanderr commented
i have a file.
i want it to be trimmed.
but i want to keep the exceeding empty lines that are at the end of the file.
is there an option for that?
alexzanderr commented
cappyzawa commented
Why don't you use :noa w
?
alexzanderr commented
it doesnt trim the extra white space on the lines
i've come up with solution:
patterns = {
-- this just trims the whitespace on the lines
-- its enough
[[%s/\s\+$//e]],
-- [[%s/\($\n\s*\)\+\%$//]],
-- [[%s/\%^\n\+11//]],
-- [[%s/\(\n\n\)\n\+/\0/]],
},
and its working perfectly