首页 > 其他分享 >4.vim帮助文档

4.vim帮助文档

时间:2023-07-29 23:33:27浏览次数:36  
标签:帮助 -- text vim sample command 文档 line example

1.1 basic modes

  • Chinese reference manual

    https://yianwillis.github.io/vimcdoc/doc/help.html
    
  • :help ON-LINE HELP

    # search for help
    :help
    :help keyword
    
    # example
    :help inserting
    
  • start Normal mode

    # vim file.txt
    Since you have just started Vim it will be in Normal mode.
    
    # <Esc>
    To get back to Normal mode, no matter what mode you are in, press the <Esc> key.
    
  • start Insert mode

    # These commands are used to start inserting text.
                        *a*  *A*
    a   Append text after the cursor [count] times.
    A   Append text at the end of the line [count] times.
                        *i*  *I*
    i   Insert text before the cursor [count] times.
    I   Insert text before the first non-blank in the line [count] times.
                        *o*  *O*
    o   Begin a new line below the cursor and insert text, repeat [count] times.
    O   Begin a new line above the cursor and insert text, repeat [count] times.
    
    # <Esc>
    You can end insert mode with <Esc>.
    

1.2 Normal mode

  • Moving around

    # *03.1*  Word movement
    The "w" command moves to the start of the next word.
    The "b" command moves backward to the start of the previous word.
    
            This is a line with example text
            x-->-->->----------------->
            w  w  w    3w
    
            This is a line with example text
            <----<--<-<---------<--x
            b   b b    2b      b
    
    # *03.2*  Moving to the start or end of a line
    The "$" command moves the cursor to the end of a line. (same as <End> key)
    
    The "0" command (zero) moves to the very first character of the line. (same as <Home> key)
    The "^" command moves to the first non-blank character of the line.
    
                    ^
                <-----------x
            .....This is a line with example text
            <----------------x   x-------------->
                    0                  $
    
    (the "....." indicates blanks here)
    
    # *03.3*  Moving to a character
    The "fh" command searches forward in the line for the single character 'h'.
    
            To err is human.  To really foul up you need a computer.
            ---------->--------------->
                fh           fy
    
    The "F" command searches to the left:
    
            To err is human.  To really foul up you need a computer.
                    <---------------------
                                Fh
    
    The "3fu" command searches forward to the third character 'u' (the "u" of "you").
    
            To err is human.  To really foul up you need a computer.
                            -------------------->
                                    3fu
    
    # *03.4*  Matching a parenthesis
    the "%" command moves to the matching paren.
    If the cursor is on a "(" it will move to the matching ")". This also works for [] and {} pairs.
    
                                %
                            <----->
                    if (a == (b * c) / d)
                    <---------------->
                                %
    
    # *03.5*  Moving to a specific line
                # whole file #
    "gg" positions you at the start of a file.
    "G"  positions you at the end of the file.
    "7G" puts you on line 7.
    
                |   first line of a file   ^
                |   text text text text    |
                |   text text text text    |  gg
            7G  |   text text text text    |
                |   text text text text
                |   text text text text
                V   line 7777 7777 line    |
                    text text text text    |  G
                    text text text text    |
                    last line of a file    V
    
                # current page #
    "H" stands for Home, "M" for Middle and "L" for Last.
    
                            +---------------------------+
                    H -->   | text sample text          |
                            | sample text               |
                            | text sample text          |
                            | sample text               |
                    M -->   | text sample text          |
                            | sample text               |
                            | text sample text          |
                            | sample text               |
                    L -->   | text sample text          |
                            +---------------------------+
    
    # *03.7*  Scrolling around
    The CTRL-U command scrolls down half a screen of text.(DOWN)
    The CTRL-D command scrolls  up  half a screen of text.(UP)
    
                                        +----------------+
                                        | some text      |
                                        | some text      |
                                        | some text      |
            +---------------+              | some text      |
            | some text     |  CTRL-U  --> |                |
            |               |              | 123456         |
            | 123456        |              +----------------+
            | 7890          |
            |               |              +----------------+
            | example       |  CTRL-D -->  | 7890           |
            +---------------+              |                |
                                        | example        |
                                        | example        |
                                        | example        |
                                        | example        |
                                        +----------------+
    
    The CTRL-F command scrolls forward by a whole screen.(FORWARD)
    The CTRL-B command scrolls backward by a whole screen.(BACKWARD)
    
    
    # *03.8*  Simple searches
    the "/keyword" command to find the word 'keyword'.(The "?" command works like "/" but searches backwards)
        the "n" command finds next keyword.
        the "N" command finds backward.
        IGNORING CASE
            If you don''t care about upper or lowercase in a word, set the 'ignorecase' option:
            :set ignorecase
            :set noignorecase
        SEARCHING FOR WHOLE WORDS
            "/the"      soothe there the
            "/the\>"    soothe the
            "/\<the\>"  the
        HIGHLIGHTING MATCHES
            :set hlsearch
            :set nohlsearch
    
    
    # *03.9*  Simple search patterns
    The Vim editor uses regular expressions to specify what to search for.
    
            the solder holding one of the chips melted and the
            xxx                       xxx                  xxx
    
    Using "/the$" we find this match:
    
            the solder holding one of the chips melted and the
                                                        xxx
    
    And with "/^the" we find this one:
            the solder holding one of the chips melted and the
            xxx
    
    
    

标签:帮助,--,text,vim,sample,command,文档,line,example
From: https://www.cnblogs.com/is-raining/p/17590782.html

相关文章

  • shell命令概述 Shell作用:命令解释器 介于操作系统内核与用户之间,负责解释命令行 获得
    shell命令概述Shell作用:命令解释器介于操作系统内核与用户之间,负责解释命令行获得命令帮助内部命令help命令的“--help”选项使用man命令阅读手册页命令行编辑的几个辅助操作Tab键:自动补齐反斜杠“\”:强制换行快捷键Ctrl+U:清空至行首快捷键Ctrl+K:清空至行尾快捷键Ctr......
  • 在 ASP.NET Core 中使用 IHttpClientFactory 发出 HTTP 请求(官方文档)
    在ASP.NETCore中使用IHttpClientFactory发出HTTP请求项目2023/04/11本文内容消耗模式发出POST、PUT和DELETE请求出站请求中间件使用基于Polly的处理程序作者:KirkLarkin、SteveGordon、GlennCondron和RyanNowak。可以注册IHttpClientFactory并将其......
  • 上传图片或文档 二进制文档流方式上传
    问题:接口上传图片需要将图片以二进制得格式与其他字段一块传给后端方案:改变接口传递类型  application/x-www-form-urlencodedletparams={thaliId:this.editData.thaliId,thaliPrice:this.editData.thaliPrice,salesInstructions:thi......
  • PyTorch 1.4 中文文档校对活动正式启动 | ApacheCN
    一如既往,PyTorch1.4中文文档校对活动启动了!认领须知请您勇敢地去翻译和改进翻译。虽然我们追求卓越,但我们并不要求您做到十全十美,因此请不要担心因为翻译上犯错——在大部分情况下,我们的服务器已经记录所有的翻译,因此您不必担心会因为您的失误遭到无法挽回的破坏。(改编自维基百......
  • 有效文档管理离不开这几个特点
    在我们日常生活中经常会遇到各式各样的文档类型,想要把它们都统一管理起来也不是一件容易的事情。后来looklook就去研究怎么样可以把这一堆文档整理起来呢?接下来,looklook就从有效的文档管理展开,和大家分享一下!有效文档管理的特点1.强大的搜索和索引功能一个好的文档管理解决方案能够......
  • Vim文本编辑器
    可以分别使用a、i、o三个键从命令模式切换到输入模式。其中,a键与i键分别是在光标后面一位和光标当前位置切换到输入模式,而o键则是在光标的下面再创建一个空行,此时可敲击a键进入到编辑器的输入模式 命令模式中最常用的一些命令命令 作用dd 删除(剪切)光标所在整行5dd 删除(剪切)从光......
  • k8s 按照文档
    一、环境准备两台服务器:1、master2、worker-node3、关闭防火墙:systemctlstopfirewalldsystemctldisablefirewalld4、关闭selinuxsed-i's/enforcing/disabled/'/etc/selinux/configsetenforce05、关闭swapswapoff-ased-ri's/.*swap.*/#&/'/etc/fstab6、服务器规划cat......
  • linux vi和vim编辑器
    摘要目的介绍vi和vim介绍最常用的指令一、vi和vim简介Linux系统会内置vi文本编辑器Vim具有程序编辑的能力,可以看做是Vi的增强版本,可以主动的以字体颜色辨别语法的正确性,方便程序设计。代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。二、......
  • 简约好看的帮助中创建案例,感觉点赞收藏!
    在线帮助中心创建案例是提供用户支持和解决问题的有效方式之一。一个简约好看的帮助中心案例能够帮助用户快速找到需要的信息并解决问题,同时也能提升用户体验,增加点赞和收藏的可能性。以下是一些建议来创建简约好看的帮助中心案例:简明扼要的标题:案例标题应该简明扼要,能够准确描述用......
  • React技术文档(一)
    React技术文档(一)安装全局安装react脚手架npmi-gcreate-react-app查看react安装版本create-react-app-V进入目标文件夹下创建react项目create-react-appmyReact启动项目注意:启动react需要关闭浏览器的react开发者工具npmstart解决脚手架安装较......