https://www.guilde.asso.fr/wiki/index.php?title=Utilisation_de_vi&feed=atom&action=historyUtilisation de vi - Historique des versions2024-03-28T19:39:06ZHistorique des versions pour cette page sur le wikiMediaWiki 1.39.6https://www.guilde.asso.fr/wiki/index.php?title=Utilisation_de_vi&diff=6990&oldid=prevMarillat le 31 mars 2023 à 13:432023-03-31T13:43:29Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="fr">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Version précédente</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version du 31 mars 2023 à 14:43</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l91">Ligne 91 :</td>
<td colspan="2" class="diff-lineno">Ligne 91 :</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Rechercher/Remplacer du texte=</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Rechercher/Remplacer du texte=</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> /<del style="font-weight: bold; text-decoration: none;">chaine </del>Recherche le texte "<del style="font-weight: bold; text-decoration: none;">chaine</del>" vers le bas</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> /<ins style="font-weight: bold; text-decoration: none;">chaîne </ins>Recherche le texte "<ins style="font-weight: bold; text-decoration: none;">chaîne</ins>" vers le bas</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ?<del style="font-weight: bold; text-decoration: none;">chaine </del>Recherche le texte "<del style="font-weight: bold; text-decoration: none;">chaine</del>" vers le haut</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ?<ins style="font-weight: bold; text-decoration: none;">chaîne </ins>Recherche le texte "<ins style="font-weight: bold; text-decoration: none;">chaîne</ins>" vers le haut</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> n Répète la dernière recherche</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> n Répète la dernière recherche</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ""//[RET]"" Idem que n</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ""//[RET]"" Idem que n</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l100">Ligne 100 :</td>
<td colspan="2" class="diff-lineno">Ligne 100 :</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> "":x,y s/expr1/expr2/g"" Recherche de la ligne x à la ligne y l'expression 1 et la remplace par l'expression 2</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> "":x,y s/expr1/expr2/g"" Recherche de la ligne x à la ligne y l'expression 1 et la remplace par l'expression 2</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>=Annuler/<del style="font-weight: bold; text-decoration: none;">Répeter </del>les modifications=</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>=Annuler/<ins style="font-weight: bold; text-decoration: none;">Répéter </ins>les modifications=</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> u Annule la dernière modification</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> u Annule la dernière modification</div></td></tr>
</table>Marillathttps://www.guilde.asso.fr/wiki/index.php?title=Utilisation_de_vi&diff=3326&oldid=prevMarillat le 2 novembre 2006 à 00:122006-11-02T00:12:37Z<p></p>
<p><b>Nouvelle page</b></p><div>__NOTOC__<br />
=Utilisation de vi=<br />
<br />
==Ouvrir un fichier au lancement de vi==<br />
<br />
:vi fichier<br />
<br />
=Sauvegarde d'un fichier - Sortie de vi=<br />
<br />
:w Sauvegarde le fichier<br />
:wq Sauvegarde le fichier et quitte vi<br />
:q Quitte vi sans sauver les modifications<br />
:e! Ignore les changements et recharge le fichier<br />
:q! Force vi à se terminer<br />
:w fichier Sauvegarde le fichier sous le nom "fichier"<br />
:w! fichier Remplace le fichier "fichier"<br />
<br />
=Déplacements dans vi=<br />
<br />
[CTRL]f Descend d'un écran<br />
[CTRL]b Remonte d'un écran<br />
[CTRL]d Descent d'1/2 écran<br />
[CTRL]u Remonte d'1/2 écran<br />
:xxx Va à la ligne xxx<br />
<br />
=Réactualisation de l'écran=<br />
<br />
[CTRL]l Réactualise l'écran<br />
%[RET] Réactualise l'écran en plaçant le curseur en haut de l'écran<br />
%. Réactualise l'écran en plaçant le curseur au milieu de l'écran<br />
%- Réactualise l'écran en plaçant le curseur en bas de l'écran<br />
<br />
=Positionnement du curseur=<br />
<br />
H En haut de l'écran<br />
M Au milieu de l'écran<br />
L En bas de l'écran<br />
h Décale d'un caractère à gauche<br />
j Descent d'une ligne<br />
k Monte d'une ligne<br />
l Décale d'un caractère à droite<br />
O Au début de la ligne<br />
$ A la fin de la ligne<br />
w Au début du mot suivant<br />
e A la fin du mot suivant<br />
b Recule d'un mot<br />
<br />
=Insertion d'un texte=<br />
<br />
i Active le mode insertion<br />
a Active le mode insertion mais un caractère après le curseur<br />
I Insère au début de la ligne<br />
A Insère à la fin de la ligne<br />
O Insère une ligne en dessus du curseur et passe en mode insertion<br />
o Insère une ligne en dessous du curseur et passe en mode insertion<br />
[ESC] Termine le mode insertion<br />
<br />
=Insertion et remplacement d'un texte=<br />
<br />
r* Remplace le caractère à la position du curseur par *<br />
R Remplace tous les caractères jusqu'à la fin de la ligne ([ESC] pour terminer)<br />
cw Remplace uniquement le mot à la position du curseur ([ESC] pour terminer)<br />
cnw Remplace n mots ([ESC] pour terminer)<br />
C Change le reste de la ligne ([ESC] pour terminer)<br />
<br />
=Suppression d'un texte=<br />
<br />
x Supprime un caractère<br />
dw Supprime un mot<br />
dnw Supprime n mots<br />
dd Supprime une ligne<br />
ndd Supprime n lignes<br />
<br />
=Copier/Coller=<br />
<br />
Y Copie une ligne<br />
nY Copie n lignes<br />
P Colle les lignes avant le curseur<br />
p Colle les lignes après le curseur<br />
<br />
=Copier/Coller du texte dans un autre fichier=<br />
<br />
ma Marque la position "a" dans le fichier<br />
mb Marque la position "b" dans le fichier<br />
:'a,'b fichier Copie le texte de la position "a" à la position "b" dans le fichier "fichier"<br />
<br />
=Insertion du texte d'un autre fichier=<br />
<br />
:r fichier Insère tout le contenu du fichier "fichier"<br />
<br />
=Rechercher/Remplacer du texte=<br />
<br />
/chaine Recherche le texte "chaine" vers le bas<br />
?chaine Recherche le texte "chaine" vers le haut<br />
n Répète la dernière recherche<br />
""//[RET]"" Idem que n<br />
N Inverse la recherche précédente<br />
"":g/expr1/s//expr2/g"" Recherche dans tous le fichier l'expression 1 et la remplace par l'expression 2<br />
"":g/expr1/s//expr2/gc"" Idem, mais demande une confirmation avant de remplacer<br />
"":x,y s/expr1/expr2/g"" Recherche de la ligne x à la ligne y l'expression 1 et la remplace par l'expression 2<br />
<br />
=Annuler/Répeter les modifications=<br />
<br />
u Annule la dernière modification<br />
U Annule toutes les modifications effectuées sur la ligne courante<br />
. Répète les dernières modifications<br />
<br />
=Trucs divers=<br />
<br />
en mode insertion, Ctrl+p complète le mot en cours d'édition avec le mot précédent qui matche<br />
en mode insertion, Ctrl+n complète le mot en cours d'édition avec le mot suivant qui matche<br />
Pressez de nouveau Ctrl+p ( ou Ctrl+n ) pour choisir au prochain matching<br />
<br />
Contribution pour la GUILDE, Septembre 1999, Jérôme DESMOULINS<br />
email: desmoulins CHEZ ifrance.com</div>Marillat