Skip to content

Conversation

@yehuohan
Copy link

@yehuohan yehuohan commented Dec 9, 2022

  • Add windows path (works for cmdline too): x:\foo\bar, x:/foo\bar
  • Add brace-env path (not for cmdline, convenient for bash coding): ${HOME}/, ${HOME}\
  • Add windows env path (not for cmdline): %HOME%/, %HOME%\

@waldimen
Copy link

I hope this will be merged, I checkout this commit, and it works find on my windows machine and it is very useful.

@pidgeon777
Copy link

Is it possible to adapt it to also support relative paths? (relative to neovim pwd).

@yehuohan
Copy link
Author

Is it possible to adapt it to also support relative paths? (relative to neovim pwd).

You mean provide completion items for ./?

@pidgeon777
Copy link

Yes, let's assume that :pwd in Neovim returns:

C:\path\to\dir

And this dir contains:

file1
file2
subdir\file1
subdir\file2

Then, I expect that when typing in insert mode:

.\

and activating the nvim-cmp popup, the possible autocomplete choices should include:

.\file1
.\file2
.\subdir\file1
.\subdir\file2

...or perhaps it would be better if, after triggering with .\, the nvim-cmp popup directly showed:

file1
file2
subdir\file1
subdir\file2

without prefixing each file with .\? This, of course, is specifically for Windows.

However, I believe that solution "1" (including the .\ before each file) is the most "consistent".

@yehuohan
Copy link
Author

yehuohan commented Jul 1, 2024

Think your detailed description.
This PR supports .\ and I'm sure I can get completions from both ./ and .\

@ericsunplus
Copy link

This works perfectly. The default cmp-path behavior in Windows only support relative path "./dir/....". After this patch the full path "d:/Temp/dir/..." can also be supported. Vote for this to be reviewed and merged.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants