Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Try adding -complete=file to the command:

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

See ":help :command-complete".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .