Autocomplete of File Path Does Not Work After "Vim" in Terminal
Steps to Reproduce Git Clone Cd Vecterion_Vge Input Vim Include/ Tab Input Vim Include/Et_Co Tab What I Expected to See Show File List in Include/ Autocomplete...
Steps to reproduce
git clone
cd vecterion_vge
- input
vim include/tab - input
vim include/et_cotab
What I expected to see
- show file list in
include/ - autocomplete file path
vim include/et_color_panel.h
What I saw instead
Both 1. and 2. do not work.
Other
Both
ls include/ tab and
ls include/et_co tab
do work.
The input vim vecterion_vge/include/et_co tab on parent directory (home dir) does work.
How can I fix this?
1 Answer
Maybe you turned off the completion specifications associated with vim.
complete -p vim
And check the output:
complete -F _filedir_xspec vim
If is something like the previous line, run the command:
complete -r vim
In general, and not directly related to vim you can follow these examples, modify for your case:
Must Read
First example
You can list all the current completion routines active for your user via complete -p or list all the completion included in your system: ls /etc/bash_completion.d/
Completion is drived by the file /etc/bash_completion and new completion commands may be placed inside the directory /etc/bash_completion.d
You need to enable smart completion, editing your /etc/bash.bashrc file. I think you have, because the cd Tab completion. Anyway uncomment the following lines, by removing the # in the beginning of the lines:
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
As you can see, everything depends on the information inside bash_completion.d file.
If you can even extend bash smart completion to your vim or apt need to edit /etc/bash_completion and /etc/bash_completion.d