[vim/vim] How to expand to full path WITH drive letter under windows? (#8656)

50 views
Skip to first unread message

Dmytro Z.

unread,
Jul 29, 2021, 3:03:33 AM7/29/21
to vim/vim, Subscribed

Hi.
I am unable to find answer so asking here.
I need to get current buffer path WITH the windows drive letter.
But :echo expand( "%:p" ) always strips drive letter.
How I can solve this problem?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Christian Brabandt

unread,
Jul 29, 2021, 3:48:03 AM7/29/21
to vim/vim, Subscribed

I cannot reproduce this. What version is this? If I do gvim --clean -c ':h' -c 'only' -c "echo expand('%:p')" I correctly see the complete path: C:\Program Files\Vim\vim82\doc\help.txt

This is version 8.2.3161 from the vim-win32-installer

Dmytro Z.

unread,
Jul 29, 2021, 3:57:21 AM7/29/21
to vim/vim, Subscribed

Oh, seems, that this is neovim only issue.
Sorry.

Christian Brabandt

unread,
Jul 29, 2021, 3:59:46 AM7/29/21
to vim/vim, Subscribed

Closed #8656.

Gary Johnson

unread,
Jul 29, 2021, 4:05:31 AM7/29/21
to reply+ACY5DGBHMHZ42J4H5A...@reply.github.com, vim...@googlegroups.com
On 2021-07-29, Dmytro Z. wrote:
> Hi.
> I am unable to find answer so asking here.
> I need to get current buffer path WITH the windows drive letter.
> But :echo expand( "%:p" ) always strips drive letter.
> How I can solve this problem?

I'm afraid I don't know what the problem might be. It works just
fine for me using Vim 8.2.3227 on Windows 10. I didn't see anything
in the documentation about optionally removing drive letters.

Regards,
Gary

vim-dev ML

unread,
Jul 29, 2021, 4:05:49 AM7/29/21
to vim/vim, vim-dev ML, Your activity

On 2021-07-29, Dmytro Z. wrote:
> Hi.
> I am unable to find answer so asking here.
> I need to get current buffer path WITH the windows drive letter.
> But :echo expand( "%:p" ) always strips drive letter.
> How I can solve this problem?

I'm afraid I don't know what the problem might be. It works just
fine for me using Vim 8.2.3227 on Windows 10. I didn't see anything
in the documentation about optionally removing drive letters.

Regards,
Gary

Reply all
Reply to author
Forward
0 new messages