summaryrefslogtreecommitdiffstats
path: root/lua/core
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-03-29 23:28:14 -0400
committerSquibid <me@zacharyscheiman.com>2024-03-29 23:28:14 -0400
commitc23619baf1522f6c4aa6cbbb85d5abc5b804043e (patch)
tree38e37b2fe309b975eac676f98614d8589ef8dc18 /lua/core
parentfa2315536dac5b1fa2984343020d18596b29f986 (diff)
downloadnvim-c23619baf1522f6c4aa6cbbb85d5abc5b804043e.tar.gz
nvim-c23619baf1522f6c4aa6cbbb85d5abc5b804043e.tar.bz2
nvim-c23619baf1522f6c4aa6cbbb85d5abc5b804043e.zip
show executable status in the statusbar
Diffstat (limited to '')
-rw-r--r--lua/core/statusbar/components.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/core/statusbar/components.lua b/lua/core/statusbar/components.lua
index f731688..0233e1b 100644
--- a/lua/core/statusbar/components.lua
+++ b/lua/core/statusbar/components.lua
@@ -308,4 +308,18 @@ function M.line(opts)
end)
end
+function M.fn_tail(opts)
+ opts = opts or {}
+ local fmt = opts.fmt or "%s"
+ local hl_exec = opts.hl_exec or "Character"
+
+ local fn = vim.fn.expand("%:t")
+ if vim.fn.getftype(fn) == "file" then
+ if string.match(vim.fn.getfperm(fn), 'x', 3) then
+ return (fmt):format(set_hl(hl_exec, fn))
+ end
+ end
+ return (fmt):format(fn)
+end
+
return M