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

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

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.

Have you tried using Tab?

gedit myTabviTabuTabshTabhtTab Enter

or such depending on how well your folders are named.

share|improve this answer

You might consider defining a simple shell variable:

cd my_app
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

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

share|improve this answer

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

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