From fc0b03a4c7ca99ea310b7a7bb7937dce24c346c9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 28 Sep 2023 14:42:53 +0200 Subject: vis: fix default options for upcoming vis 0.9 --- config/vis/visrc.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'config/vis') diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index 5286ad0..6aa4e86 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -38,21 +38,14 @@ end) -- seperate default settings into per file and per window to not override settings from -- vis-editorconf which are set on FILE_OPEN -- default file settings -local tabwidth = 4 vis.events.subscribe(vis.events.FILE_OPEN, function() - vis.options.tabwidth = tabwidth vis.options.autoindent = true end) --- load plugins that hook FILE_OPEN to change settings after hook with default settings -if vis:module_exist('editorconfig') then - require('plugins/vis-editorconfig') -else - vis:info('skip vis-editorconfig: editorconfig not available from lua') -end - -- default window settings vis.events.subscribe(vis.events.WIN_OPEN, function(win) + local tabwidth = 4 + win.options.tabwidth = tabwidth win.options.numbers = true win.options.showtabs = true win.options.colorcolumn = 80 @@ -65,7 +58,7 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end if win.syntax == "python" or win.syntax == "rust" then - vis.options.expandtab = true + win.options.expandtab = true vis:map(vis.modes.INSERT, '', function() local found_tab = true for selection in vis.win:selections_iterator() do @@ -81,6 +74,15 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end end) +-- load plugins that hook FILE_OPEN or WIN_OPEN to change settings after hooks +-- with default settings +if vis:module_exist('editorconfig') then + require('plugins/vis-editorconfig') +else + vis:info('skip vis-editorconfig: editorconfig not available from lua') +end + + vis:map(vis.modes.NORMAL, ";;", "") vis:command_register('lmk', function(argv) -- cgit v1.2.3