In linux, use vi to edit and modify the file configuration, there is no color display file content, especially some keywords can not be displayed in color, give us configuration service process Caused great inconvenience. [In fact, mainly vi itself does not have color, vim with color] The following gives a solution.
Vi Editor Code Highlight Settings
1. Check whether highlighting is enabled. Generally, it is enabled by default.
2, modify #vi /etc/bashrc Add
alias vi=vim
at the end and then wq save and exit.
This will automatically open vim when typing vi in the shell (vim is short for vi improve)
3, modify #vi /etc/vimrc Add "syntax" to the following statement On ”, after restarting vi or restarting the computer, you can turn on the highlight.
bash/shell Code Copy Content to Clipboard
if &t_Co > 2 |
|
Has("gui_running")
syntax on
set hlsearch
endif
Note: If you have one, you don't have to add it.
In Linux, we often use the vi or vim command to manipulate the text. Sometimes, our script file has an error, it will throw an exception with a line number, and then we will follow the prompts. Re-open, our source code to view, and at this time, if your vim does not set the display line number function, we find the code of the line of the problem, it is very inconvenient.
Set the Vim editor to display the line number permanently
Modify the /etc/vimrc file and add the following two lines to the end of the file:
Copy Code
The code is as follows:
set nu
set tabstop=4
Note: set nu #display line number set tabstop=4 #设置缩进
How to view the routing table information in the Linux host, the command is route. For a sim
The installation environment is Ubuntu13.10 version i386, the nginx server and mysql server have bee
Cause The application is deployed into the virtual pool, and the virtual machine is missing the gcc
This article will guide you to install Debian 7 Wheezy network directly by using DNSMASQ as a PXE se
Mount windows shared directory on Linux
Linux copy and paste shortcuts
Linux ls, ls -l, ls -l, ll command
Detailed sort order command under Linux
Vim common commands and configurations
Small note IptabLes and IptabLex virus cleanup process
Easily import, export (restore, backup) MySQL databases on Linux servers
Linux System Management Technical Manual - Chapter 6 Adding New Users
Win7 release C disk space four simple small ways
Win7 operating system uses inpaint software to remove image watermarks
Win7 system wireless can not connect to windows can not start wireless pan dhcp server service
Two strokes to pull out limited text on the web
How to play cool dog music regularly
Win10 Build 10125 beta fixes a big problem with the Spartan project
Win8 RP Microsoft official original CD image download Daquan (including Chinese)
How to enable SSH in Win10? Win10 system computer to enable SSH method