晚上回来之后闲来无事,东翻翻西翻翻的,找到了之前下载的一篇《Vim tutorial》,发现了一些自己之前没怎么注意到的命令,值得学习,就此记录一下:
CTRL-F #向下翻一页
CTRL-B #向上翻一页
CTRL-D #向下翻半页
CTRL-U #向上翻半页
{ #Go to the beginning of current paragraph
} #Go to the beginning of next paragraph
( #Go to the beginning of previous sentence
) #Go to the beginning of next sentence
% #Jump to the matching {..} or (..)
w #Go to the beginning of next word
W #Go to the beginning of next WORD
e #Go to the end of current word
E #Go to the end of current WORD
b #Go to the beginning of previous word
B #Go to the beginning of previous WORD
0 #(zero) Go to the starting of current line
$ #(dollar) Go to the end of current line
H #Go to the first line of current screen
M #Go to the middle line of current screen
L #Go to the last line of current screen
zz #Redraw the screen with the current line under the cursor at the middle of the screen
:jumps #view the jump list
CTRL-O #Jump back to previous spot
CTRL-I #Jump forward to next spot
gf #Go to file(跳转至光标所在处文件)
CTRL-W gf #Go to file with open new tab
gg=G #format the entire buffer(格式化常用)
:g/PATTERN/d #Delete the line which has a specific pattern
:v/PATTERN/d #Delete the line which doesn’t has a specific pattern{非常有用}
:g/^$/,/./-j #Reduce multiple blank lines into a single blank line
:g/^/m0 #Reverse a file{将文件内容的所有行反转了,类似于tac命令}
《 “Vim操作练习” 》 有 3 条评论
有关vi(vim)的常用命令
https://mp.weixin.qq.com/s/zZAWpZbDtSFK6EROxaBRKw
https://www.vpser.net/manage/vi.html
学习 Vim 的命令行游戏
https://vim-adventures.com/
vim 使用宏实现批量骚操作[视频]
https://zhuanlan.zhihu.com/p/40804724
有哪些编程必备的 Vim 配置?
https://www.zhihu.com/question/19989337
学会了 Vim 还有必要用 GitHub Atom 或者 Sublime Text 吗?
https://www.zhihu.com/question/22904741/answer/23066711
用 Vim 写 Python 的最佳实践是什么?
https://www.zhihu.com/question/19655689
Vim 实用插件推荐(2017)
https://zhuanlan.zhihu.com/p/24742679