Mac Terminal command line open file or directory with sublime, Vscode, Atom

Source: Internet
Author: User

You know, sometimes some small tricks can greatly increase our efficiency.

Under the development of the Mac, with the most or terminal, my terminal environment is iterm2+ohmyzsh; before I get to the point, I'll introduce you to a few tips:

The first one:

Open Findle, then locate my project directory, and then I open the terminal of the current directory with the installed Go2shell. As follows:

To tell the truth, it is convenient, it is better than opening the terminal and then step by step CD in. Believe that many people know this thing, do not know their own search name to download the.

The second one:

I believe everyone will open more than one terminal window, you are not doing this: Command+t or Comman+d, the former is to open a new window, just as the browser opens a new tab, the latter is the current window opens a split screen window.

We talk about the front that comman+t, open the Heart serial port will return to the root directory, and then have to constantly CD into the specified directory, in fact, Iterm2 has set:

Open the Iterm2 terminal, then click Iterm2->prefrences in the upper-left corner:

Then just hook up the option in the Red box. Then you are in a terminal window command+t the new window's directory is the current directory.

The third one:

Under terminal How to open the current directory in Findle, this just enter open. Just, remember, a little.

OK, let's move on to the following:

1, at the end of a random directory input

Cd

Yes, just a CD.

2, Ls-al

Then see if the current directory has this file:

This is the config file for zsh, and we are going to configure it here:

3.

sudo nano. ZSHRC

At the end of the file, add:

Alias atom='/applications/atom.app/contents/macos/atom'alias subl=' /applications/sublimetext.app/contents/sharedsupport/bin/subl ' alias Code='/applications/visual\ studio\ code.app/contents/resources/app/bin/code '

Command+x again enter Y, save. Restart Iterm2.

Note that the path above is the path of my own application and your changes may occur. How to find the path:

And then

After you open the contents of the package, you can always find the executable file (that is, you can open the file for the app), and refer to my ZSHRC settings. Then copy the current path to the. ZSHRC with alias Set, alias is set alias, with a space is escaped with \.

That's it, it's done. Then look at the effect:

It's OK. Give it a try. It's really convenient. Do not understand welcome comments ask me.

Mac Terminal command line open file or directory with sublime, Vscode, Atom

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.