0

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.

0

4 Answers 4

3

Have you tried using Tab?

gedit myTabviTabuTabshTabhtTab Enter

or such depending on how well your folders are named.

2

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.

0

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

0

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

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