Skip to main content
Module

x/denops_std/function/mod.ts>fnamemodify

📚 Standard module for denops.vim
Go to Latest
function fnamemodify
import { fnamemodify } from "https://deno.land/x/denops_std@v4.1.4/function/mod.ts";

Modify file name {fname} according to {mods}. {mods} is a string of characters like it is used for file names on the command line. See |filename-modifiers|. Example: :echo fnamemodify("main.c", ":p:h") results in: /home/user/vim/vim/src If {mods} is empty or an unsupported modifier is used then {fname} is returned. When {fname} is empty then with {mods} ":h" returns ".", so that :cd can be used with it. This is different from expand('%:h') without a buffer name, which returns an empty string. Note: Environment variables don't work in {fname}, use |expand()| first then. Can also be used as a |method|: GetName()->fnamemodify(':p:h')

Parameters

denops: Denops
fname: unknown
mods: unknown

Returns

Promise<unknown>