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/complete-word')
require('plugins/myfiletype') require('plugins/myfiletype')
require('plugins/editorconfig/editorconfig') require('plugins/editorconfig/editorconfig')
require('plugins/vis-quickfix/quickfix')
vis.events.subscribe(vis.events.INIT, function() vis.events.subscribe(vis.events.INIT, function()
-- Your global configuration options -- Your global configuration options
@ -70,7 +71,7 @@ vis:map(vis.modes.INSERT, '<Backspace>', function()
local single_selection = false local single_selection = false
for selection in vis.win:selections_iterator() do for selection in vis.win:selections_iterator() do
if single_selection then if single_selection then
single_selection = false single_selection = false
break break
end end
single_selection = true single_selection = true
@ -103,3 +104,11 @@ vis:map(vis.modes.VISUAL, ';a', function()
vis:command(':|par') vis:command(':|par')
end end
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")