When we open the terminal or iterm2 terminal, the default black and white make people feel tasteless, and using Vim on the terminal is also a bit gloomy. This seriously affects our interest in terminal development. This article explains in detail how to enable the color mode and collects some useful color schemes for your selection.
Step 1Use your favorite editor to open the. pash_profile file .~ /. Bash_profile is the configuration file of the current logon user in bash shell. Bash is the default shell in "terminal.
You can use the following command to open it at Terminal:
$ Vim ~ /. Bash_profile
ThenCodeCopy to this file.
# Enables colorin the terminal bash shell Export
Clicolor = 1
# Sets up thecolor scheme for list Export
Lscolors = gxfxcxdxbxegedabagacad
# Sets up theprompt color (currently a green similar to Linux terminal)
Exportps1 = '\ [\ 033 [01; 32m \] \ U @ \ H \ [\ 033 [00m \]: \ [\ 033 [01; 36m \] \ W \ [\ 033 [00m \] \ $'
# Enables colorfor iterm
Exportterm = xterm-color
Each line of code has an English comment. If you have any questions, you can refer to this English comment.
Step 2To set a preferred color scheme for iterm2.
Enable iterm2 usage preference settings, select profiles, select the colors label, and then configure the color. You can also click "load presets ..." Button to load some classic color schemes.
I recommend a Project hosted on GitHub for iterm2 color scheme. The address is https://github.com/baskerville/iterm-2-color-themes. This project contains many color schemes. You can select your preferred scheme and click "load presets... "Click to import these color schemes for use.
The iterm2 color is set in two simple steps. Does it look much better than before?