Let's suppose I have the following environment variable
1| export my__files=$HOME/Documents/MyFiles
Now let's suppose I am editing the file main.txt
(see content below)
1| foo
2| bar
3| $my__files/█
If I press <C-x><C-f>
(complete filename) while in insert mode in the current cursor position, it will expand the environment variable and start listing the files and directories present within that specific directory
1| foo
2| bar
3| /home/mario/Documents/MyFiles/DCBooks/█
/home/mario/Documents/MyFiles/DCBooks/
/home/mario/Documents/MyFiles/DCExperiments/
/home/mario/Documents/MyFiles/DCPrograms/
/home/mario/Documents/MyFiles/DCRemoteRepos/
/home/mario/Documents/MyFiles/Music/
My question is: When using file completion in front an environment variable is it possible to make vim
not to expand it and just start listing files within the directory that is represented by the environment variable?
vim -u NONE
? I’m pretty sure the usual mapping is<C-x><C-f>
– D. Ben Knoble♦ Nov 1 '19 at 2:01<C-x><C-f>
doesn't work, I'm just stating that the environment variable expands to its literal value when pressing that combination of keys, but I don't want this behavior to occur. I don't want the environment variable to be expanded, that's why I was wondering if there is an option that disable that behavior. Note that<C-x><C-f>
lists all unhidden files within a directory, which I want to use, but I repeat, I don't want the environment variable to be replaced with its literal value. – gfe Nov 1 '19 at 3:01complete()
. See this answer for example of custom complete. – Matt Nov 1 '19 at 7:14