Sunday, October 14, 2012

Re: Get filename part only from "% with substitute()

On 15:25 Sun 14 Oct , Graham Lawrence wrote:
> :echo substitute(@%, "\..*", "", "")
>
> :echo substitute(@%, "\([^.]\+\)\..*", "\1", "")
> Parameters2.html
>
> >From :reg
> ": echo substitute(@%, "\([^.]\+\)\..*", "\1", "")
> "% Parameters2.html
>
> So, how should I write this substitute command?
>
>
> --
> Graham Lawrence
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Are you looking for:
:echo expand("%:r")

:help filename-modifiers

Best,
Marcin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: