cmp-path icon indicating copy to clipboard operation
cmp-path copied to clipboard

Support windows path and env

Open yehuohan opened this issue 2 years ago • 5 comments

  • 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%\

yehuohan avatar Dec 09 '22 17:12 yehuohan

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

waldimen avatar Oct 26 '23 06:10 waldimen

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

pidgeon777 avatar Jun 30 '24 13:06 pidgeon777

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

You mean provide completion items for ./?

yehuohan avatar Jun 30 '24 14:06 yehuohan

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".

pidgeon777 avatar Jul 01 '24 08:07 pidgeon777

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

yehuohan avatar Jul 01 '24 09:07 yehuohan