mirror of
https://github.com/vim/vim
synced 2025-07-15 16:51:57 +00:00
runtime(tutor): apply fixes to runtime/tutor/tutor2
- Fix minor typos and formatting - Restore accidentally removed file - Normalize <C-r> to <CTRL-R> - Apply reviewer suggestions related: #17546 Co-authored-by: Christian Brabandt <cb@256bit.org> Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5e35184241
commit
30dcd0e1fd
@ -6,7 +6,7 @@
|
||||
|
||||
Hic Sunt Dracones: if this is your first exposure to vim and you
|
||||
intended to avail yourself of the introductory chapter, kindly type
|
||||
:q<enter> and try again.
|
||||
:q!<ENTER> and run vimtutor for Chapter 1 instead.
|
||||
|
||||
The approximate time required to complete this chapter is 8-10 minutes,
|
||||
depending upon how much time is spent with experimentation.
|
||||
@ -23,14 +23,14 @@
|
||||
|
||||
MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord
|
||||
|
||||
3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co<enter>)
|
||||
3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co<ENTER>)
|
||||
and type "byiw
|
||||
|
||||
4. Navigate to any point on the word 'Vince' and type ciw<C-r>a<ESC>
|
||||
4. Navigate to any point on the word 'Vince' and type ciw<CTRL-R>a<ESC>
|
||||
|
||||
MNEMONIC: (c)hange (i)nner (w)ord with <contents of (r)egister> named (a)
|
||||
|
||||
5. Navigate to any point on the word 'cake' and type ciw<C-r>b<ESC>
|
||||
5. Navigate to any point on the word 'cake' and type ciw<CTRL-R>b<ESC>
|
||||
|
||||
---> a) Edward will henceforth be in charge of the cookie rations
|
||||
b) In this capacity, Vince will have sole cake discretionary powers
|
||||
@ -40,8 +40,8 @@ NOTE: Delete also works into registers, i.e. "sdiw will delete the word under
|
||||
|
||||
REFERENCE: Registers :h registers
|
||||
Named Registers :h quotea
|
||||
Motion :h motion.txt<enter> /inner<enter>
|
||||
CTRL-R :h insert<enter> /CTRL-R<enter>
|
||||
Motion :h motion.txt<ENTER> /inner<ENTER>
|
||||
CTRL-R :h insert<ENTER> /CTRL-R<ENTER>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -54,10 +54,10 @@ REFERENCE: Registers :h registers
|
||||
|
||||
2. Navigate to any point on the supplied number
|
||||
|
||||
3. Type ciw<C-r>=60*60*24<enter>
|
||||
3. Type ciw<CTRL-R> followed by =60*60*24<ENTER>
|
||||
|
||||
4. On the next line, enter insert mode and add today's date with
|
||||
<C-r>=system('date')<enter>
|
||||
<CTRL-R> followed by =system('date')<ENTER>
|
||||
|
||||
NOTE: All calls to system are OS dependent, e.g. on Windows use
|
||||
system('date /t') or :r!date /t
|
||||
@ -79,7 +79,7 @@ REFERENCE: Expression Register :h quote=
|
||||
|
||||
1. Move the cursor to the line below marked --->
|
||||
|
||||
2. yank the zeroth line, then inspect registers with :reg<enter>
|
||||
2. yank the zeroth line, then inspect registers with :reg<ENTER>
|
||||
|
||||
3. delete line 0. with "cdd, then inspect registers
|
||||
(Where do you expect line 0 to be?)
|
||||
@ -118,7 +118,7 @@ REFERENCE: Numbered Registers :h quote0
|
||||
NOTE: a common conundrum when coding is moving around large chunks of code.
|
||||
The following technique helps avoid number line calculations associated
|
||||
with operations like "a147d or :945,1091d a or even worse using
|
||||
i<C-r>=1091-945<enter> first
|
||||
i<CTRL-R> followed by =1091-945<ENTER> first
|
||||
|
||||
1. Move the cursor to the line below marked --->
|
||||
|
||||
@ -172,9 +172,11 @@ REFERENCE: Marks :h marks
|
||||
3. Change a whole word from anywhere within a word: ciw
|
||||
4. Insert text directly from registers in insert mode: (C-r)a
|
||||
|
||||
5. Insert the results of simple arithmetic operations: (C-r)=60*60<enter>
|
||||
5. Insert the results of simple arithmetic operations: <CTRL-R> followed by
|
||||
=60*60<ENTER>
|
||||
in insert mode
|
||||
6. Insert the results of system calls: (C-r)=system('ls -1')
|
||||
6. Insert the results of system calls: <CTRL-R> followed by
|
||||
=system('ls -1')<ENTER>
|
||||
in insert mode
|
||||
|
||||
7. Inspect registers with :reg
|
||||
|
Reference in New Issue
Block a user