Lazy man's vim

function v { if [ -z $1 ]; then vim; else vim *$1*; fi }
Reduce the number of keystrokes it takes to open a file in vim. First of all, you just need to type "v", which is less than half the number of characters (!), and second-of-all, you only need to enter a substring of the file you want to open. For example, if you want to open the file, homework.txt, then type "v hom" to open it. Good tip is to use the lowest unique substring, otherwise you'll open multiple files in different buffers (which is sometimes desirable). Use Ctrl-^ to switch between buffers.

By: kFiddle
2009-04-11 23:06:43

What Others Think

Hahahaha! The question is : do you spend more energy typing a random substring or trying to compute the lowest unique substring of the name of the file you want to edit ? :P :P
JesusSuperstar · 695 weeks and 4 days ago
Surely a lazy man would already be using zsh's partial filename tab completion anyways.
bartman · 695 weeks and 4 days ago
Yes, this is a great solution for the lazy. But unfortunately not all commands work for me. This affects my computer experience. I am lucky. that when writing works, I can use this service: this somehow makes it easier for me while I do other settings. This is my way of making my life a little easier.
ZarinaTores · 72 weeks ago
seofox · 37 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: