Not ideal (need at least text width function and might be a mess in tree-view), but you can try using this plugin:
--[[
:set viewcolumns=-{RootAndExt},7{}
--]]
local function rootAndExt(info)
local e = info.entry
local offset = #e.classify.prefix
local text
if e.isdir then
text = e.classify.prefix .. e.name .. e.classify.suffix
else
local root = vifm.fnamemodify(e.name, ':r');
local ext = vifm.fnamemodify(e.name, ':e');
if #ext ~= 0 then
ext = '.' .. ext
end
root = e.classify.prefix .. root
if #root + #ext >= info.width then
text = root .. ext
else
local available = info.width - #root
local extWidth = available > 7 and 7 or available
if #ext > extWidth then
extWidth = #ext
end
local rootWidth = info.width - extWidth
local filler = string.rep(' ', rootWidth - #root)
local format = string.format("%%s%%s%%%ds", extWidth)
text = string.format(format, root, filler, ext);
end
end
if not e.match then
return { text = text }
end
return {
text = text,
matchstart = offset + e.matchstart,
matchend = offset + e.matchend
}
end
local added = vifm.addcolumntype {
name = 'RootAndExt',
handler = rootAndExt,
isprimary = true
}
if not added then
vifm.sb.error("Failed to add RootAndExt view column")
end
return {}
How to install.