`
dengyin2000
  • 浏览: 1219063 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Basic VI comannd.

阅读更多
Basic VI command - VI Shortcut Keys



Enter Text


i Insert text left of cursor

a Append text right of cursor



Editing Text


x Delete selected character

nx Delete n characters from selected characters

X Delete all character before cursor

dw Delete word

ndw (eg 3dw) Delete n words

dd Delete line

ndd Delete n lines

D Delete characters from cursor to end of line

r Replace character under cursor

cw Replace a word

ncw Replace n words

C Change text from cursor to end of line

o Insert blank line below cursor (ready for insertion)

O Insert blank line above cursor (ready for insertion)

J Join succeeding line to current cursor line

nJ Join n succeeding lines to current cursor line

u Undo last change

U Restore current line



Navigating Text


H Move left one space

j Move down one line

k Move up one line

l Move right one space

w Forward word by word

b Backward word by word

$ Moveto end of line

0 (zero) Move to beginning of line

H Move to top line of screen

M Move to middle line of screen

L Move to last line of screen

G Move to last line of file

1G Move to first line of file

<Control>f Scroll forward one screen

<Control>b Scroll backward one screen

<Control>d Scroll down one-half screen

<Control>u Scroll up one-half screen

n Repeat last search in same direction

N Repeat last search in opposite direction



Save and Close File


ZZ Save file and then quit

:w Save file

:q! Discard changes and quit file
Search & Replace


/i Search for a pattern which will you take you to the next occurrence of it.

?i Search for a pattern which will you take you to the previous occurrence of it.

* Go to the next occurrence of the current word under the cursor.

# Go to the previous occurrence of the current word under the cursor.

% Go to the matching braces, or parenthesis inside code.

:s/searchStr/newStr/g Search and replace all occurrences of searchStr in a line

:s/searchStr/newStr/gi Search and replace all occurrences of searchStr in a line (case insensative)

:%s/searchStr/newStr/g Search all lines and replace all occurrences of searchStr in a line with newStr

:%s/searchStr/newStr/gc Search and replace all occurrences of searchStr in all lines interactively. It will highlight the search string and ask you to replace it or move to next search string

参考:http://feeds.dzone.com/~r/dzone/frontpage/~3/EN-VW-Kui1k/getting_back_to_vi_editor.html

http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know
分享到:
评论

相关推荐

    最新 instantclient-basic-linux.x64-11.2.0.4.0

    最新 instantclient-basic-linux.x64-11.2.0.4.0最新 instantclient-basic-linux.x64-11.2.0.4.0最新 instantclient-basic-linux.x64-11.2.0.4.0最新 instantclient-basic-linux.x64-11.2.0.4.0最新 instantclient-...

    jpgc-graphs-basic-2.0.zip

    将 jpgc-graphs-basic-2.0.zip 解压缩后只有一个 lib 目录,该目录下有一个 ext 文件夹和一个 jmeter-plugins-cmn-jmeter-0.3.jar 包,ext 文件夹中有 jmeter-plugins-graphs-basic-2.0.jar 和 jmeter-plugins-...

    confd-basic-7.6.linux.x86_64

    1. 解压 sh confd-basic-7.6.linux.x86_64.installer.bin /home/tmpconfd 2. 编译crypto.so 修改 confd-basic-7.6.linux.x86_64/confd-basic-7.6/libconfd/src/include.mk cd confd-basic-7.6.linux.x86_64/confd-...

    instantclient-basic-windows.x64-12.2.0.1.0.zip

    instantclient-basic-windows.x64-12.2.0.1.0,免去安装本地oracle数据库,配合第三方连接工具(如navicat for oracle)简单配置即可连接上项目开发库。 关于 Navicat 连接Oracel出现 probable Oracel ...

    instantclient-basic-windows.x64-11.2.0.4.0.zip

    instantclient-basic-windows.x64-11.2.0.4.0.zip,Oracle1164位官方客户端,可用于本地电脑未安装数据库的情况下,PLSQL连接Oracle数据库,注意,PLSQL也需要是64位版本的,客户端版本为11.2.0.4.0

    instantclient-basic-windows.x64-19.8.0.0.0dbru

    instantclient-basic-windows.x64-19.8.0.0.0dbru 是 Oracle 数据库 Instant Client 的一个特定版本和配置的下载包名称。 Instant Client:Oracle Instant Client 是一个轻量级的客户端库,它允许应用程序连接到...

    instantclient-basic-windows.x64-11.2.0.4.0

    这个版本,"instantclient-basic-windows.x64-11.2.0.4.0",是专为64位Windows系统设计的,提供基础的数据库访问功能,包括SQL*Plus、OCI(Oracle Call Interface)和TNS(Transparent Network Substrate)。...

    instantclient-basic-windows.x64-12.1.0.2.0.zip

    标题中的"instantclient-basic-windows.x64-12.1.0.2.0.zip"指的是Oracle Instant Client的基础版,适用于64位的Windows操作系统,版本号为12.1.0.2.0。 **Oracle Instant Client的组成部分** Oracle Instant ...

    instantclient-basic-linux.x64-21.1.0.0.0.zip

    标题 "instantclient-basic-linux.x64-21.1.0.0.0.zip" 提供的信息表明,这是一个Oracle数据库的即时客户端(Instant Client)的压缩包,适用于64位的Linux操作系统,版本号为21.1.0.0.0。这个客户端是Oracle公司...

    instantclient-basic-windows.x64-19.10.0.0.0dbru.zip

    navicat 链接 oracle 数据库oci.dll 版本,这是 instantclient for windows x64的配置文件,【instantclient-basic-windows.x64-19.10.0.0.0dbru.zip】

    instantclient-basic-windows.x64-12.1.0.2.0 解决Navicat 15 64位 连Oracle 11.2.0.4

    适合最新Navicate 15 64位使用,解决连接Oracle 11g 64位时 Oracle library is not loaded,经测试instantclient-basic-windows.x64-11.2.0.4.0死活连接不上 不要被误导。换12.1完美解决。 32位的navicate 可以用...

    oracle数据库客户端 instantclient-basic-windows.x64-19.19.0.0.0dbru

    在本例中,我们讨论的是"Instant Client"的Windows 64位版本,具体为`instantclient-basic-windows.x64-19.19.0.0.0dbru`。 1. **Oracle Instant Client**: 这是Oracle公司提供的一种快速部署的客户端软件,它包括...

    oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm

    sudo alien -i /home/ubuntu/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm sudo alien -i /home/ubuntu/oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm sudo alien -i /home/ubuntu/oracle-instant...

    oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

    1.1 下载以rpm后缀名的包,以11.2.0.4.0 版本为例,其中基础包basic、sql*plus、devel包建议默认下载,其他包视情况而定: oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm --基础包,为了运行OCI、OCCI、...

    kubeadm-basic.images.tar.gz

    安装kubeadm时,需要登录到google才能下载google镜像,由于国内不能登录google,所以上传google的镜像

    oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64 rpm包合集

    oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm

Global site tag (gtag.js) - Google Analytics