Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

btv.fname

btv.fname.modify(fname, mods)

btv.fname.modify(fname, mods) [alias vim.fn.fnamemodify]: apply vim’s filename modifiers left to right. A pure path-string helper (no I/O beyond reading cwd), so it lives with the vim.fn read builtins — expand('%:t') / '%:h' and a 'statusline' %f route through it. Supported: :p (absolute against cwd), :~ (relative to $HOME with ~), :. (relative to cwd when under it), :h (head/dir), :t (tail), :r (root, strip one extension — a leading dot isn’t one), :e (extension; consecutive :e widen it to the last k dot-components, vim’s quirk). An unsupported modifier errors loud rather than silently passing the name through. Cases match real neovim’s vim.fn.fnamemodify.

Separators and roots follow btv.utils.path_style: on Windows / and \ both split components, C:\ and \\server\share\ are roots, and :p spells its result with the native \ (as vim reports a full name there).

Defined in vimfn.lua.

btv.fname.escape(fname)

No documentation comment in the prelude.

Defined in vimfn.lua.