summaryrefslogtreecommitdiff
path: root/config/essentials/vis/title.lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/essentials/vis/title.lua')
-rw-r--r--config/essentials/vis/title.lua30
1 files changed, 21 insertions, 9 deletions
diff --git a/config/essentials/vis/title.lua b/config/essentials/vis/title.lua
index d743b63..06a3964 100644
--- a/config/essentials/vis/title.lua
+++ b/config/essentials/vis/title.lua
@@ -1,16 +1,28 @@
-require('vis')
+--[[
+Based on https://github.com/erf/vis-title
+Changes made:
+- stylua
+--]]
+
+require("vis")
local function set_title(title)
- -- print() cannot be used here as it will mess up vis
- vis:command(string.format(":!printf '\\033]2;vis %s\\007'", title))
+ -- print() cannot be used here as it will mess up vis
+ vis:command(string.format(":!printf '\\033]2;vis %s\\007'", title))
end
-vis.events.subscribe(vis.events.INIT, function() print('\27[22;2t') end)
+vis.events.subscribe(vis.events.INIT, function()
+ print("\27[22;2t")
+end)
-vis.events.subscribe(vis.events.WIN_OPEN,
- function(win) set_title(win.file.name or '[No Name]') end)
+vis.events.subscribe(vis.events.WIN_OPEN, function(win)
+ set_title(win.file.name or "[No Name]")
+end)
-vis.events.subscribe(vis.events.FILE_SAVE_POST,
- function(file) set_title(file.name) end)
+vis.events.subscribe(vis.events.FILE_SAVE_POST, function(file)
+ set_title(file.name)
+end)
-vis.events.subscribe(vis.events.QUIT, function() print('\27[23;2t') end)
+vis.events.subscribe(vis.events.QUIT, function()
+ print("\27[23;2t")
+end)