Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 609:4d84c6c203f7
trim filename in statusline
author | zegervdv <zegervdv@me.com> |
---|---|
date | Wed, 20 Jul 2022 09:00:25 +0200 |
parents | 5cfc6204bc83 |
children | 864493b0506a |
comparison
equal
deleted
inserted
replaced
608:5cfc6204bc83 | 609:4d84c6c203f7 |
---|---|
456 local FileName = { | 456 local FileName = { |
457 provider = function(self) | 457 provider = function(self) |
458 local filename = vim.fn.fnamemodify(self.filename, ':.') | 458 local filename = vim.fn.fnamemodify(self.filename, ':.') |
459 if filename == '' then return '[No Name]' end | 459 if filename == '' then return '[No Name]' end |
460 | 460 |
461 if not conditions.width_percent_below(#filename, 0.25) then filename = vim.fn.pathshorten(filename) end | |
462 | |
461 return filename | 463 return filename |
462 end, | 464 end, |
463 hl = { fg = 'blue' }, | 465 hl = { fg = 'blue' }, |
464 } | 466 } |
465 | 467 |