Vim工具使用备忘

intent                              Act                     Repeat  Reverse
Make a change                       {edit}                  .       u
Scan line for next character        f{char}/ t{char}        ;       ,
Scan line for previous character    F{char}/ T{char}        ;       ,
Scan document for next match        /pattern<CR>            n       N
Scan document for previous match    ?pattern<CR>            n       N
Perform substitution                :s/target/replacement   &       u
Execute a sequence of changes       qx{changes}q            @x      u

*   匹配当前选中的单词
:h  key-notation 查看组合键位的用途

Keystrokes  Effect
<Esc>       Switch to Normal mode
<C-[>       Switch to Normal mode
<C-o>       Switch to Insert Normal mode
<c-r>       粘贴内容,insert mode
<c-v>code   插入编码代表的字符
ga          显示当前字符的编码

Command Effect
<Esc>   Switch to Normal mode
v       Enable character-wise Visual mode
V       Enable line-wise Visual mode
<C-v>   Switch to block-wise Visual mode
gv      Reselect the last visual selection
o       Go to other end of highlighted text

Symbol  Address
1       First line of the file
$       Last line of the file
0       Virtual line above first line of the file
.       Line where the cursor is placed
‘m      Line containing mark m
‘<      Start of visual selection
‘>      End of visual selection
%       The entire file (shorthand for :1,$)
@:      repeat the ex commands

Command     Effect
<C-w>s      Split the current window horizontally
<C-w>v      Split the current window vertically
:sp {file}  Split the current window horizontally
:vsp        Split the current window vertically

Command Effect
<C-w>w  Cycle between open windows
<C-w>h  Focus the window to the left
<C-w>j  Focus the window below
<C-w>k  Focus the window above
<C-w>l  Focus the window to the right

Ex              Command Normal Command Effect
:cl[ose] <C-w>c Close the active window
:on[ly] <C-w>o  Keep only the active window, closing all others

Keystrokes  Buffer Contents
<C-w>=      Equalize width and height of all windows
<C-w>_      Maximize height of the active window
<C-w>|      Maximize width of the active window
[N]<C-w>_   Set active window height to [N] rows
[N]<C-w>|   Set active window width to [N] columns

Command         Effect
<C-w>T          Move the current window into its own tab
:tabc[lose]     Close the current tab page and all of its windows
:tabo[nly]      Keep the active tab page, closing all others
:tabe[dit] {file}   Open {filename} in a new tab

Ex                      Command Normal Command Effect
:tabn[ext] {N} {N}gt    Switch to tab page number {N}
:tabn[ext] gt           Switch to the next tab page
:tabp[revious] gT       Switch to the previous tab page

Command Move cursor
h       One column left
l       One column right
j       One line down
k       One line up

Keystrokes  Buffer Contents
iw          Current word
aw          Current word plus one space
iW          Current WORD
aW          Current WORD plus one space
is          Current sentence
as          Current sentence plus one space
ip          Current paragraph
ap          Current paragraph plus one blank line

Command             Effect
[count]G            Jump to line number
%                   Jump to matching parenthesis
(/)                 Jump to start of previous/next sentence
{/}                 Jump to start of previous/next paragraph
H/M/L               Jump to top/middle/bottom of screen
gf                  Jump to file name under the cursor
<C-]>               Jump to definition of keyword under the cursor
’{mark} / `{mark}   Jump to a mark
//pattern <CR> /?pattern <CR> / n / N   Jump to next/previous occurrence of pattern

Register    Contents
"_          black hole register
"+          system clipboard
"*          selection registers
"%          Name of the current file
"#          Name of the alternate file
".          Last inserted text
":          Last Ex command
"/          Last search pattern

时间: 2024-08-24 11:59:54

Vim工具使用备忘的相关文章

【Tool】BT5工具集备忘

backtrack5?工具集 1 Information Gathering 1.1? ?? ?? ?Network Analysis 1.1.1? ? DNS Analysis 1.1.1.1? ?Dnsdict6 1.1.1.2? ?Dnsenum 1.1.1.3? ?Dnsmap 1.1.1.4? ?Dnsrecon 1.1.1.5? ?Dnstracer 1.1.1.6? ?Dnswalk 1.1.1.7? ?Fierce 1.1.1.8? ?Lbd 1.1.1.9? ?Maltego

vim替换指令备忘

1.  替换当前行中的内容: :s/from/to/    (s即substitude) :s/from/to/     :  将当前行中的第一个from,替换成to.如果当前行含有多个 from,则只会替换其中的第一个. :s/from/to/g    :  将当前行中的所有from都替换成to. :s/from/to/gc   :  将当前行中的所有from都替换成to,但是每一次替换之前都 会询问请求用户确认此操作. 注意:这里的from和to都可以是任何字符串,其中from还可以是正则表

vim visual操作备忘

visual模式下: jkl选中行 "+y 复制选中行 版权声明:本文为博主原创文章,未经博主允许不得转载.

我的acm vim 备忘

一.從命令到編輯模式 a :当前单词后面插入Appendi :当前位置插入Inserto :当前行下新开一行插入Open new lineA :当前行尾插入AppendI :当前行首插入InsertO :当前行上新开一行插入Open new line比較常用就是i,a,o,I,A,O了,將來多試幾次就好了,就很熟悉了. 二.從編輯到命令ESC : ctrl+[ :能起到一样的效果,手指短的同学可以用它代替esc. 三.命令模式中的其他命令在命令模式中的按鍵就很多了,這些介绍参加高速编程基本要用到

linux下常用命令备忘

转自:Linux 命令集锦 linux下查看监听端口对应的进程 # lsof -i:9000 # lsof -Pnl +M -i4 如果退格键变成了:"^h". 终端连接unix删除退格键,按住CTL键同时按delete Linux搜索 # find / -name "xxx.conf" 查看linux是32位还是64位的命令 #file /sbin/init #getconf LONG_BIT #getconf -a 在Linux和Windows下都可以用nslo

mysql 常用命令(备忘)

1:使用SHOW语句找出在服务器上当前存在什么数据库:mysql> SHOW DATABASES; 2:2.创建一个数据库MYSQLDATAmysql> CREATE DATABASE MYSQLDATA;3:选择你所创建的数据库 mysql> USE MYSQLDATA; (按回车键出现Database changed 时说明操作成功!) 4:查看现在的数据库中存在什么表mysql> SHOW TABLES;5:创建一个数据库表mysql> CREATE TABLE MYT

Cheat—— 给Linux初学者和管理员一个终极命令行&quot;备忘单&quot;

编译自:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/作者: Avishek Kumar原创:LCTT https://linux.cn/article-3760-1.html译者: su-kaiyao原文稍有改动 当你不确定你所运行的命令,尤其是那些使用了许多选项的复杂命令时,你会怎么做?在这种情况下,我们使用man pages来获取帮助.还有一些其它的选择可能包括像‘help’,‘whereis’和

调试android chrome web page简明备忘

必备工具 adb tools.android chrome 先开启手机调试模式 adb forward tcp:9919 localabstract:chromedevtoolsremote 成功会提示 * daemon not running. starting it now on port 5037 * * daemon started successfully * 不成功的话用这个命令再试 adb kill-server 接着打开下面的链接,这里的9919是上面adb命令中指定的 http

[备忘] Automatically reset Windows Update components

这两天遇到Windows 10的更新问题,官方有一个小工具,可以用来修复Windows Update的问题,备忘如下 https://support.microsoft.com/en-us/kb/971058 To automatically reset Windows Update components, run the appropriate Windows Update diagnostic, and then follow the on-screen instruction. Windo