现在的位置: 首页 > 综合 > 正文

vimrc.local

2013年09月09日 ⁄ 综合 ⁄ 共 664字 ⁄ 字号 评论关闭

vim配置:

set nocp

set ru
set hls
set is
syntax on
set backspace=indent,eol,start
set sw=4
set ts=4
set list
set listchars=tab:>-,trail:%                                    #VIM TAB键用-显示,空格键用$显示
set sm
set cin
colo slate
set guifont=Courier\ New\ 10

map <F3> !g++ % -o mainutocmd FileType python setlocal et sta sw=4 sts=4

====================================================================================

去除行尾多余的空格:

:%s/\s\+$//g

:1,$s/\s\+$//g

% 或者 1,$ 全局查找

\s 的意思是空格

\s \S : : : : : : : : : : : : : : : : a white space, a non-white space

\+的意思是匹配1到n个

\= * \+ : : : : match 0::1, 0::1, 1::1 of preceding atoms

$表示行尾

^ $ : : : : : : : : : : : : : : : : : : : : : : : : : rst, last character of line

也可以这么写:

:%s= *$==

=为命令的分隔符,和/类似

===================================================================================

抱歉!评论已关闭.