From c23619baf1522f6c4aa6cbbb85d5abc5b804043e Mon Sep 17 00:00:00 2001 From: Squibid Date: Fri, 29 Mar 2024 23:28:14 -0400 Subject: show executable status in the statusbar --- lua/core/statusbar/components.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lua/core/statusbar') 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 -- cgit v1.2.1