⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vi指令大全.htm

📁 autoconf automake实例gcc编译java方法.txt
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<H2>删除命令</H2>
<P>ndw或ndW: 删除光标处开始及其后的n-1个字 </P>
<P>do: 删至行首 </P>
<P>d$: 删至行尾 </P>
<P>ndd: 删除当前行及其后n-1行 </P>
<P>x或X: 删除一个字符,x删除光标后的,而X删除光标前的 </P>
<P>Ctrl+u: 删除输入方式下所输入的文本 </P>
<DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px">[<A title=Vi指令大全 
href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit&amp;section=6">编辑</A>]</DIV><A 
name=.E6.90.9C.E7.B4.A2.E5.8F.8A.E6.9B.BF.E6.8D.A2.E5.91.BD.E4.BB.A4></A>
<H2>搜索及替换命令</H2><PRE>/pattern: 从光标开始处向文件尾搜索pattern
?pattern: 从光标开始处向文件首搜索pattern
n: 在同一方向重复上一次搜索命令
N: 在反方向上重复上一次搜索命令
:s/p1/p2/g: 将当前行中所有p1均用p2替代
:n1,n2s/p1/p2/g: 将第n1至n2行中所有p1均用p2替代
:g/p1/s//p2/g: 将文件中所有p1均用p2替换
</PRE>
<DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px">[<A title=Vi指令大全 
href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit&amp;section=7">编辑</A>]</DIV><A 
name=.E9.80.89.E9.A1.B9.E8.AE.BE.E7.BD.AE></A>
<H2>选项设置</H2>
<P>all: 列出所有选项设置情况 </P>
<P>term: 设置终端类型 </P>
<P>ignorance: 在搜索中忽略大小写 </P>
<P>list: 显示制表位(Ctrl+I)和行尾标志($) </P>
<P>number: 显示行号 </P>
<P>report: 显示由面向行的命令修改过的数目 </P>
<P>terse: 显示简短的警告信息 </P>
<P>warn: 在转到别的文件时若没保存当前文件则显示NO write信息 </P>
<P>nomagic: 允许在搜索模式中,使用前面不带“\”的特殊字符 </P>
<P>nowrapscan: 禁止vi在搜索到达文件两端时,又从另一端开始 </P>
<P>mesg: 允许vi显示其他用户用write写到自己终端上的信息 </P>
<DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px">[<A title=Vi指令大全 
href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit&amp;section=8">编辑</A>]</DIV><A 
name=.E6.9C.80.E5.90.8E.E8.A1.8C.E6.96.B9.E5.BC.8F.E5.91.BD.E4.BB.A4></A>
<H2>最后行方式命令</H2><PRE>:n1,n2 co n3: 将n1行到n2行之间的内容拷贝到第n3行下
:n1,n2 m n3:将n1行到n2行之间的内容移至到第n3行下
:n1,n2 d: 将 n1行到n2行之间的内容删除
:w: 保存当前文件
:e filename: 打开文件filename进行编辑
:x: 保存当前文件并退出
:q: 退出vi
:q!: 不保存文件并退出vi
:!command: 执行shell命令command
:n1,n2 w!command: 将文件中n1行至n2行的内容作为command的输入并执行之,<BR> 若不指定n1,n2,则表示将整个文件内容作为command的输入
:r!command: 将命令command的输出结果放到当前行
</PRE>
<DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px">[<A title=Vi指令大全 
href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit&amp;section=9">编辑</A>]</DIV><A 
name=.E5.AF.84.E5.AD.98.E5.99.A8.E6.93.8D.E4.BD.9C></A>
<H2>寄存器操作</H2>
<P>"?nyy: 将当前行及其下n行的内容保存到寄存器?中,其中?为一个字母,n为一个数字 </P>
<P>"?nyw: 将当前行及其下n个字保存到寄存器?中,其中?为一个字母,n为一个数字 </P>
<P>"?nyl: 将当前行及其下n个字符保存到寄存器?中,其中?为一个字母,n为一个数字 </P>
<P>"?p: 取出寄存器?中的内容并将其放到光标位置处。这里?可以是一个字母,也可以是一个数字 </P>
<P>ndd: 将当前行及其下共n行文本删除,并将所删内容放到1号删除寄存器中 </P><!-- Saved in parser cache with key crossday_kb:pcache:idhash:2242-1!1!0!1!0!1!0!!zh_cn and timestamp 20070523125504 -->
<DIV class=printfooter>取自"<A 
href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8">http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8</A>"</DIV><!-- end content -->
<DIV class=visualClear></DIV></DIV></DIV></DIV>
<DIV id=column-one>
<DIV class=portlet id=p-cactions>
<H5>Views</H5>
<UL>
  <LI class=selected id=ca-nstab-main><A 
  href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8">条目</A>
  <LI class=new id=ca-talk><A 
  href="http://kb.discuz.net/index.php?title=Talk:Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit">讨论</A>
  <LI id=ca-edit><A 
  href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=edit">编辑</A>
  <LI id=ca-history><A 
  href="http://kb.discuz.net/index.php?title=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8&amp;action=history">History</A> 
  </LI></UL></DIV>
<DIV class=portlet id=p-personal>
<H5>Personal tools</H5>
<DIV class=pBody>
<UL>
  <LI id=pt-login><A 
  href="http://kb.discuz.net/index.php?title=Special:Userlogin&amp;returnto=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8">用户登录</A> 
  </LI></UL></DIV></DIV>
<DIV class=portlet id=p-logo><A title=首页 
style="BACKGROUND-IMAGE: url(/skins/common/images/wiki.png)" 
href="http://kb.discuz.net/index.php?title=%E9%A6%96%E9%A1%B5"></A></DIV>
<SCRIPT type=text/javascript> if (window.isMSIE55) fixalpha(); </SCRIPT>

<DIV class=portlet id=p-nav>
<H5>导航</H5>
<DIV class=pBody>
<UL>
  <LI id=n-mainpage><A 
  href="http://kb.discuz.net/index.php?title=%E9%A6%96%E9%A1%B5">首页</A> 
  <LI id=n-portal><A 
  href="http://kb.discuz.net/index.php?title=Comsenz_Knowledge_Base:Community_Portal">社区</A> 

  <LI id=n-currentevents><A 
  href="http://kb.discuz.net/index.php?title=Current_events">新闻动态</A> 
  <LI id=n-recentchanges><A 
  href="http://kb.discuz.net/index.php?title=Special:Recentchanges">最近更改</A> 
  <LI id=n-randompage><A 
  href="http://kb.discuz.net/index.php?title=Special:Randompage">随机页面</A> 
  <LI id=n-help><A href="http://en.wikipedia.org/wiki/帮助">帮助</A> 
</LI></UL></DIV></DIV>
<DIV class=portlet id=p-search>
<H5><LABEL for=searchInput>搜索</LABEL></H5>
<DIV class=pBody>
<FORM id=searchform name=searchform 
action=/index.php?title=Special:Search><INPUT id=searchInput accessKey=f 
name=search> <INPUT class=searchButton id=searchGoButton type=submit value=进入 name=go>&nbsp;<INPUT class=searchButton type=submit value=搜索 name=fulltext> 
</FORM></DIV></DIV>
<DIV class=portlet id=p-tb>
<H5>工具</H5>
<DIV class=pBody>
<UL>
  <LI id=t-whatlinkshere><A 
  href="http://kb.discuz.net/index.php?title=Special:Whatlinkshere&amp;target=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8">链入页面</A> 

  <LI id=t-recentchangeslinked><A 
  href="http://kb.discuz.net/index.php?title=Special:Recentchangeslinked&amp;target=Vi%E6%8C%87%E4%BB%A4%E5%A4%A7%E5%85%A8">链出更改</A> 

  <LI id=t-specialpages><A 
  href="http://kb.discuz.net/index.php?title=Special:Specialpages">特殊页面</A> 
</LI></UL></DIV></DIV></DIV><!-- end of the left (by default at least) column -->
<DIV class=visualClear></DIV>
<DIV id=footer>
<DIV id=f-poweredbyico><A href="http://www.mediawiki.org/"><IMG alt=MediaWiki 
src="Vi指令大全 - Wikipedia.files/poweredby_mediawiki_88x31.png"></A></DIV>
<UL id=f-list>
  <LI id=f-lastmod>最后更改10:06 2006年7月3日. 
  <LI id=f-viewcount>本页面已经被浏览7280次。 
  <LI id=f-about><A title=Wikipedia:关于 
  href="http://en.wikipedia.org/wiki/关于">关于Wikipedia</A> 
  <LI id=f-disclaimer><A title="Comsenz Knowledge Base:General disclaimer" 
  href="http://kb.discuz.net/index.php?title=Comsenz_Knowledge_Base:General_disclaimer">Disclaimers</A> 
  </LI></UL></DIV></DIV><!-- Served by phpchina.com in 0.16 secs. --></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -