issue182: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 | ||
issue182:c_c [2022/06/27 14:14] – d52fr | issue182:c_c [2022/06/30 15:35] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
**So, working on a crappy Mac laptop keyboard has me re-learning shortcuts I have not used in donkey’s years. I am sure there are newbies out there who don’t use them either, as nice keyboards have spoiled us. I also prefer terminal emulators with mouse support. For me, these are just quality-of-life improvements to Linux in general. It’s the little things that have me pining for Linux while working on my work Mac laptop. Let me explain myself. I am in no way saying that my Mac’s keyboard is bad quality, in fact it is a hundred times better than the brand new Lenovo keyboard I am typing on now, where I basically have to jump off the back of the couch to type a letter and not let it miss, making touch typing impossible. It is the flow I am talking about. If I want to make my browser full screen, I hit F11 and continue. It is clearly marked and situated perfectly above my ring finger on my left hand. Not so with the Mac, I have to take my hand off the mouse as F11 now requires 2 hands as well as squinting to see where it will be on the touch bar. The same goes for the terminal. It feels like such a step backwards. I am all for one button presses.** | **So, working on a crappy Mac laptop keyboard has me re-learning shortcuts I have not used in donkey’s years. I am sure there are newbies out there who don’t use them either, as nice keyboards have spoiled us. I also prefer terminal emulators with mouse support. For me, these are just quality-of-life improvements to Linux in general. It’s the little things that have me pining for Linux while working on my work Mac laptop. Let me explain myself. I am in no way saying that my Mac’s keyboard is bad quality, in fact it is a hundred times better than the brand new Lenovo keyboard I am typing on now, where I basically have to jump off the back of the couch to type a letter and not let it miss, making touch typing impossible. It is the flow I am talking about. If I want to make my browser full screen, I hit F11 and continue. It is clearly marked and situated perfectly above my ring finger on my left hand. Not so with the Mac, I have to take my hand off the mouse as F11 now requires 2 hands as well as squinting to see where it will be on the touch bar. The same goes for the terminal. It feels like such a step backwards. I am all for one button presses.** | ||
+ | |||
+ | Le fait de travailler sur un clavier d' | ||
+ | |||
**Let’s do some examples of the common ones, and we can talk about extending it later. | **Let’s do some examples of the common ones, and we can talk about extending it later. | ||
As you can see in the image (below), I made a boo-boo. Of course I can hit the home key or use the arrow keys to fix my mistake. My Mac work laptop does not have a ‘home’ key. This is a short command, some of the python scripts that we run are long, with lots of parameters to plug into it, making the arrow keys tedious to say the least. Here you can use the CTRL+a and CTRl+e key combinations to simulate home and end on your keyboard. Go ahead, type something long in your terminal, it does not have to be sensible, a bunch of z’s (zzzzzzz) will do fine to illustrate the example. Use your arrow keys to move your cursor. It may be a block, or an underline, it does not matter. Now press CTRL+e (end) then press CTRL+a (home) and observe your cursor. ** | As you can see in the image (below), I made a boo-boo. Of course I can hit the home key or use the arrow keys to fix my mistake. My Mac work laptop does not have a ‘home’ key. This is a short command, some of the python scripts that we run are long, with lots of parameters to plug into it, making the arrow keys tedious to say the least. Here you can use the CTRL+a and CTRl+e key combinations to simulate home and end on your keyboard. Go ahead, type something long in your terminal, it does not have to be sensible, a bunch of z’s (zzzzzzz) will do fine to illustrate the example. Use your arrow keys to move your cursor. It may be a block, or an underline, it does not matter. Now press CTRL+e (end) then press CTRL+a (home) and observe your cursor. ** | ||
+ | |||
+ | Prenons quelques exemples des plus courants et nous pourrons parler de leur extension plus tard. | ||
+ | |||
+ | Comme vous pouvez le voir sur l' | ||
+ | |||
**The next one I will show you needs a little bit more focus from your side. CTRL+z in your terminal may end up the same as CTRL+c and end your typing, so, to ‘undo’ something, you need to type CTRL+_ . This is an underscore, as if you type a minus, your text in your terminal emulator will shrink. (CTRL++ and CTRL+- are usually zoom commands) add a few x’s after your z’s that you typed, bonus points if you used CTRL+e to go to the end to type. Now press CTRL+_ to see them pop out of existence. Now I want you to go to the start again, without using the mouse, the home button or CTRL+a, and then to the end again without using the mouse, CTRL+e or the end button. Say what now? No, I’m not messing with you, unless I am.... Luckily for you, I am not. This is a function controlled by CTRL+xx, so try it now. You may wonder why CTRL+f and CTRL+b are not used for forward and backward instead, but it is because those are taken too, they will take you ahead and backwards one word at a time. Quickly type: “The quick brown fox” and navigate with CTRL+b and CTRL+f. Don’t just read it, do it please, we need to get that “muscle memory” thing going. This helps when you need to plug in parameters into a copied script you may have just pasted that has different values. ** | **The next one I will show you needs a little bit more focus from your side. CTRL+z in your terminal may end up the same as CTRL+c and end your typing, so, to ‘undo’ something, you need to type CTRL+_ . This is an underscore, as if you type a minus, your text in your terminal emulator will shrink. (CTRL++ and CTRL+- are usually zoom commands) add a few x’s after your z’s that you typed, bonus points if you used CTRL+e to go to the end to type. Now press CTRL+_ to see them pop out of existence. Now I want you to go to the start again, without using the mouse, the home button or CTRL+a, and then to the end again without using the mouse, CTRL+e or the end button. Say what now? No, I’m not messing with you, unless I am.... Luckily for you, I am not. This is a function controlled by CTRL+xx, so try it now. You may wonder why CTRL+f and CTRL+b are not used for forward and backward instead, but it is because those are taken too, they will take you ahead and backwards one word at a time. Quickly type: “The quick brown fox” and navigate with CTRL+b and CTRL+f. Don’t just read it, do it please, we need to get that “muscle memory” thing going. This helps when you need to plug in parameters into a copied script you may have just pasted that has different values. ** | ||
+ | |||
+ | La prochaine que je vais vous montrer, nécessite un peu plus d' | ||
**Example: | **Example: | ||
Ligne 16: | Ligne 26: | ||
Nothing we have done is ground-breaking, | Nothing we have done is ground-breaking, | ||
+ | |||
+ | Exemple : | ||
+ | |||
+ | python3 steadyscript.py 753840 nathan california circus-charlie | ||
+ | |||
+ | Tapez ce script fictif, puis remplacez l'id par 544384, nathan par mike, et circus-charlie par mad-bob. | ||
+ | |||
+ | Essayez de le faire avec les touches fléchées uniquement au début et voyez combien de temps cela vous prend. Maintenant, répétez-le en utilisant ce que je vous ai appris jusqu' | ||
+ | |||
+ | Rien de ce que nous avons fait n'est révolutionnaire et je vous donnerai une liste de combinaisons de touches que vous pouvez essayer par vous-même. Mais il est indispensable de les essayer, sinon vous les oublierez en passant à la page suivante. Vous pouvez également penser que vous ne les utiliserez plus jamais dans votre vie, mais cela peut arriver. Si vous travaillez dans une salle de serveurs et qu'ils ont un de ces mini claviers de 30 touches qui vous rappellent un ZX Spectrum, qui se glisse dans le rack, vous me remercierez. | ||
+ | |||
**You can find all of them by typing: | **You can find all of them by typing: | ||
Ligne 26: | Ligne 47: | ||
Did I make a mistake? Let me know at misc@fullcirclemagazine.org** | Did I make a mistake? Let me know at misc@fullcirclemagazine.org** | ||
+ | |||
+ | Vous pouvez les trouver toutes en tapant : | ||
+ | |||
+ | bind -p | ||
+ | |||
+ | Cependant, pour un débutant, la sortie ressemble à des déchets et peut le décourager ; je préfère donc les introduire en douceur. | ||
+ | |||
+ | En bonus, si vous avez installé nano, comme tout débutant devrait le faire, vous pouvez lancer rapidement votre éditeur en maintenant la touche CTRL enfoncée, puis en appuyant sur x et, tout en maintenant la touche CTRL enfoncée, en appuyant sur e. C' | ||
+ | |||
+ | Ai-je fait une erreur ? Faites-moi signe à misc@fullcirclemagazine.org | ||
+ | |||
+ | // p 22, encart en haut à droite, lignes noires :// | ||
+ | |||
+ | **Here is a quick cheat sheet:** | ||
+ | Voici un aide-mémoire : | ||
+ | |||
+ | **This obviously does not include things like CRTL+r or CTRL+l, these should be second nature to you, even as a newbie.** | ||
+ | Évidemment, | ||
+ |
issue182/c_c.1656332090.txt.gz · Dernière modification : 2022/06/27 14:14 de d52fr