Steal strip trailing spaces from anddam

This commit is contained in:
Felix Van der Jeugt 2019-10-29 19:38:32 +01:00
parent dc2b9c943a
commit b2072e7189
No known key found for this signature in database
GPG Key ID: 58B209295023754D

View File

@ -3,6 +3,7 @@ require('vis')
require('plugins/complete-word')
require('plugins/myfiletype')
require('plugins/editorconfig/editorconfig')
require('plugins/vis-quickfix/quickfix')
vis.events.subscribe(vis.events.INIT, function()
-- Your global configuration options
@ -103,3 +104,11 @@ vis:map(vis.modes.VISUAL, ';a', function()
vis:command(':|par')
end
end)
vis:command_register("sts", function(argv, force, win, selection, range)
local lines = win.file.lines
for index=1, #lines do
lines[index] = lines[index]:gsub("%s+$", "")
end
return true
end, "Strip line trailing spaces")