User:Ssstephen/prototype/20240610: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "Its the last day of prototyping so I want to learn vim. Riviera says just type vim tutor but spoken language is hard so I made a file called tutor by accident. Then you need to press :qa to get out. Then I types vimtutor and I can do the tutorial. letters hjkl to move around. :q! is the same as :qa is the same as :q ? I think I dont know difference yet. Maybe something to do with saving. This quits without writing. x is delete i is insert (ESC to exit...")
 
No edit summary
Line 20: Line 20:


  x
  x
is delete
delete character


  i
  i
Line 30: Line 30:
  :wq
  :wq
write and quit
write and quit
dw
delete word (til start of next word)
d$
delete to end of line
de
delete to end of word
operators and motions. d is the delete operator, w (until start of next word), e (until end of current word) and $ (until end of line) are motions.
3w
Typing only a motion (or a multiple of it by putting a number before) moves the cursor by that distance
0
go to start of line. oh this is fun I like it.
dd
delete line
2dd
d2d
both delete two lines.
u
undo
U
undo all changes to most recently changed line
CTRL-R
redo

Revision as of 08:47, 10 June 2024

Its the last day of prototyping so I want to learn vim.

Riviera says just type

vim tutor 

but spoken language is hard so I made a file called tutor by accident. Then you need to press

:qa 

to get out. Then I types

vimtutor

and I can do the tutorial.


letters hjkl to move around.

:q!

is the same as

:qa

is the same as

:q 

? I think I dont know difference yet. Maybe something to do with saving. This quits without writing.

x

delete character

i

is insert (ESC to exit insert mode)

A

append

:wq

write and quit

dw

delete word (til start of next word)

d$

delete to end of line

de

delete to end of word

operators and motions. d is the delete operator, w (until start of next word), e (until end of current word) and $ (until end of line) are motions.

3w

Typing only a motion (or a multiple of it by putting a number before) moves the cursor by that distance

0

go to start of line. oh this is fun I like it.

dd

delete line

2dd
d2d

both delete two lines.

u

undo

U

undo all changes to most recently changed line

CTRL-R

redo