编辑利器 vim 培训笔记--入门好帮手

转载地址:

https://github.com/shawncplus/vim-classes

没搞明白,为什么vim.org不能直接访问,就是一个编辑器啊。

Joy of Painting[1] with Bob Ross[2]

[1] - Vim
[2] - Shawn Biddle

Modality

三种模式:插入,浏览,命令。
Insert  - Brush is on the canvas
Normal  - Brush is off the canvas
Command - Mixing your pallette

Starting Vim

vim <file>
vim, :e <file>  #已经进入vim, 输入 :e 文件名, 编辑文件。

Pen to the page

i - Enter insert mode at cursor
I - Enter insert mode at first non-blank character
s - Delete character under cursor and enter insert mode
S - Delete line and begin insert at beginning of same line
a - Enter insert mode _after_ cursor
A - Enter insert mode at the end of the line
o - Enter insert mode on the next line
O - enter insert mode on the above line
C - Delete from cursor to end of line and begin insert

This is a test sentence

(Next class will cover 'c')

Picking up the brush

回到浏览模式按下面两个之一
ESC
Ctrl+[

Scanning the canvas

移动:上下左右
    k
    ^
h <   > l
    v
    j

"Why hjkl and not jkl;?"

Because go to the next class

"They invented the mouse, why not use that?"

La la la la, I can't hear you

Getting from a to b: Motions

Basics: wWbBeE

w - Forward to the beginning of next word
W - Forward to the beginning of the next WORD
b - Backward to the next beginning of a word
B - Backward to the next beginning of a WORD
e - Forward to the next end of word
E - Forward to the next end of WORD

Slightly less basic: fFtT All follow [(n)um] syntax

[n]f<o> - Forward until (nth) (o)  (Inclusive)
[n]F<o> - Backward until (nth) (o) (Inclusive)
[n]t<o> - Forward until (nth) (o)  (Exclusive)
[n]T<o> - Backward until (nth) (o) (Exclusive)

abcdefg, abcdefg, abcdefg

Searching

/  - Forward
?  - Backward
*  - Word under cursor - forward  (bounded)
g* - Word under cursor - forward  (unbounded)
#  - Word under cursor - backward (bounded)
g# - Word under cursor - backward (unbounded)
n  - Next result, forward
N  - Next result, backward

(Note here to explain what bounded/unbounded mean)

Copy/Paste

y - Yank. Example: yw (yank word)
p - paste after cursor
P - paste before cursor

vim: set syn=mkd :

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值