<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]vi 删除行尾空格 ,vary.vim-自动去掉行尾空格，Editplus删除行尾空格，RegexBuddy调试之多行尾测试之Whole file改为Line by line，sublime去行尾空格。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Thu, 25 Jun 2015 06:41:47 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：vim打开代码时候发现空格显示后发现行尾有一堆空格...得删除，在vim配置下可以高亮这些空格，看到后方便删除掉。<br/>让vim显示行尾的空格的配置办法，在/etc/vimrc文件添加如下两行 ：<br/>highlight WhitespaceEOL ctermbg=red guibg=red <br/>match WhitespaceEOL /&#92;s&#92;+$/<br/>match WhitespaceEOL /&#92;t&#92;+/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #匹配tab实践从Windows上传Tab字符上去是OK的。<br/>摘自：http://www.codeweblog.com/%E8%AE%A9vim%E6%98%BE%E7%A4%BA%E7%A9%BA%E6%A0%BC-%E5%8F%8Atab%E5%AD%97%E7%AC%A6-vim-%E5%A4%9A%E8%A1%8C%E6%B3%A8%E9%87%8A/<br/><br/>方法一：vi 删除行尾空格以替换解决掉删除行尾空格，实践OK如下：<br/>行末：$ <br/>行首：^<br/>空格：&#92;s<br/><br/>行末空格：&#92;s&#92;+$<br/>行首空格：^&#92;+&#92;s<br/><br/>删除行尾空格：<br/>:%s/&#92;s&#92;+$//<br/><br/>:%s/&#92;s&#92;+$//g&nbsp;&nbsp; #也成，别少个$就成，否则所有空格全给去了。<br/>http://blog.itpub.net/22661144/viewspace-1433706/<br/><br/>方法二：用插件实现，实践OK，共两步<br/>（1）安装插件到指定目录：<br/>cd /tmp<br/>git clone https://github.com/dongweiming/vary.vim&nbsp;&nbsp;<br/>mkdir -p /root/.vim/plugin<br/>cd /root/.vim/plugin<br/>mv /tmp/vary.vim/plugin/vary.vim /root/.vim/plugin/<br/>ls /root/.vim/plugin/vary.vim<br/>备注：特别注意，直接wget是不行的，wget https://github.com/dongweiming/vary.vim/blob/master/plugin/vary.vim,这个是网页，不全是源码，要么点上面的RAW，否则得git clone,里面的doc里的内容没有啥实际的功能性用处，不放也行，并不影响使用。<br/>（2）让插件在vim 里配置并生效：<br/>vim /root/.vimrc<br/><textarea name="code" class="php" rows="15" cols="100">
set tabstop=4
let g:auto_striptrail = &quot;htm,html,txt,xml,css,c,cpp,conf,cnf,php,vimrc,bash_profile,bashrc,sh,h,cpp,c,spec,ini,cfg,lua,xlsx,ltf,md,ltf,repo,jmx,js,python,ruby,csp&quot;
let g:auto_striptab = &quot;htm,html,txt,xml,css,c,cpp,conf,cnf,php,vimrc,bash_profile,bashrc,sh,h,cpp,c,spec,ini,cfg,lua,xlsx,ltf,md,ltf,repo,jmx,js,python,ruby,csp&quot;
autocmd BufReadPost * :call StripTrailingWhite()
autocmd BufReadPost * :call RetabIndents()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</textarea><br/>实践发现Txt文件不行，不能替换，PHP可以，再就是在/root/.vimrc里包含就直接包含：<br/>if filereadable(expand(&quot;~/.vimrc.bundles&quot;))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;source ~/.vimrc.bundles<br/>endif<br/><br/>#cat /root/.vimrc.bundles <br/><textarea name="code" class="php" rows="15" cols="100">
filetype off
&nbsp;&nbsp;set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

&quot; Define bundles via Github repos &quot;
Bundle &#039;christoomey/vim-run-interactive&#039;
Bundle &#039;croaky/vim-colors-github&#039;
Bundle &#039;danro/rename.vim&#039;
Bundle &#039;majutsushi/tagbar&#039;
Bundle &#039;kchmck/vim-coffee-script&#039;
Bundle &#039;kien/ctrlp.vim&#039;
Bundle &#039;pbrisbin/vim-mkdir&#039;
Bundle &#039;scrooloose/syntastic&#039;
Bundle &#039;slim-template/vim-slim&#039;
Bundle &#039;thoughtbot/vim-rspec&#039;
Bundle &#039;tpope/vim-bundler&#039;
Bundle &#039;tpope/vim-endwise&#039;
Bundle &#039;tpope/vim-fugitive&#039;
Bundle &#039;tpope/vim-rails&#039;
Bundle &#039;tpope/vim-surround&#039;
Bundle &#039;vim-ruby/vim-ruby&#039;
Bundle &#039;vim-scripts/ctags.vim&#039;
Bundle &#039;vim-scripts/matchit.zip&#039;
Bundle &#039;vim-scripts/tComment&#039;
Bundle &#039;mattn/emmet-vim&#039;
Bundle &#039;scrooloose/nerdtree&#039;
Bundle &#039;Lokaltog/vim-powerline&#039;
Bundle &#039;godlygeek/tabular&#039;
Bundle &#039;msanders/snipmate.vim&#039;
Bundle &#039;jelera/vim-javascript-syntax&#039;
Bundle &#039;altercation/vim-colors-solarized&#039;
Bundle &#039;othree/html5.vim&#039;
Bundle &#039;xsbeats/vim-blade&#039;
Bundle &#039;Raimondi/delimitMate&#039;
Bundle &#039;groenewege/vim-less&#039;
Bundle &#039;Lokaltog/vim-easymotion&#039;
Bundle &#039;tomasr/molokai&#039;
Bundle &#039;klen/python-mode&#039;
Bundle &#039;dongweiming/vary.vim&#039;
</textarea><br/><br/>直接修改插件：<br/>vi /root/.vim/bundle/vary.vim/plugin/vary.vim<br/><br/>VIM调试/root/.vimrc的脚本方法：<br/>vim -D /tmp/jackX.txt<br/><br/>最后两行介绍,在/root/.vimrc下面加两行实现后，实践发现，打开时就自动去行尾空格,在写入前有行尾空格也给自动去了写入：<br/>autocmd BufReadPost * :call StripTrailingWhite()<br/>autocmd BufReadPost * :call RetabIndents()<br/>表示打开文件之前就修改，把修改后的结果呈现给你<br/>成功实践来自网址：http://www.tuicool.com/articles/aQfqUv<br/><br/><br/>三、实践OK之Editplus删除行尾空格:<br/>Editplus的替换查找：　&#92;s+$<br/>[V]正则表达式<br/>全部替换<br/><br/><br/>四、RegexBuddy调试之多行尾测试之Whole file改为Line by line：<br/>Match：<br/>&#92;s+$<br/><br/>Test:<br/>psql &#92;&nbsp;&nbsp;<br/>&nbsp;&nbsp; --host=127.0.0.1 &#92;&nbsp;&nbsp;<br/>&nbsp;&nbsp; --port=5432 &#92;&nbsp;&nbsp;<br/>&nbsp;&nbsp; --username kong &#92;&nbsp;&nbsp;<br/>&nbsp;&nbsp; --password &#92;&nbsp;&nbsp;<br/>&nbsp;&nbsp; --dbname=kongdb <br/><br/>发现只被替换了kongdb后面的空格，怎么办？<br/>在Test下面一行有一个：Whole file改为Line by line即可按多行，也就能看到上面这个六行的行尾给变黄了，也就是被标记成行尾空格了。<br/><br/><br/>四、sublime去行尾空格：<br/>&#92;s+$ <br/><br/>（1）具体步骤：<br/>CTRL+H打开replace功能，勾选上左侧的regular expression，并填写 <br/>find what栏 : &#92;s+$ <br/>replace with栏 : （这行留空） <br/>接着点replace all即可<br/><br/>（2）配置法去行尾空格：<br/>点击菜单栏上的“Preferences”，找到“Setting-Default”，搜索“trim_trailing_white_space_on_save：&quot;trim_trailing_white_space_on_save&quot;: true,
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]vi 删除行尾空格 ,vary.vim-自动去掉行尾空格，Editplus删除行尾空格，RegexBuddy调试之多行尾测试之Whole file改为Line by line，sublime去行尾空格。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>