"/home/mool/vim": >
:p /home/mool/vim/src/version.c
:p:. src/version.c
:p:~ ~/vim/src/version.c
:h src
:p:h /home/mool/vim/src
:p:h:h /home/mool/vim
:t version.c
:p:t version.c
:r src/version
:p:r /home/mool/vim/src/version
:t:r version
:e c
:s?version?main? src/main.c
:s?version?main?:p /home/mool/vim/src/main.c
:p:gs?/?\\? \home\mool\vim\src\version.c
Examples, when the file name is "src/version.c.gz": >
:p /home/mool/vim/src/version.c.gz
:e gz
:e:e c.gz
:e:e:e c.gz
:e:e:r c
:r src/version.c
:r:e c
:r:r src/version
:r:r:r src/version
The extension %:e
is the closest to what I need, but that doesn't work for files without extensions (which have their ft set by a modeline)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
You are showing the documentation, I don't understand your issue. Note: Buffer Filetype is in &ft
variable. you can use that to pass around
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I have a script that selects templates based on the given filetype and outputs them to stdout. For example:
:.!tplt %:e
But the %:e
is not always reliable. Does vim offer a way to pass variables for shell? Maybe something like
:.!tplt "$ft"
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.