From b2072e718952641af6c2a511a587e57f8afd73ec Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Tue, 29 Oct 2019 19:38:32 +0100 Subject: [PATCH] Steal strip trailing spaces from anddam --- config/vis/visrc.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index 220695a..f50a109 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -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 @@ -70,7 +71,7 @@ vis:map(vis.modes.INSERT, '', function() local single_selection = false for selection in vis.win:selections_iterator() do if single_selection then - single_selection = false + single_selection = false break end single_selection = true @@ -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")