Mercurial > dotfiles
changeset 609:4d84c6c203f7
trim filename in statusline
author | zegervdv <zegervdv@me.com> |
---|---|
date | Wed, 20 Jul 2022 09:00:25 +0200 |
parents | 5cfc6204bc83 |
children | 864493b0506a |
files | .chezmoitemplates/init.lua |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.chezmoitemplates/init.lua Wed Jul 20 09:00:14 2022 +0200 +++ b/.chezmoitemplates/init.lua Wed Jul 20 09:00:25 2022 +0200 @@ -458,6 +458,8 @@ local filename = vim.fn.fnamemodify(self.filename, ':.') if filename == '' then return '[No Name]' end + if not conditions.width_percent_below(#filename, 0.25) then filename = vim.fn.pathshorten(filename) end + return filename end, hl = { fg = 'blue' },