vim
一个有趣的idea
programming vim through its interface
vim接口(interfaces)自身就是一个编程语言
我们可以组合多种按键以达到难以置信的effect
一旦形成肌肉记忆,我们就能以思考的速度来编辑文件!
vim模式
- normal
- insert
- replace
- visual
- plain
- line
- block
- command-line
vim基础
navigation
wmove the cursor foward by one wordbmove the cursor backward by one wordemove to the end of the word0move to the begin of the line$move to the end of the line^move to the first non-empty word of the linectrl-Dscroll downctrl-Uscroll upGmove to the end of the bufferggmove to the begin of the bufferLmove the cursor to the lowest line shown on the screenMmove the cursor to the middle line shown on the screenHmove the cursor to the highest line shown on the screenf+charactorfind(and move the cursor on top of it) the first charactor of the line after the cursorF+charactorfind (and move the cursor on top of it) the first charactor of the line before the cursort/Tworks same but stop until it finds the charactor%jump between pairs like ([],{}, …)
edition
oopen a new line below the cursorOopen a new line above the cursord + movement keyonly deletec + movement keydelete and change
select, copy & paste
v & motion keyselectV & motion keyselect linesctrl-V & motion keyselect rectangle region of texty + motion keycopy
counts
digit + command表示重复做几次某条命令
modifier
d & i & [delete things in []c & i & [delete things in [] and changed & a & [delete things in [] (include [])
vim控制命令
:help + key(命令)
查看key或命令的用途(帮助文档)
:qa
退出全部打开的文件
Buffers、Tabs、Windows
buffers又叫打开的文件,在vim中打开的文件与windows没有一对一的对应关系。这样有好处,可以同时看同一个文件的两个不同位置的内容
window
- 打开一个Window
:sp
tab
- 打开一个Tab
:tabnew - 在tab间切换
gt
- Post title:MIT课程笔记: Notes on Missing semester 02
- Post author:sixwalter
- Create time:2023-08-05 11:14:26
- Post link:https://coelien.github.io/2023/08/05/course-learning/MIT-Missing-Semester/note02-vim/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.