How can I make my vim act like my cat?

Currently, the following is happening for me: vim seems to inexplicably go into the first folder that it finds, and continue tabbing. When a more complete name hints, it just gives me a call.

~ $ cat .bash <TAB>
.bash/
.bash_history
.bash_profile
.bashrc

~ $ vim .bash <TAB>
~ $ vim .bash/ <TAB>
~ $ vim .bash/git-aware-prompt/

~ $ vim .bash_ <TAB>
<BELL>

Using vim 7.4.488 on OSX

How can I make my vim act like my cat?

+4
source share
1 answer

Sometimes it happens that it’s not in your .bashrc

# enable programmable completion features (you don't need to enable
# this, if it already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

Another possible problem can be solved at startup.

complete -r vim

which can restore the default vim termination rules. I hope these suggestions help you point you in the right direction.

+4
source

Source: https://habr.com/ru/post/1608174/


All Articles