Vim multi-line cut, copy, and delete

/etc/vimrc

increase

: set number ---------------- set the display line number
set tabstop = 4 --------------- tab key is set to 4 spaces
set cursorline --------------- set underscore

/ Xxx ------------------- highlight xxx

: Noh ------------------- canceled highlighted

Shear

Shortcuts way:

dd:剪切光标所处当前行
n + dd:剪切光标所在行及以下共 n 行
按 p 粘贴在光标所在行

Command line:

例如剪切1到10行,并粘贴在12行处:
1,10 m 12

copy

Shortcuts way:

yy:复制光标所处当前行
n + yy:复制光标所在行及以下共 n 行
按 p 粘贴在光标所在行

Command line:

例如复制1到10行,并粘贴在12行处:
1,10 co 12

delete

Shortcuts way:

dd:删除光标所处当前行
n + dd:删除光标所在行及以下共 n 行

Command line:

例如删除1到10行:
1,10 de

Enter the command line

"shift + :" :进入命令行模式
"set nu" :显示行号
"etc + etc" :退出命令行模式

Under actual conditions, when you press p to paste some cases is attached to the next line cursor, under their own operations can be known.

 

shift + ZZ: Save and exit vim.

Released nine original articles · won praise 1 · views 6687

Guess you like

Origin blog.csdn.net/u014426028/article/details/103434393