GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — note/note/vim/17.md at master · trialbox/note

Expand file tree

/

17.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
27 lines (16 loc) · 1.54 KB
/

17.md

Copy path

File metadata and controls

27 lines (16 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Edit and raw actions

每日一Vim(17)Visual 模式(1)

Visual 模式的三种子模式(基于字符,行,块)可以对不同文本域进行处理,这一小节看看如何使用这三种模式以及他们之间如何切换。

_字符可视化模式_可以对任何单个字符或字符串甚至是多行进行处理,通常适用于处理单词或者词组,如果是想处理整行,那么就可以使用 (line)行可视化模式,块可视化 则可以对文档区域操作,支持列操作。normal 模式下,命令对应的Visual表如下:

v         基于字符的Visual模式
V         基于行的Visual模式
Ctrl+v    基于块的Visual 模式
gv        重新选取最后一次使用Visual模式选中的文本

####Visual模式之间的切换

如果当前是在字符Visual模式下,V就能切换到基于行的Visual模式,Ctrl+v就是切换到基于块的Visual模式下,来回的按v能在normal模式和字符Visual模式下切换。此规则同样适用与另外两种Vrsual模式。

####光标在选择区域首尾切换

首先我们在看这么一个图:
vim17_1
当前光标在第一行的h位置,我想实现的效果是通过光标在选择区域两端切换的方式把_here to here_ 都选中,那么命令o就能用来区域首尾切换的。其对应的命令如下图所以:
vim17_2

转载请注明出处,谢谢合作!作者---zhijun

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.