Vi 速查手册(摘自www.talug.org)

博客提供了VI的快速参考内容,由托莱多地区Linux用户组整理,涉及命令、插入、文件等相关操作。
原文: http://www.talug.org/howto/viquickref.html
作者: www.talug.org

VI QUICK REFERENCE

by The Toledo Area Linux Users Group

Two Modes

VI consists of two modes, command and insert. In command mode, anything typed is taken as an editing command. In insert mode, typed text is inserted into the current document. In both cases, <ESC> will either end a partial command or exit insert mode.

Insert Mode

In insert mode, the keyboard behaves like a typewriter. Keystrokes appear as screen text after typing any of the following commands.

I - Insert text at the beginning of the line

i - Insert text at the cursor

A - Append text at the end of the line

a - Append text after the cursor

O - Open a new line of text above the cursor

o - Open a new line of text below the cursor

<ESC> - Exit insert mode, enter command mode

Command Mode

In command mode, keystrokes perform functions such as moving the cursor, searching for patterns, or quitting from the document. All commands are referenced from the current cursor position.

Cursor Movement

Arrow Keys Move one space in any direction

h,j,kl - move left,down,up,right respectively

G - Go to the last line in the file

nG - Go to line n

w - Move forward to the next word

b - Move backwards to the previous word

$ - Move to the end of the line

0 or | - Move to the beginning of the line

n| - Move to position n on the current line

<ctrl>+d - Scroll down 1/2 screen

<ctrl>+u - Scroll up 1/2 screen

<ctrl>+b - Scroll up Full

<ctrl>+f - Scroll down Full

Searching

/string - Search for a string (pattern) of characters

n - Search for the next occurrence of the string

N - Search for the previous occurrence of the string

:%s/str1/str2/g - Replace all occurrences of str1 with str2

Copying Text

yy - Copy a line to the buffer

nyy - Copy an n number of lines to the buffer

P - Paste text from the buffer above current line

p - Paste text from the buffer below current line

Changing Text

r - Mark a single character for replacement

R - go into over-write mode

cw - Mark a word for changing

cc - Mark a line for changing

~ - Change the case of the current letter

Miscellaneous Commands

J - Join a line with the one below it

!cmd - Execute a Unix command

:r - file Read a file into vi

:r!(cmd) - Inserts the results of a Unix command

. - Repeat the last command

u - Undo the last command/change

<ctrl>v - Insert non-printing control character

<ctrl>g - Show filename and current line

Saving and Exiting

:w - Write (save) the file

:w! - Force overwrite

:wq - Write (save) and quit the editor

:q! - Quit the file without saving changes

ZZ - Write (save) the file and quit vi

:n,mwfile write lines numbered n through m to file

:n,mw>>file append lines numbered n through m to end of file

Deleting Text

x - Delete a single character

dw - Delete a word

dd - Delete an entire line

ndd - Delete an n number of lines

d$ or D - Delete from the cursor to the end of the line

Entering vi

vi filename(s) - edit a file or files

vi -r filename - retrieve saved version of file after crash

vi -x filename - edit encrypted file

vi -wn filename - set default window size to n

Setting Options

Options are either toggled on and off, or given values. When editing, set options for a file with the set command.

:set all - displays all option settings on your terminal

:set - displays settings set by any current changes

:set option - sets option

:set option=n - sets option and assigns it the value of n

:set nooption - unsets option

:set option? - displays setting of option on status line

Option Name Default What Option Does
autoindent(ai) noai provides automatic indentation during text entry
autowrite(aw) noaw automatically saves file (write) before searches, control codes, sh escapes
ignorecase(ic) noic ignore case during searchs
number(nu) nonu show line numbers
readonly(ro) noro make file status read only
redraw(re) nore simulate smart terminal
showmatch(sm) nosm show matching ( or { when ) or } is entered
term $TERM name of terminal being used
warn warn warn if no write before !cmd

http://www.talug.org

源码下载地址: https://pan.quark.cn/s/a4b39357ea24 谷歌公司设计了一款无费用且具备开源特性的网络浏览器,名为Chrome,因其卓越的速度、稳定性和安全性而广受赞誉。该浏览器运用了前沿的Web渲染引擎Blink以及JavaScript引擎V8,旨在保障网页载入与脚本运行的卓越效能。为应对无网络环境下的Chrome安装需求,特别准备了离线安装包。此压缩文件内含32位与64位两种规格的Chrome浏览器离线安装方案,具体文件名分别为"chromedev_x64-v68.0.3423.2.exe"与"chromedev_x86-v68.0.3423.2.exe"。在文件命名中,"x64"标识64位版本,适用于64位操作系统平台,而"x86"则对应32位版本,适配32位操作系统。文件名中的"v68.0.3423.2"代表Chrome的一个特定版本号,各版本可能涵盖安全补丁、性能改进或新增功能。与32位Chrome相比,64位版本具备如下长处:能够处理更多内存容量,从而提升多任务作业能力;针对现代硬件的优化使其运行更为迅猛;64位版本更具备高级别的安全防护,能更周全地抵御恶意软件的侵袭。尽管如此,32位版本对于仍在使用32位操作系统的用户,或是在系统资源需求不高的场景下,依然适用。在部署Chrome浏览器时,用户需依据其个人计算机的操作系统平台,挑选匹配的版本进行安装。通过双击相应的.exe文件,安装流程将自动启动,一般包含接受使用许可、确定安装路径及构建桌面快捷方式等环节。若在安装阶段遭遇难题,可参照提示信息或联系技术支援获取协助,同时该压缩文件发布者亦表明欢迎用户以留言形式反映问题。Chrome浏览器的主要特质涵盖:直观的用户界面设计...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值