Enable Code Highlight in VIM on AIX / AIX 中开启语法高亮

Code highlight is disabled by default while you installed VIM in AIX. The root cause is default installation doesn’t create the .vimrc file. You can follow below steps to enable it.

  1. Add “export TERM=aixterm” to “.profile” in your home directory.
  2. Copy “$VIMRUNTIME/vimrc_example.vim” to “$HOME/.vimrc”.

In my system, my $VIMRUNTIME is “/opt/freeware/share/vim/vim63/” and my Home directory is “/”. And the item 1 is optional.

Continue reading

vim 多行添加注释,删除注释

按键操作:

添加注释:Ctrl+v 进入列编辑模式。向下或向上移动光标,把需要注释的行的开头标记起来,然后按大写的I,再插入注释符,比如“#”,再按Esc。就会全部注释了。

删除注释:同样 Ctrl+v 进入列选择模式,移到光标把注释符选中,按下d,OK了

 

使用替换命令:

:% s/^/#/g 来在全部内容的行首添加 # 号注释

:2,50 s/^/#/g 在2~50 行首添加 # 号注释

反过来替换既是删除操作。