vim
一个有趣的idea
programming vim through its interface
vim接口(interfaces)自身就是一个编程语言
我们可以组合多种按键以达到难以置信的effect
一旦形成肌肉记忆,我们就能以思考的速度来编辑文件!
vim模式
- normal
- insert
- replace
- visual
- plain
- line
- block
- command-line
vim基础
navigation
w
move the cursor foward by one wordb
move the cursor backward by one worde
move to the end of the word0
move to the begin of the line$
move to the end of the line^
move to the first non-empty word of the linectrl-D
scroll downctrl-U
scroll upG
move to the end of the buffergg
move to the begin of the bufferL
move the cursor to the lowest line shown on the screenM
move the cursor to the middle line shown on the screenH
move the cursor to the highest line shown on the screenf+charactor
find(and move the cursor on top of it) the first charactor of the line after the cursorF+charactor
find (and move the cursor on top of it) the first charactor of the line before the cursort/T
works same but stop until it finds the charactor%
jump between pairs like ([],{}, …)
edition
o
open a new line below the cursorO
open a new line above the cursord + movement key
only deletec + movement key
delete and change
select, copy & paste
v & motion key
selectV & motion key
select linesctrl-V & motion key
select rectangle region of texty + motion key
copy
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.