aboutsummaryrefslogtreecommitdiff
path: root/config/vis/visrc.lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2021-07-07 12:50:03 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2021-07-07 12:50:03 +0200
commitf8c66453b5bde4eb70b4326a6d8ff74008e09c5b (patch)
tree76cc6056149ef4588a25ded5fe577708353d67ab /config/vis/visrc.lua
parentf34603b324f88a4297e1b01f4ccc2adebf5763de (diff)
downloaddotfiles-f8c66453b5bde4eb70b4326a6d8ff74008e09c5b.tar.gz
dotfiles-f8c66453b5bde4eb70b4326a6d8ff74008e09c5b.zip
[vis] don't override vis-editorconfig settings
Diffstat (limited to 'config/vis/visrc.lua')
-rw-r--r--config/vis/visrc.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua
index b6c0907..b82de1d 100644
--- a/config/vis/visrc.lua
+++ b/config/vis/visrc.lua
@@ -26,15 +26,23 @@ vis.events.subscribe(vis.events.INIT, function()
vis:command("set theme ".. theme)
end)
-vis.events.subscribe(vis.events.WIN_OPEN, function(win)
- -- Default settings
+-- 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
+vis.events.subscribe(vis.events.FILE_OPEN, function(file)
tabwidth = 4
vis:command('set tabwidth '..tabwidth)
vis:command('set autoindent')
+end)
+
+-- load plugins that hook FILE_OPEN to change settings after hook with default settings
+require('plugins/vis-editorconfig')
+
+-- default window settings
+vis.events.subscribe(vis.events.WIN_OPEN, function(win)
vis:command('set number')
vis:command('set colorcolumn 80')
vis:command('set show-tabs')
-
if win.file.name then
if win.file.name:find("COMMIT_EDITMSG") then
vis:command('set colorcolumn 72')
@@ -60,9 +68,6 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
end
end)
--- load plugins that hook WIN_OPEN to change settings after hook with default settings
-require('plugins/vis-editorconfig')
-
vis:map(vis.modes.NORMAL, ";o", function()
vis:command('fzf')
end)