码迷,mamicode.com
首页 > 系统相关 > 详细

vim --Filter commands

时间:2016-12-13 00:07:27      阅读:399      评论:0      收藏:0      [点我收藏+]

标签:vim 信息过滤

命令也被称作是motion



:help !


Filter commands 


信息过滤 (filter)

!==>tell vim to performing a filter operation

!5G -> 从光标下向下5行执行过滤程序 (tell vim to start filter under cursor and go down 5 lines)

:.,.+4!


:10,15!sort -> 只在文件的第10行到第15行之间执行 (sort between line 10 to 15)

!! -> (filter the current line)

:.,$!sort (sort from current line to end) 


!!date -> 插入当前时间 (insert current date)




A filter is a program that accepts text at standard input, changes it in some

way, and sends it to standard output.  You can use the commands below to send

some text through a filter, so that it is replace by the filter output.

Examples of filters are "sort", which sorts lines alphabetically, and

"indent", which formats C program files (you need a version of indent that

works like a filter; not all versions do).  The ‘shell‘ option specifies the

shell Vim uses to execute the filter command (See also the ‘shelltype‘

option).  You can repeat filter commands with ".".  Vim does not recognize a

comment (starting with ‘"‘) after the ":!" command.




:! -> 直接运行shell中的一个外部命令 (call any external program) 


vim --Filter commands

标签:vim 信息过滤

原文地址:http://xychong123.blog.51cto.com/2190260/1882087

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!