Article Directory
1. Learning objectives
It seems to have been set once before, and then I found that it won’t work again. I searched it on Baidu and Google. This time I recorded it. It will save time next time.
Let's take a look at the effect first, before it is useless: After
setting the number of lines and highlighting, the commented code and the uncommented code are clear at a glance, which is very convenient.
2. Setting steps:
1. Vim sets the number of lines and highlights
syntax on # highlight
set nu # display the number of lines
Do not bring any #
and 中文
otherwise error:
vi /etc/vimrc
# 最后一行加入,不要辅助这行注释
syntax on
set nu
2. vi sets the number of lines and highlights
After the vim setting number above:
vi /etc/bashrc
# 最后一行加入
alias vi=vim
Restart using source/etc/bashrc
source /etc/bashrc
After the execution is completed, vim and vi will be highlighted when editing, which is very convenient.