Let the terminal under Mac OS X have a rich color display like Linux

Source: Internet
Author: User
Tags line editor

We know that the command line terminal under Linux has color echo function, the LS command to view the directory or file, the terminal will be different colors; using the vim command line editor to open a script or other source code is displayed in syntax highlighting mode. But the terminal under Mac OS x always displays everything in black and white, and it looks monotonous. In fact, we can also let the terminal under Mac OS X have a rich color display capability like Linux. Specific as follows:

1, let LS and grep command display results with color modify the current login account directory under the ~/.bash_profile file (if not created it), add the following: Alias Ls= ' ls-g ' Alias ll= ' ls-l ' Alias grep= ' grep--color ' save after exiting. Restart the terminal can see the LS command, grep command echo echo results are color, and we also defined an alias ll, equivalent to simulating the LL command under Linux, column details directory and file list, no more input ls-l. 2, let vim have syntax highlighting Mac OS x VI is actually a soft connection of vim. So we have to let vim have syntax highlighting ability, only need to modify the current account directory of the ~/.VIMRC file (if not created it), add the following: syntax on save and exit. Using VIM again will reveal that the syntax highlighting is already in effect!

Let the terminal under Mac OS X have a rich color display like Linux

Related Article

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.