annotate runtime/tutor/tutor.ca @ 2069:63613d8d7e4d v7.2.354

updated for version 7.2.354 Problem: Japanese single-width double-byte characters not handled correctly. Solution: Put 0x8e in ScreenLines[] and the second byte in ScreenLines2[]. (partly by Kikuchan)
author Bram Moolenaar <bram@zimbu.org>
date Wed, 03 Feb 2010 15:48:04 +0100
parents 3fc0f57ecb91
children 4f7081eb1e26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 ===============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 = B e n v i n g u t s a l t u t o r d e l V I M - Versió 1.5 =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 ===============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 El Vim és un editor molt potent que té moltes ordres, masses com per
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 explicar-les totes un tutor com aquest. Aquest tutor està dissenyat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 per descriure les ordres bàsiques que us permetin fer servir el Vim com
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 a editor de propòsit general.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 El temps aproximat de seguir el tutor complet és d'uns 25 o 30 minuts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 depenent de quant temps dediqueu a experimentar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 Feu una còpia d'aquest fitxer per practicar-hi (si heu començat amb el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 programa vimtutor això que esteu llegint ja és una còpia).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 És important recordar que aquest tutor està pensat per ensenyar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 practicant. És a dir, que haureu d'executar les ordres si les voleu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 aprendre. Si només llegiu el text el més probable és que les oblideu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 Ara assegureu-vos que la tecla de bloqueig de majúscules no està
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 activada i premeu la tecla j per moure el cursor avall, fins que
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 la lliçó 1.1 ocupi completament la pantalla.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 Lliçó 1.1: MOURE EL CURSOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 ** Per moure el cursor premeu les tecles h,j,k,l tal com està indicat. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 ^
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 k Pista: La h és a l'esquerra i mou el cursor cap a l'esquerra.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 < h l > La l és a la dreta i mou el cursor cap a la dreta.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 j La j sembla una fletxa cap avall.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 1. Moveu el cursor per la pantalla fins que us sentiu confortables.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 2. Mantingueu premuda la tecla avall (j) una estona.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 ---> Ara sabeu com moure-us fins a la pròxima lliçó.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 3. Usant la tecla avall, aneu a la lliçó 1.2.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 Nota: Si no esteu segurs de la tecla que heu premut, premeu <ESC> per tornar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 al mode Normal. Llavors torneu a teclejar l'ordre que volíeu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però usant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 hjkl anireu més ràpid, quan us hi hàgiu acostumant.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 Lliçó 1.2: ENTRAR I SORTIR DEL VIM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 !! NOTA: Abans de seguir els passos següents llegiu *tota* la lliçó!!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 1. Premeu <ESC> (per estar segurs que esteu en el mode Normal).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 2. Teclegeu: :q! <ENTRAR>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 ---> Amb això sortireu de l'editor SENSE desar els canvis que hàgiu pogut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 fer. Si voleu desar els canvis teclegeu:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 :wq <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 3. Quan vegeu l'introductor de la shell escriviu l'ordre amb la qual heu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 arribat a aquest tutor. Podria ser: vimtutor <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 O bé: vim tutor <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 ---> 'vim' és l'editor vim, i 'tutor' és el fitxer que voleu editar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 4. Si heu memoritzat les ordres, feu els passos anteriors, de l'1 al 3,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 per sortir i tornar a entrar a l'editor. Llavors moveu el cursor avall
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 fins la lliçó 1.3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 Lliçó 1.3: EDITAR TEXT - ESBORRAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 ** En mode Normal premeu x per esborrar el caràcter de sota el cursor. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 1. Moveu el cursor fins la línia que hi ha més avall marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 2. Poseu el cursor a sobre el caràcter que cal esborrar, per corregir els
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 errors.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 3. Premeu la tecla x per esborrar el caràcter.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 ---> Unna vaaca vva salttar sobbree la llluna.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 5. Ara que la línia és correcta, aneu a la lliçó 1.4.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 Lliçó 1.4: EDITAR TEXT - INSERIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 ** En mode Normal premeu i per inserir text. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 1. Moveu el cursor avall fins la primera línia marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 2. Per fer la primera línia igual que la segona poseu el cursor sobre el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 primer caràcter POSTERIOR al text que s'ha d'inserir.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 3. Premeu la tecla i i escriviu el text que falta.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 4. Quan hàgiu acabat premeu <ESC> per tornar al mode Normal. Repetiu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 els passos 2, 3 i 4 per corregir la frase.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 ---> Falten carctrs en aquesta .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 ---> Falten alguns caràcters en aquesta línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 5. Quan us trobeu còmodes inserint text aneu al sumari de baix.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 LLIÇÓ 1 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 1. El cursor es mou amb les fletxes o bé amb les tecles hjkl.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 h (esquerra) j (avall) k (amunt) l (dreta)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 2. Per entrar al Vim (des de la shell) escriviu: vim FITXER <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 3. Per sortir teclegeu: <ESC> :q! <ENTRAR> per descartar els canvis.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 O BÉ teclegeu: <ESC> :wq <ENTRAR> per desar els canvis.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 4. Per esborrar el caràcter de sota el cursor en el mode Normal premeu: x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 5. Per inserir text on hi ha el cursor, en mode Normal, premeu:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 i escriviu el text <ESC>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 NOTA: La tecla <ESC> us portarà al mode Normal o cancel·larà una ordre
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 que estigui a mitges.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 Ara continueu amb la lliçó 2.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 Lliçó 2.1: ORDRES PER ESBORRAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 ** Teclegeu dw per esborrar fins al final d'una paraula. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 1. Premeu <ESC> per estar segurs que esteu en mode normal.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 2. Moveu el cursor avall fins la línia marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 3. Moveu el cursor fins el principi de la paraula que s'ha d'esborrar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 4. Teclegeu dw per fer desaparèixer la paraula.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 NOTA: Les lletres dw apareixeran a la línia de baix de la pantalla mentre
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 les aneu escrivint. Si us equivoqueu premeu <ESC> i torneu a començar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 ---> Hi han algunes paraules divertit que no pertanyen paper a aquesta frase.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 la lliçó 2.2.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 Lliçó 2.2: MÉS ORDRES PER ESBORRAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 ** Escriviu d$ per esborrar fins al final de la línia. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 1. Premeu <ESC> per estar segurs que esteu en el mode Normal.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 2. Moveu el cursor avall fins a la línia marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 3. Moveu el cursor fins el final de la línia correcta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 (DESPRÉS del primer . ).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 4. Teclegeu d$ per esborrar fins al final de la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 ---> Algú ha escrit el final d'aquesta línia dos cops. línia dos cops.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 5. Aneu a la lliçó 2.3 per entendre què està passant.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 Lliçó 2.3: SOBRE ORDRES I OBJECTES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 El format de l'ordre d'esborrar d és el següent:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 [nombre] d objecte O BÉ d [nombre] objecte
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 On:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 nombre - és el nombre de cops que s'ha d'executar (opcional, omissió=1).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 d - és l'ordre per esborrar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 objecte - és la cosa amb la qual operar (llista a baix).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 Una petita llista d'objectes:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 w - des del cursor fins al final de la paraula, incloent-hi l'espai.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 e - des del cursor fins al final de la paraula, SENSE incloure l'espai.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 $ - des del cursor fins al final de la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 sense cap ordre, el cursor es mourà tal com està especificat a la
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 llista d'objectes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 Lliçó 2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 ** Teclegeu dd esborrar tota la línia. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 Com que molt sovint s'han d'eliminar línies senceres els dissenyadors del
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 Vi van creure que seria més fàcil teclejar dd per esborrar tota la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 1. Moveu el cursor a la segona línia de la frase de baix.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 2. Teclegeu dd per esborrar la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 3. Ara aneu a la quarta línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 4. Teclegeu 2dd per esborrar dues línies (recordeu nombre-ordre-objecte).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 1) Les roses són vermelles,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 2) El fang és divertit,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 3) Les violetes són blaves,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 4) Tinc un cotxe,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 5) Els rellotges diuen l'hora,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 6) El sucre és dolç,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 7) Igual que tu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 Lliçó 2.5: L'ORDRE DESFER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 ** Premeu u per desfer els últims canvis, U per arreglar tota la línia. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 1. Moveu el cursor sobre el primer error de línia de baix marcada amb --->
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 2. Premeu x per esborrar el caràcter no desitjat.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 3. Ara premeu u per desfer l'última ordre executada.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 4. Aquest cop corregiu tots els errors de la línia amb l'ordre x.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 5. Ara premeu U per restablir la línia al seu estat original.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 6. Ara premeu u uns quants cops per desfer U i les ordres anteriors.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 7. Ara premeu CONTROL-R (les dues tecles al mateix temps) uns quants cops
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 per refer les ordres.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 ---> Correegiu els errors d'aqquesta línia i dessfeu-los aamb desfer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 8. Aquestes ordres són molt útils. Ara aneu al sumari de la lliçó 2.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 LLIÇÓ 2 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 1. Per esborrar del cursor al final de la paraula teclegeu: dw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 2. Per esborrar del cursor al final de la línia teclegeu: d$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 3. Per esborrar una línia sencera teclegeu: dd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 4. El format de qualsevol ordre del mode Normal és:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 [nombre] ordre objecte O BÉ ordre [nombre] objecte
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 on:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 nombre - és quants cops repetir l'ordre
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 ordre - és què fer, com ara d per esborrar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 objecte - és amb què s'ha d'actuar, com ara w (paraula),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 $ (fins a final de línia), etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 5. Per desfer les accions anteriors premeu: u
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 Per desfer tots el canvis en una línia premeu: U
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 Per desfer l'ordre desfer premeu: CTRL-R
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 Lliçó 3.1: L'ORDRE 'POSAR'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 ** Premeu p per posar l'última cosa que heu esborrat després del cursor. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 1. Moveu el cursor a la primera línia de llista de baix.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 2. Teclegeu dd per esborrar la línia i desar-la a la memòria.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 3. Moveu el cursor a la línia ANTERIOR on hauria d'anar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 4. En mode Normal, premeu p per inserir la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 5. Repetiu els passos 2, 3 i 4 per ordenar les línies correctament.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 d) Pots aprendre tu?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 b) Les violetes són blaves,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 c) L'intel·ligència s'aprèn,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 a) Les roses són vermelles,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 Lliçó 3.2: L'ORDRE SUBSTITUIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 ** Premeu r i un caràcter per substituir el caràcter de sota el cursor. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 1. Moveu el cursor a la primera línia de sota marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 2. Moveu el cursor a sobre del primer caràcter equivocat.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 3. Premeu r i tot seguit el caràcter correcte per corregir l'error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 4. Repetiu els passos 2 i 3 fins que la línia sigui correcta.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 ---> Quen van escroure aquerta línia, algh va apretar tikles equivocades!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 ---> Quan van escriure aquesta línia, algú va apretar tecles equivocades!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 5. Ara continueu a la lliçó 3.2.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 NOTA: Recordeu que heu de practicar, no memoritzar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 Lliçó 3.3: L'ORDRE CANVIAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 ** Per canviar una part o tota la paraula, escriviu cw . **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 1. Moveu el cursor a la primera línia de sota marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 2. Poseu el cursor sobre la u de 'lughc'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 3. Teclegeu cw i corregiu la paraula (en aquest cas escriviu 'ínia'.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 4. Premeu <ESC> i aneu al següent error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 5. Repetiu els passos 3 i 4 fins que les dues frases siguin iguals.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 ---> Aquesta lughc té algunes paradskl que s'han de cdddf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 ---> Aquesta línia té algunes paraules que s'han de canviar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 Noteu que cw no només canvia la paraula, també us posa en mode d'inserció.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 Lliçó 3.4: MÉS CANVIS AMB c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 ** L'ordre canviar s'usa amb els mateixos objectes que l'ordre esborrar. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 1. L'ordre canviar funciona igual que la d'esborrar. El format és:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 [nombre] c objecte O BÉ c [nombre] objecte
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 2. Els objectes són els mateixos, com w (paraula), $ (final de línia), etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 3. Moveu el cursor fins la primera línia marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 4. Avanceu fins al primer error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 5. Premeu c$ per fer la línia igual que la segona i premeu <ESC>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 ---> El final d'aquesta línia necessita canvis per ser igual que la segona.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 ---> El final d'aquesta línia s'ha de corregir amb l'ordre c$.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 LLIÇÓ 3 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 1. Per tornar a posar el text que s'ha esborrat, premeu p . Això posa el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 parar a la línia SEGÜENT d'on hi ha el cursor).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 2. Per substituir el caràcter de sota el cursor, premeu r i tot seguit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 el caràcter que ha de reemplaçar l'original.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 3. L'ordre canviar permet canviar l'objecte especificat des del cursor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 fins el final de l'objecte. Per exemple, cw canvia el que hi ha des
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 del cursor fins al final de la paraula, i c$ fins al final de línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 4. El format de l'ordre canviar és:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 [nombre] c objecte O BÉ c [nombre] objecte
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 Ara aneu a la pròxima lliçó.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 Lliçó 4.1: SITUACIÓ I ESTAT DEL FITXER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 ** Premeu CTRL-g per veure la situació dins del fitxer i el seu estat.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 Premeu SHIFT-G per anar a una línia determinada. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 Nota: No proveu res fins que hàgiu llegit TOTA la lliçó!!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix de
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 la pàgina apareixerà un línia amb el nom del fitxer i la línia en la
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 qual us trobeu. Recordeu el número de la línia pel Pas 3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 2. Premeu Shift-G per anar al final de tot del fitxer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 3. Teclegeu el número de la línia on éreu i després premeu Shift-G. Això
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 us tornarà a la línia on éreu quan heu premut per primer cop Ctrl-g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 (Quan teclegeu el número NO es veurà a la pantalla.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 4. Ara executeu els passos de l'1 al 3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 Lliçó 4.2: L'ORDRE CERCAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 ** Premeu / seguit de la frase que vulgueu cercar. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 1. En el mode Normal premeu el caràcter / . Noteu que el cursor apareix
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 a la part de baix de la pantalla igual que amb l'ordre : .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 2. Ara escriviu 'errroor' <ENTRAR>. Aquesta és la paraula que voleu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 cercar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 3. Per tornar a cercar la mateixa frase, premeu n .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 Per cercar la mateixa frase en direcció contraria, premeu Shift-N .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 4. Si voleu cercar una frase en direcció ascendent, useu l'ordre ? en
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 lloc de /.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 ---> "errroor" no és com s'escriu error; errroor és un error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 Note: Quan la cerca arribi al final del fitxer continuarà a l'inici.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 Lliçó 4.3: CERCA DE PARÈNTESIS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 ** Premeu % per cercar el ),], o } corresponent. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 1. Poseu el cursor en qualsevol (, [, o { de la línia marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 2. Ara premeu el caràcter % .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 3. El cursor hauria d'anar a la clau o parèntesis corresponent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 4. Premeu % per tornar el cursor al primer parèntesi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 ---> Això ( és una línia amb caràcters (, [ ] i { } de prova. ))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 Nota: Això és molt útil per trobar errors en programes informàtics!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 Lliçó 4.4: UNA MANERA DE CANVIAR ERRORS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 ** Escriviu :s/vell/nou/g per substituir 'vell' per 'nou'. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 1. Moveu el cursor a la línia de sota marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 2. Escriviu :s/laa/la <ENTRAR> . Aquesta ordre només canvia la primera
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 coincidència que es trobi a la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 3. Ara escriviu :s/laa/la/g per fer una substitució global. Això
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 canviarà totes les coincidències que es trobin a la línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 ---> laa millor època per veure laa flor és laa primavera.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 4. Per canviar totes les coincidències d'una cadena entre dues línies,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 escriviu :#,#s/vell/nou/g on #,# són els nombres de les línies.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 Escriviu :%s/vell/nou/g per substituir la cadena a tot el fitxer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 LLIÇÓ 4 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 1. Ctrl-g mostra la posició dins del fitxer i l'estat del mateix.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 Shift-G us porta al final del fitxer. Un número seguit de Shift-G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 us porta a la línia corresponent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 2. L'ordre / seguida d'una frase cerca la frase ENDAVANT.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 L'ordre ? seguida d'una frase cerca la frase ENDARRERE.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 Després d'una cerca premeu n per trobar la pròxima coincidència en
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 la mateixa direcció, o Shift-N per cercar en la direcció contrària.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 3. L'ordre % quan el cursor és a sobre un (,),[,],{, o } troba la
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 parella corresponent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 4. Per substituir el primer 'vell' per 'nou' en una línia :s/vell/nou
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 Per substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 Per substituir frases entre les línies # i # :#,#s/vell/nou/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 Per substituir totes les coincidències en el fitxer :%s/vell/nou/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 Per demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 Lliçó 5.1: COM EXECUTAR UNA ORDRE EXTERNA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 ** Teclegeu :! seguit d'una ordre externa per executar-la. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 1. Premeu el familiar : per col·locar el cursor a la part de baix de
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 la pantalla. Això us permet entrar una ordre.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 2. Ara teclegeu el caràcter ! (signe d'exclamació). Això us permet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 executar qualsevol ordre de la shell.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 3. Com a exemple escriviu ls i tot seguit premeu <ENTRAR>. Això us
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 mostrarà el contingut del directori, tal com si estiguéssiu a la
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 línia d'ordres. Feu servir :!dir si ls no funciona.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 Nota: D'aquesta manera es pot executar qualsevol ordre externa.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 Nota: Totes les ordres : s'han d'acabar amb la tecla <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 Lliçó 5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 ** Per desar els canvis fets, escriviu :w FITXER. ***
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 1. Escriviu :!dir o bé :!ls per obtenir un llistat del directori.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 Ja sabeu que heu de prémer <ENTRAR> després d'això.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 2. Trieu un nom de fitxer que no existeixi, com ara PROVA.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 3. Ara feu: :w PROVA (on PROVA és el nom que heu triat.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 4. Això desa tot el fitxer amb el nom de PROVA. Per comprovar-ho
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 escriviu :!dir per veure el contingut del directori.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 fitxer serà una còpia exacta del tutor que heu desat.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 5. Ara esborreu el fitxer teclejant (MS-DOS): :!del PROVA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 o bé (Unix): :!rm PROVA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 Lliçó 5.3: UNA ORDRE SELECTIVA PER DESAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 ** Per desar una part del fitxer, escriviu :#,# w FITXER **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 1. Un altre cop, feu :!dir o :!ls per obtenir un llistat del directori
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 i trieu un nom de fitxer adequat com ara PROVA.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 2. Moveu el cursor a dalt de tot de la pàgina i premeu Ctrl-g per
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 saber el número de la línia. RECORDEU AQUEST NÚMERO!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 3. Ara aneu a baix de tot de la pàgina i torneu a prémer Ctrl-g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 RECORDEU AQUEST NÚMERO TAMBÉ!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 4. Per desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 #,# són els dos números que heu recordat (dalt,baix) i PROVA el nom
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 del fitxer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 5. Mireu que el fitxer nou hi sigui amb :!dir però no l'esborreu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 Lliçó 5.4: OBTENIR I AJUNTAR FITXERS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 ** Per inserir el contingut d'un fitxer, feu :r FITXER **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi és.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 2. Poseu el cursor a dalt de tot d'aquesta pàgina.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 NOTA: Després d'executar el Pas 3 veureu la lliçó 5.3. Aleshores moveu-vos
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 cap avall fins a aquesta lliçó un altre cop.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA és el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 nom del fitxer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 NOTA: El fitxer que obtingueu es posa en el lloc on hi hagi el cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 4. Per comprovar que s'ha obtingut el fitxer tireu enrere i mireu com
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 ara hi han dues còpies de la lliçó 5.3: l'original i la del fitxer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 LLIÇÓ 5 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 1. :!ordre executa una ordre externa.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 Alguns exemples útils són:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 (MS-DOS) (Unix)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 :!dir :!ls - mostra un llistat del directori
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 :!del FITXER :!rm FITXER - esborra el fitxer FITXER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 2. :w FITXER escriu el fitxer editat al disc dur, amb el nom FITXER.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 3. :#,#w FITXER desa les línies de # a # en el fitxer FITXER.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 4. :r FITXER llegeix el fitxer FITXER del disc dur i l'insereix en el
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 fitxer editat a la posició on hi ha el cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 Lliçó 6.1: L'ORDRE OBRIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 ** Premeu o per obrir una línia sota el cursor i entrar en mode inserció. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 1. Moveu el cursor a la línia de sota marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 2. Premeu o (minúscula) per obrir una línia SOTA el cursor i situar-vos
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 en mode d'inserció.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 3. Ara copieu la línia marcada amb ---> i premeu <ESC> per tornar al mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 normal.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 ---> Després de prémer o el cursor es situa a la línia nova en mode inserció.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 4. Per obrir una línia SOBRE el cursor, premeu la O majúscula, en lloc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 de la minúscula. Proveu-ho amb la línia de sota.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 Obriu una línia sobre aquesta amb Shift-O amb el cursor en aquesta línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 Lliçó 6.2: L'ORDRE AFEGIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 ** Premeu a per afegir text DESPRÉS del cursor. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 1. Moveu el cursor al final de la primera línia de sota marcada
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 amb ---> prement $ en el mode Normal.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 2. Premeu la lletra a (minúscula) per afegir text DESPRÉS del caràcter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 sota el cursor. (La A majúscula afegeix text al final de línia.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 la tecla <ESC>, cursor a la dreta, i finalment x , només per afegir
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 text a final de línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 3. Ara completeu la primera línia. Tingueu en compte que aquesta ordre
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 és exactament igual que la d'inserir, excepte pel que fa al lloc on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 s'insereix el text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 ---> Aquesta línia us permetrà practicar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 ---> Aquesta línia us permetrà practicar afegir text a final de línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 Lliçó 6.3: UNA ALTRA MANERA DE SUBSTITUIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 ** Teclegeu una R majúscula per substituir més d'un caràcter. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 1. Moveu el cursor a la línia de sota marcada amb --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 2. Poseu el cursor al principi de la primera paraula que es diferent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 respecte a la segona línia marcada amb ---> (la paraula "l'última").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 3. Ara premeu R i substituïu el que queda de text a la primera línia
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 escrivint sobre el text vell, per fer-la igual que la segona.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 ---> Per fer aquesta línia igual que l'última useu les tecles.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 ---> Per fer aquesta línia igual que la segona, premeu R i el text nou.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 4. Tingueu en compte que en prémer <ESC> per sortir, el text que no
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 s'hagi alterat es manté.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 Lliçó 6.4: ESTABLIR OPCIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 ** Feu que les ordres cercar o substituir ignorin les diferències
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 entre majúscules i minúscules **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 1. Cerqueu la paraula 'ignorar' amb: /ignorar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 Repetiu-ho uns quants cops amb la tecla n.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 2. Establiu l'opció 'ic' (Ignorar Capitals) escrivint:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 :set ic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 3. Ara cerqueu 'ignorar' un altre cop amb la tecla n.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 Repetiu-ho uns quants cops més.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 4. Establiu les opcions 'hlsearch' i 'incsearch':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 :set hls is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 5. Ara torneu a executar una ordre de cerca, i mireu què passa:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 /ignorar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 6. Per treure el ressalt dels resultats, feu:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 :nohlsearch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 LLIÇÓ 6 SUMARI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 1. L'ordre o obre una línia SOTA la del cursor i mou el cursor a la nova
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 línia, en mode Inserció.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 La O majúscula obre la línia a SOBRE la que hi ha el cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 2. Premeu una a per afegir text DESPRÉS del caràcter sota el cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 La A majúscula afegeix automàticament el text a final de línia.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 3. L'ordre R majúscula us posa en mode substitució fins que premeu <ESC>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 4. Escriviu ":set xxx" per establir l'opció "xxx"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 LLIÇÓ 7: ORDRES D'AJUDA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 ** Utilitzeu el sistema intern d'ajuda **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 El Vim té un extens sistema d'ajuda. Per llegir una introducció proveu una
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 d'aquestes tres coses:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 - premeu la tecla <AJUDA> (si en teniu alguna)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 - premeu la tecla <F1> (si en teniu alguna)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 - escriviu :help <ENTRAR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 Teclegeu :q <ENTRAR> per tancar la finestra d'ajuda.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 Podeu trobar ajuda sobre pràcticament qualsevol tema donant un argument
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 a l'ordre ":help". Proveu això (no oblideu prémer <ENTRAR>):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 :help w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 :help c_<T
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 :help insert-index
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 :help user-manual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 LLIÇÓ 8: CREAR UN SCRIPT D'INICI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 ** Activar funcions automàticament **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 El Vim té moltes més funcions que el Vi, però moltes estan desactivades per
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 omissió. Per començar a utilitzar més funcions heu de crear un fitxer "vimrc".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 1. Comenceu a editar el fitxer "vimrc", depenent del sistema
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 :edit ~/.vimrc per Unix
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 :edit $VIM/_vimrc per MS-Windows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 2. Ara llegiu el fitxer "vimrc" d'exemple:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772 :read $VIMRUNTIME/vimrc_example.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 3. Deseu el fitxer amb:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 :write
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 El pròxim cop que executeu el Vim usarà ressalt de sintaxi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 Podeu afegir els ajustos que vulgueu en aquest fitxer "vimrc".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 Aquí conclou el Tutor del Vim. Ha sigut un intent de fer-vos una breu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 introducció a l'editor Vim, suficient com per què el pugueu començar a fer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 servir. Està lluny de ser complet perquè el Vim té moltes més ordres.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786 Llegiu el manual de l'usuari: ":help user-manual".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 Per un estudi més profund us recomanem el següent llibre:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 Vim - Vi Improved - de Steve Oualline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 Editorial: New Riders
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 És el primer llibre dedicat completament al Vim, especialment útil per a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 usuaris novells. Té molts exemples i dibuixos.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 Vegeu http://iccf-holland.org/click5.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 Aquest altre és més vell i tracta més sobre el Vi que sobre el Vim:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 Learning the Vi Editor - de Linda Lamb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 Editorial: O'Reilly & Associates Inc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 És un bon llibre per saber qualsevol cosa que desitgeu sobre el Vi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 La sisena edició també inclou informació sobre el Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801 Aquest tutorial ha estat escrit per Michael C. Pierce i Robert K. Ware,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 Colorado School of Mines amb la col·laboració de Charles Smith,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 Colorado State University. E-mail: bware@mines.colorado.edu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 Modificat pel Vim per Bram Moolenaar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~