Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use the command :tabe **/<file-name-pattern> all the time to open files in the current directory and subdirs in a new tab in vim. The command enables toggling through similar file names until I find the one I'm looking for. I wanted to map it to a user command such that I'll have less to type, but am kinda new to vim commands and thought I'd ask for help. Here's what I could come up with (mapped to TT):

:command -nargs=1 TT :tabe **/<args>

The idea is mimic the functionality of the above and to type :TT <file-name-pattern> and then toggle with key until the desired file is found. This, uh, didn't work. Any idea how to make this happen? thanks.

share|improve this question

1 Answer 1

Try adding -complete=file to the command:

:command -nargs=1 -complete=file TT :tabe **/args

See ":help :command-complete".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.