issue54:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue54:c_c [2011/12/07 12:17] – auntiee | issue54:c_c [2011/12/16 17:13] (Version actuelle) – amstram | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
Vim is the console-oriented verfsion of the program (for use in gnome-terminal, | Vim is the console-oriented verfsion of the program (for use in gnome-terminal, | ||
- | C' | + | C' |
**Why should I use Vim/GVim? | **Why should I use Vim/GVim? | ||
Ligne 15: | Ligne 15: | ||
Pourquoi utiliser Vim/GVim ? | Pourquoi utiliser Vim/GVim ? | ||
- | Je ne vais pas dire que Vim/GVim est le seul éditeur de texte que quiconque devrait utiliser, mais c'est celui que je préfère. Pourquoi ? Tout simplement parce qu'il propose des trucs par défaut de bon sens et des raccourcis claviers qui permettent des modifications très rapides | + | Je ne vais pas dire que Vim/GVim est le seul éditeur de texte que quiconque devrait utiliser, mais c'est celui que je préfère. Pourquoi ? Tout simplement parce qu'il propose des trucs par défaut de bon sens et des raccourcis claviers qui permettent des modifications très rapides, sans devoir utiliser la souris. Je trouve que je travaille plus vite en gardant les mains sur le clavier au lieu de m' |
Comment s'y déplacer si vous n' | Comment s'y déplacer si vous n' | ||
- | Dans GVim, l' | + | Dans GVim, l' |
- | What other useful features does it offer? | + | **What other useful features does it offer? |
It allows you to: | It allows you to: | ||
• Set a custom size (number of spaces) for tab characters, which is useful when coding python. | • Set a custom size (number of spaces) for tab characters, which is useful when coding python. | ||
Ligne 33: | Ligne 33: | ||
w -word (used in conjunction with y or d mainly) | w -word (used in conjunction with y or d mainly) | ||
1-∞< | 1-∞< | ||
- | :w – write (can be combined with q to write and quit) | + | :w – write (can be combined with q to write and quit)** |
- | :e – open | + | |
- | :q – quit | + | Quelles autres fonctionnalités utiles propose-t-il ? |
- | Esc – exit any mode | + | Il vous permet de : |
- | i – insert mode (inserts before current selection) | + | * Personnaliser la taille (le nombre d' |
+ | * Copier, coller, supprimer et insérer des contrôles qui permettent un formatage soigné (dw = supprimer mot), dd = supprimer ligne, yw = copier mot, yy = copier ligne, p = coller, etc.). | ||
+ | * Imprimer (avec un défaut de bon sens). | ||
+ | * Un tutoriel auquel vous pouvez accéder avec la commande « vimtutor ». | ||
+ | * La création et l' | ||
+ | Quelques commandes de base : | ||
+ | hjkl - mouvement (h = à gauche, j = vers le bas, k = vers le haut et l = à droite) - cela ne fonctionne qu'en dehors de tout mode. Quand vous travaillez dans un mode quelconque, vous devrez utiliser les touches fléchées. | ||
+ | y - copier (yy = copier la ligne) ; | ||
+ | d - supprimer (dd = supprimer ligne) ; | ||
+ | w - word (mot - utilisé pour la plupart du temps avec y ou d) ; | ||
+ | 1-∞< | ||
+ | :w - « write » (enregistrer - peut être utilisé avec q pour enregistrer et quitter [Ndt :dans la version 7.2, c'est :wqa qu'il faut utiliser]) ; | ||
+ | |||
+ | **:e – open ; | ||
+ | :q – quit ; | ||
+ | Esc – exit any mode ; | ||
+ | i – insert mode (inserts before current selection) | ||
a – add mode | a – add mode | ||
r – replace mode | r – replace mode | ||
Ligne 48: | Ligne 64: | ||
I – insert before all highlighted letters | I – insert before all highlighted letters | ||
X – delete all highlighted letters | X – delete all highlighted letters | ||
- | *middle-mouse button (or shift + insert) paste from external linux clipboard after selecting the text to paste.* | + | *middle-mouse button (or shift + insert) paste from external linux clipboard after selecting the text to paste.* ** |
- | This is just a basic list of commands I frequently use. The line marked with asterisks is actually a linux shortcut, but it's very useful in Vim/GVim. | + | :e - ouvrir ; |
+ | :q - quitter [Ndt : dans la version 7.2, c'est :qa] ; | ||
+ | Échap - sortir d'un mode ; | ||
+ | i - mode insertion (sera inséré avant la sélection actuelle ; | ||
+ | a - mode ajouter ; | ||
+ | r - mode remplacer ; | ||
+ | u - annuler ; | ||
+ | ctrl+r - refaire [Ndt : dans la version 7.2, c'est ^R] ; | ||
+ | p - coller tout ce qui a été copié ou supprimé dans Vim/GVim ; | ||
+ | :hardcopy - Imprimer [Ndt : dans GVim en français, il y a une icône pour imprimer, ou Fichier > Imprimer ; | ||
+ | : | ||
+ | :set < | ||
+ | ctrl+v - mode visuel, ce qui permet la mise en surbrillance de lignes multiples à l' | ||
+ | I - insérer avant toutes les lettres en surbrillance. | ||
+ | X - supprimer toutes les lettres en surbrillance. | ||
+ | *bouton du milieu de la souris (ou maj + insérer) pour coller à partir du presse-papiers linux externe après avoir sélectionné le texte à coller.* | ||
+ | |||
+ | **This is just a basic list of commands I frequently use. The line marked with asterisks is actually a linux shortcut, but it's very useful in Vim/GVim. | ||
How do I use Vim/GVim? | How do I use Vim/GVim? | ||
To open a file, you can either append the path after the Vim/GVim command, or open it using :e once it loads. Once you have opened the file that you want to edit, you can then hit “i” (the key on the keyboard) to enter insert mode. It will tell you what mode is active (blank means there is currently no mode being used) in the bottom-left corner. For the sake of this example, let us simply write “Com3mand 6 Conque”. Once you've entered the text, it's time to fix it up. Move to the 3 using the hjkl keys, and then hit the “x” key to delete it. Head over to the 6 and hit the “r” key, and then enter the ampersand (“& | To open a file, you can either append the path after the Vim/GVim command, or open it using :e once it loads. Once you have opened the file that you want to edit, you can then hit “i” (the key on the keyboard) to enter insert mode. It will tell you what mode is active (blank means there is currently no mode being used) in the bottom-left corner. For the sake of this example, let us simply write “Com3mand 6 Conque”. Once you've entered the text, it's time to fix it up. Move to the 3 using the hjkl keys, and then hit the “x” key to delete it. Head over to the 6 and hit the “r” key, and then enter the ampersand (“& | ||
- | and you'll notice that you can't move the cursor past the already entered text. How do you enter the r then? You can either hit the “i” key for insert and move the cursor using the arrow keys and then enter it. Or, you could “append” the text using the “a” key, which moves the cursor to the space after the selected letter. Then type “r” and you're all set. If you want to save it, do so with :w (and if you haven' | + | and you'll notice that you can't move the cursor past the already entered text. How do you enter the r then? You can either hit the “i” key for insert and move the cursor using the arrow keys and then enter it. Or, you could “append” the text using the “a” key, which moves the cursor to the space after the selected letter. Then type “r” and you're all set. If you want to save it, do so with :w (and if you haven' |
- | A few things to remember: | + | Ceci n'est qu'une liste de base des commandes que j' |
+ | |||
+ | Ma façon d' | ||
+ | Pour ouvrir un fichier, vous pouvez soit en ajouter le chemin après la commande Vim/GVim, soit l' | ||
+ | |||
+ | **A few things to remember: | ||
The Vim shortcut keys that use letters (u, ctrl+r, y, d, w, etc) all require you to be in the “blank mode” (i.e. without any editing mode active). Otherwise, you'll just type the letter. Get in the habit of hitting escape after you've made a change so that you don't start typing in gibberish. | The Vim shortcut keys that use letters (u, ctrl+r, y, d, w, etc) all require you to be in the “blank mode” (i.e. without any editing mode active). Otherwise, you'll just type the letter. Get in the habit of hitting escape after you've made a change so that you don't start typing in gibberish. | ||
Ligne 71: | Ligne 109: | ||
http:// | http:// | ||
Screenshot (full-size): | Screenshot (full-size): | ||
+ | http:// | ||
+ | |||
+ | Voici quelques points à ne pas oublier : | ||
+ | Les raccourcis clavier de Vim qui utilisent des lettres (u, ctrl+r, y, d, w, etc.) nécessitent d' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Si vous voulez copier quelque chose et voyez que vous copiez également le nombre des lignes, il suffit de les désactiver avec :set nonumber et de les activer à nouveau avec :set number. | ||
+ | |||
+ | Si vous avez des questions ou aimeriez un deuxième article sur Vim avec un exemple étape par étape, veuillez me le faire savoir à lswest34@gmail.com. Et si vous m' | ||
+ | |||
+ | Fichiers : | ||
+ | Mon .vimrc (J'ai supprimé quelques fonctions qui nécessitent des logiciels externes ou sont, en principe, à utiliser avec Mutt ; il pourrait en résulter qu'un ou deux réglages ne fonctionnent pas) : | ||
+ | http:// | ||
+ | Les couleurs dont je me sers (voir la capture d' | ||
+ | http:// | ||
+ | Capture d' | ||
http:// | http:// | ||
+ | |||
+ |
issue54/c_c.1323256676.txt.gz · Dernière modification : 2011/12/07 12:17 de auntiee