如何使用VIM的Help

很多时候在用到vim的命令的时候,都会去网上搜索,殊不知,如果熟练使用VIM的help,可以达到事半功倍的效果。

下面介绍如何使用VIM的help:

 

1.      在vim的一般模式中输入:help可以进入vim的help界面


这里面注意:

Ctrl+]     在光标在链接位置的时候,可以直接跳到光标处

:q        退出help返回vim一般模式

 

 

其中的表示,要在命令行里输入“:helpi_<ESC>”,而不是输入“:help i_”后,再去按下ESC键。

 

 

 

4.在shell中输入“vimtutor”可以进入vim的 tutor。

 

其实,我感觉写的最好的vim的初级入门还是这篇文章。这里摘出其中的summary供参考。

 

 

  vimtutor summary

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 1 SUMMARY

 

 

  1.The cursor is moved using either the arrow keys or the hjkl keys.

        h (left)  j(down)       k (up)      l(right)

 

  2.To start Vim from the shell prompt type: vim FILENAME <ENTER>

 

  3.To exit Vim type:      <ESC>  :q!   <ENTER>  to trash all changes.

            OR type:          <ESC>  :wq  <ENTER>  to save the changes.

 

  4.To delete the character at the cursor type: x

 

  5.To insert or append text type:

        i   typeinserted text   <ESC>        insert before the cursor

        A   typeappended text   <ESC>         append after the line

 

NOTE: Pressing <ESC> will place youin Normal mode or will cancel

     an unwanted and partially completed command.

 

Now continue with Lesson 2.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 2 SUMMARY

 

 

  1.To delete from the cursor upto the next word type:    dw

  2.To delete from the cursor to the end of a line type:    d$

  3.To delete a whole line type:    dd

 

  4.To repeat a motion prepend it with a number:  2w

  5.The format for a change command is:

               operator   [number]  motion

    where:

      operator - is what to do, such as d  for delete

      [number] - is an optional count to repeat the motion

      motion   - moves over the text tooperator on, such as  w (word),

                $ (to the end of line), etc.

 

  6.To move to the start of the line use a zero: 0

 

  7.To undo previous actions, type:           u (lowercase u)

    To undo all the changes on a line, type: U  (capital U)

    To undo the undo's, type:                   CTRL-R

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 3 SUMMARY

 

 

  1.To put back text that has just been deleted, type   p . This puts the

    deleted text AFTER the cursor (if a line was deleted it will go on the

    line below the cursor).

 

  2.To replace the character under the cursor, type   r  and then the

    character you want to have there.

 

  3.The change operator allows you to change from the cursor to where the

    motion takes you.  eg. Type  ce  tochange from the cursor to the end of

    the word,  c$  to change to the end of a line.

 

  4.The format for change is:

 

        c  [number]   motion

 

Now go on to the next lesson.

 

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 4 SUMMARY

 

 

  1.CTRL-G  displays your location in thefile and the file status.

            G  moves to the end of the file.

    number  G  moves to that line number.

           gg  moves to the first line.

 

  2.Typing  /       followedby a phrase searches FORWARD for the phrase.

    Typing  ?     followed by a phrase searches BACKWARD for the phrase.

     After a search type  n  tofind the next occurrence in the same direction

    or  N  to search in the opposite direction.

    CTRL-O takes you back to older positions, CTRL-I to newer positions.

 

  3.Typing  %     whilethe cursor is on a (,),[,],{, or } goes to its match.

 

  4.To substitute new for the first old in a line type    :s/old/new

    To substitute new for all 'old's on a line type         :s/old/new/g

    To substitute phrases between two line #'s type      :#,#s/old/new/g

    To substitute all occurrences in the file type          :%s/old/new/g

    To ask for confirmation each time add 'c'              :%s/old/new/gc

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 5 SUMMARY

 

 

 1.  :!command  executes an external command.

 

     Some useful examples are:

        (MS-DOS)      (Unix)

         :!dir              :!ls              - shows a directory listing.

         :!del FILENAME   :!rm FILENAME   - removes file FILENAME.

 

 2.  :w FILENAME  writes the current Vim file to disk with nameFILENAME.

 

 3.  v  motion :w FILENAME  saves the Visuallyselected lines in file

     FILENAME.

 

 4.  :r FILENAME  retrieves disk file FILENAME and puts itbelow the

     cursor position.

 

 5.  :r !dir  reads the output of the dir command and putsit below the

     cursor position

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 6 SUMMARY

 

  1.Type  o to open a line BELOW the cursor and start Insert mode.

    Type  O  to open a line ABOVE the cursor.

 

  2.Type  a to insert text AFTER the cursor.

    Type  A  to insert text after the end of the line.

 

  3.The  e command moves to the end of a word.

 

  4.The  y operator yanks (copies) text, p  puts (pastes) it.

 

  5.Typing a capital  R  enters Replace mode until  <ESC> is pressed.

 

  6.Typing ":set xxx" sets the option "xxx".  Some options are:

      'ic' 'ignorecase' ignore upper/lower case when searching

       'is''incsearch'   show partial matches for asearch phrase

       'hls''hlsearch'   highlight all matchingphrases

    You can either use the long or the short option name.

 

  7.Prepend "no" to switch an option off:   :set noic

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            LESSON 7 SUMMARY

 

 

  1.Type  :help  or press <F1> or <Help>  to open a help window.

 

  2.Type  :help cmd  to find help on  cmd .

 

  3.Type  CTRL-W CTRL-W  to jump to another window

 

  4.Type  :q to close the help window

 

  5.Create a vimrc startup script to keep your preferred settings.

 

  6.When typing a  :  command, press CTRL-D to see possiblecompletions.

    Press <TAB> to use one completion.

 

 

 

 

 

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/301188.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

可编程智能小车,100种玩法,从3岁玩到15岁,培养孩子“最强大脑”

▲数据汪特别推荐点击上图进入玩酷屋毫无疑问&#xff0c;数学、科学和计算机科学是解决21世纪现代问题的三大支柱。当现在各式各样的兴趣班和教育辅导班快要呈现饱和状态时&#xff0c;一种新兴的教育活动正如火如荼地进行着那就是少儿编程。少儿编程奇迹般的红火&#xff0c;…

php 数组什么情况下是空的?

转载于:https://www.cnblogs.com/persist/p/3183819.html

WPF实现时间轴(仿Gitee)

WPF开发者QQ群&#xff1a; 340500857 | 微信群 -> 进入公众号主页 加入组织“ 前言&#xff0c;接着上一篇圆形菜单。”欢迎转发、分享、点赞、在看&#xff0c;谢谢~。 01—效果预览效果预览&#xff08;更多效果请下载源码体验&#xff09;&#xff1a;02—代码如下一、…

java如何用键盘输入_java中如何从键盘输入(附代码)

一、java不像C中拥有scanf这样功能强大的函数&#xff0c;大多是通过定义输入输出流对象。常用的类有BufferedReader&#xff0c;Scanner。相关java视频教程推荐&#xff1a;java实例程序&#xff1a;视频教程1、利用 Scanner 实现从键盘读入integer或float 型数据//import jav…

JS partial-application

为什么80%的码农都做不了架构师&#xff1f;>>> /* Title: Partial applicationDescription: the process of fixing a number of arguments to a function, producing another function of smaller arity */var partialAny (function(aps) {// This function wil…

每日一笑 | 我写了一段代码,为什么不能运行呢?

全世界只有3.14 % 的人关注了数据与算法之美&#xff08;图源网络&#xff0c;侵权删&#xff09;

使用IQueryable扩展方法实现复杂查询条件

问题在业务开发中&#xff0c;经常要处理比较复杂的查询条件&#xff0c;如下图&#xff1a;如果任一输入有值&#xff0c;则必须作为查询条件之一。示例代码如下&#xff1a;IQueryable<User> query repository.GetAll();if(name!null) {query query.Where(p>p.Name…

阿里日均纳税超1.4亿;AI换脸骗过美侦查;日本民众哄抢令和报纸;辟谣教学楼发现大量金矿;上海拨通首个5G通话;这就是今日大新闻...

今天是4月2日农历二月廿七今天星期二下面是今天的大新闻阿里巴巴日均纳税超1.4亿&#xff08;IT168&#xff09;4月1日&#xff0c;阿里巴巴在“2020财年首日”发布消息称&#xff1a;2018全年&#xff0c;阿里巴巴集团和蚂蚁金服集团总计向国家纳税516亿元&#xff0c;同比增长…

大家好!

在博客园申请帐号已经有好长时间了&#xff0c;可是一直也没有写点什么&#xff0c;可能是太忙了吧&#xff08;其实是懒&#xff09;&#xff01;以后我会多写些文字&#xff0c;毕竟这是一件好事。转载于:https://www.cnblogs.com/hubin/archive/2004/08/16/33928.html

腾讯大湘网某处csrf(city.hn.qq.com)可投诉刷留言

触发点&#xff1a; http://city.hn.qq.com http://city.hn.qq.com/auto/cshop&mbbs&id668 POST /msgboard/message.php HTTP/1.1 Host: c1.city.qq.com Connection: keep-alive Content-Length: 201 Cache-Control: max-age0 Accept: text/html,application/xhtmlxml,…

c#:细说时区、DateTime和DateTimeOffset在国际化中的应用

先说下结论&#xff1a;如果系统不考虑全球化的话&#xff0c;那么我们不用考虑时区的问题&#xff0c;因为我们可以认为中国境内的计算机全部用的是北京时间。1. 时区的来源和划分地球自转一圈是360度&#xff0c;共24小时&#xff0c;所以1小时15度&#xff0c;即&#xff1a…

超赞的“数据与算法之美”资料分享!

相信&#xff0c;一直关注着我们的同学们都知道&#xff0c;小思妹分享了好多好多的资料给大家。为了方便新来的同学自取&#xff0c;小思妹又重新整理了一遍&#xff0c;直接点以下标题即可跳转&#xff01;这是我见过的最全的训练数据集&#xff0c;没有之一&#xff01;送你…

在ASP.NET Core微服务架构下使用数据库切分和扩展, 并用JMeter进行负载测试

原文链接&#xff1a;https://itnext.io/how-to-scale-an-asp-net-core-microservice-and-sharded-database-load-test-with-jmeter-1a8c7292e7e3现在&#xff0c;您将扩展应用程序并运行多个微服务和数据库的容器实例。您将使用Docker Compose和HAProxy负载均衡器&#xff1a;…

每日一笑 | 周杰伦到底什么时候才发新专辑?

全世界只有3.14 % 的人关注了数据与算法之美&#xff08;图源网络&#xff0c;侵权删&#xff09;

GARFIELD@10-18-2004

子非猫转载于:https://www.cnblogs.com/rexhost/archive/2004/10/18/53799.html

【荐】牛逼的WPF动画库:XamlFlair

【荐】牛逼的WPF动画库&#xff1a;XamlFlair原文链接&#xff1a;https://github.com/XamlFlair/XamlFlair翻译&#xff1a;沙漠尽头的狼(本文未全文翻译&#xff0c;建议阅读原文了解更多)XamlFlairXamlFlair库的目标是简化常见动画的实现&#xff0c;并允许开发人员使用几行…

java字符串如何输出_java字符串如何输出

在Java编程中&#xff0c;我们常常用 System.out.println(); 来输出字符串。System.out.println();System是一个类&#xff0c;继承自根类Objectout是类PrintStream类实例化的一个对象&#xff0c;且是System类的静态成员变量println()是类PrintStream的成员方法&#xff0c;被…

简单易懂的自动驾驶科普知识

全世界只有3.14 % 的人关注了数据与算法之美有不少人问我人工智能和自动驾驶的技术问题&#xff0c;我作为一个主业是后端开发的老码农可是回答不了啊&#xff01;今天转载一篇自动驾驶大拿写的文章&#xff0c;学习一下。先来一张各大车企自动驾驶技术的分级图&#xff0c;大致…

WPF TextBox限制只能输入数字的两种方法

文本框中只能输入数字&#xff0c;一个常见的功能喽&#xff0c;今天就来看看如何实现它~下面就看看代码思路都写在xaml里面了&#xff0c;MainWindow.xaml:<Window x:Class"wpfcore.MainWindow"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/present…

国家特级数学教授李毓佩:我们欠孩子真正的数学阅读 !

▲数据汪特别推荐点击上图进入玩酷屋说到数学&#xff0c;我想起了13年一场轰动行业各界的“数学无用论”&#xff01;那时微博上有个话题叫做#让数学滚出高考#&#xff0c;超过7成网友都表示支持&#xff0c;这可怕的比例就能说明在中国由于数学差导致命运被洗牌的真不在少数……