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.

Possible Duplicate:
Can I shorten my directory commands in ubuntu?

When working on a rails app I like to open all of my files through the command line like so

cd my_app
gedit app/views/user/show.html.erb

Is there a way that I could shorten this so that I could just write something like

gedit  user_views/show.html.erb

?

I would like the console to stay in the main directory, I just don't like having to type out app/controller/user_controler.rb every time I want to open the user controller. I know that I could just open the file with my mouse, but I feel like moving from keyboard to mouse breaks my focus a little bit. When I can just tap away at the keyboard it seems like I have a more smooth workflow.

share|improve this question
add comment

marked as duplicate by studiohack Aug 31 '11 at 18:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

Have you tried using Tab?

gedit myTabviTabuTabshTabhtTab Enter

or such depending on how well your folders are named.

share|improve this answer
add comment

You might consider defining a simple shell variable:

cd my_app
VIEWS=app/viwes/user
gedit $VIEWS/show.html.erb
gedit $VIEWS/xy.html.erb

Chose a shorter variable if you're a really lazy guy.

share|improve this answer
add comment

You could create a command like 'gedit_userviews' and add some bash auto completion.

share|improve this answer
add comment

You could just create a link to the target directory

ln /home/yourname/app/views/user/ sname 

then you could use

gedit sname/show.html.erb
share|improve this answer
add comment

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