0

New to this whole Linux thing, and creating alias' in Mac seemed a little easier!

Anyway, I'm trying to create an alias that will open the desired file within Brackets, or Sublime... etc.

I don't want to use gedit, prefer brackets for coding etc. Can't seem to find anything that specifically helps with this.

I.E in terminal:

codeit myFile.ext

codeit being almost the same functionality as gedit but opening desired file in Brackets/Sublime Text.

3
  • So you want to have a command codeit that takes a filename as parameter and opens it with a specific IDE, right ? You might want to look into adding a bash function to your .bashrc file , because aliases cannot take parameters. Refer here Sep 28, 2015 at 21:24
  • I don't understand. Presumably brackets is a program and I know that Sublime text is. Why don't you jusrt run brackets yourfile.txt? What do you want an alias for? Are you trying to change the default editor that is opened when you double click a text file?
    – terdon
    Sep 28, 2015 at 21:59
  • Clearly I dont know linux at all.. lol Thanks for the help guys, the program file.ext is what I needed!
    – SNYDERHAUS
    Sep 29, 2015 at 1:55

1 Answer 1

1

If I understand your question correctly, your first step should be to install brackets. To do this, have a look at this tutorial.

Here are the commands you need:

sudo add-apt-repository ppa:webupd8team/brackets
sudo apt-get update
sudo apt-get install brackets

Then you should be able to open a file by typing brackets myFile.txt in your terminal.


As your talking about "alias" in your question:

You can define an alias like alias newCommand='command to execute'. So using alias gedit='brackets' will run brackets myFile.txt when you typed gedit myFile.txt. To make this permanent, you have to add the line to your .bashrc.

You must log in to answer this question.

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