Linux Vim 使用指南


#Linux#


在多行行首插入相同字符

例如添加注释符号#

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

解决无法使用Backspace键删除字符

:set backspace=indent,eol,start

设置字符编码

set encoding=utf-8  " The encoding displayed.
set fileencoding=utf-8  " The encoding written to file.

tab键默认为4个空格

set ts=4
set expandtab
set autoindent

删除行尾的^M

:%s/\r//g

就是把\r换成空字符(意味着删掉)。


( 本文完 )