Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filename completion in vim with xterm doesn't work as expected

Something funny is going on with my vim. I'm using it through xterm. I want to be able to autocomplete filenames that I try to open.

For example:

# Cursor is | character
:o exam|
:o exam|<TAB>
:o examplefile.txt|

I was sure vim supported this, but it's not working for me. When I hit <TAB> an ^I character is inserted instead of completing the filename:

:o exam|<TAB>
:o exam^I|
:o exam^I|<TAB>
:o exam^I^I|

However, <TAB> works fine in bash in xterm - it correctly completes filenames and doesn't expand to ^I.

Is my terminal configured incorrectly? Do I need some stty voodoo? Or is it something else entirely?

Edit

:e does work for me - seems like only :o doesn't...

like image 207
nfm Avatar asked Jun 29 '10 00:06

nfm


1 Answers

:o is not really supported in vim. Try typing :h :o, you'll see this:

Vim does not support open mode, since it's not really useful. For those situations where ":open" would start open mode Vim will leave Ex mode, which allows executing the same commands, but updates the whole screen instead of only one line.

I think you're confusing :o and :e (they're not the same).

like image 83
andereld Avatar answered Sep 28 '22 12:09

andereld