This is probably impossible without any plugins, as mentioned on the comments.
But you wouldn't have to start from the scratch if you want to implement such functionality using VimL, you could use the BufNameComplete plugin as a starting point (note that it uses the CompleteHelper : Generic functions to support custom insert mode completions plugin, which probably isn't necessary for your problem).
You could use a regex to identify any environment variables before the expansion and then apply substitute(result, expanded_env_var, original_env_var, '')
in order to restore the environment variables.
(actually this works if you want to check only for the first environment variable on the input; if you want to preserve all of them,you would need to build a dictionary with all the variables and the respective expansions, and then iterate on it to replace each expansion with the original variable)
^X^F
completion doesn't use bash, it's built in to Vim itself. – Martin Tournoij Oct 7 '15 at 15:19edit.c
,ins_compl_get_exp()
is called, which expands all environment variables (as well as patterns like%:h
). On the next line, the tilde seems to be actually re-added withtilde_replace()
... You could override the^X^F
completion with your own version though... – Martin Tournoij Oct 7 '15 at 15:28file
completion source. – VanLaser Oct 7 '15 at 20:50