command-t launching from ex mode?

  1. dpranke

    Hi,

    I've just started playing with command-t and it seems pretty cool. Great job!

    I've realized that it may take me a while to retrain my muscles away from :e, though, so I was wondering if any thought has been given to providing a command that can provide the initial string to seed the prompt?

    In other words, typing ":e foo<enter>" would have the same effect as "<Leader>tfoo<enter>". Sort of an "I'm feeling lucky" mode?

  2. Greg Hurrell

    In a way seems like a good idea, but I am not so sure.

    At the moment <Leader>t maps to :CommandT<CR>, which just brings up the prompt.

    You can also manually type a command like :CommandT path/to/starting/dir to start the prompt in a specific directory (the default is to start it in Vim's :pwd).

    So you're talking here about adding a second parameter, which could be done, or if you want a simpler invocation perhaps even a new command that would operate alongside of :CommandT.

    But when I think about this and how it would be used, I am skeptical that it's worth doing. The objective is to overcome a muscle memory problem, but it seems to me that rather than eliminate a bad habit it will just reinforce it.

    Remember that the idea of Command-T is to show you the list of results and narrow it down as you type. If you end up seeding the prompt with "foo" before displaying the list, then the live feedback that you would usually see after hitting the "f" is lost, as is the refined feedback after typing the first "o" and the even more refined feedback after the second "o".

    So, while I don't see any major technical obstacles to implementing something like this, I do question whether it's a worthwhile thing to do or not.

Reply

This topic is now closed.