Skip to content

Instantly share code, notes, and snippets.

@anddam
Created October 23, 2019 14:16
Show Gist options
  • Save anddam/c980e48789aef2b97f1dc4dad30cfc59 to your computer and use it in GitHub Desktop.
Save anddam/c980e48789aef2b97f1dc4dad30cfc59 to your computer and use it in GitHub Desktop.
vis:command_register("sts", function(argv, force, win, selection, range)
if vis.win.strip_trailing_spaces then
vis:command("x/ +$/ c//<Enter>")
vis:command(":x/ +$/ c//<Enter>")
vis:command(":x/ +$/ c//<Enter>:w<Enter>")
-- vis:map(vis.modes.NORMAL, ';w', ':x/ +$/ c//<Enter>:w<Enter>') vis:info("Line trailing spaces trimmed.")
end
return true;
end, "Strip line trailing spaces")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment