views:

53

answers:

2

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...

+1  A: 

edit works for me:

:e exam|<TAB>
stefanB
Hrm... it works for me too! Any idea what the discrepancy with `:o` could be?
nfm
Seems that `:o` is not useful - whatever it was supposed to do, probably a legacy option, so has less functionality I guess ... I always use `:e` for `edit` files so I never noticed.
stefanB
+4  A: 

: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).

anders_we
It seems that :o simply doesn't tab-complete.
hobbs
Not supported, see e.g. the documentation http://vimdoc.sourceforge.net/htmldoc/vi_diff.html#:open or this thread http://bbs.archlinux.org/viewtopic.php?pid=774684
honk