3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/v
3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 1/20 Is Vim Really Not For You? A Beginner Guide “Vim is not for me!” shout out Dave, my colleague developer. It wasn’t the first time I’ve heard this sentence. The result? Me, explaining to Dave and others gathering around my desk that learning the basics of Vim can be beneficial to anybody: 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 2/20 Many CLIs use Vim-like key bindings, like Less for example. They can easily edit files on remote systems or in docker containers when only Vi (the ancestor of Vim) or Vim is available. They can customize Vim like crazy, to match their personal needs and preferences. They can run Vim everywhere they want. Vim can edit very large text files without slowing down, like huge log files for example. They can learn a new and really fun way for creating and editing content. To me, Vim is the gamification of coding. Still, some developers don’t try to understand what Vim is about. At the same time, they have a strong opinion about it. How can somebody judge something without seriously trying it? I can’t blame them: I had exactly the same bias years ago. But when I tried to learn to use Vim, when I tried to understand how it works - not only learning two shortcuts randomly - I fall in love. That’s why I would like to share with you today how I learned the very basics of Vim. More specifically, we’ll see in this article: How to learn quickly good typing techniques. They are essential if you want to unleash Vim’s latent power. Even if you don’t use Vim, these techniques have many benefits for any developer. The different Vim modes. This is one of the main reason why Vim is so crazy. The basic Vim shortcuts (keystrokes) for you to be efficient as quickly as possible, with some tips to remember them easily. How to speak the Language of Vim. What Vim’s options are and how to manipulate them. After that, you’ll speak about Vim with experience and confidence, even if it’s for saying: “naaaah, Vim is not for me!”. The goal of this article is not to replace your IDE with Vim from one day to another. I would recommend to take a step by step approach here. At the beginning, you can try to use Vim to edit some configuration or other text files. Practicing what you’ll learn in this article is the key for you to really understand how Vim works and why it’s so popular, even decades after its creation. Don’t think that Vim is hard to learn. It’s easy to learn to edit any file, but it’s hard to master. Vim gurus, coding in the Himalaya for hundred of years, can’t even pretend knowing everything about Vim. That’s great, because it means that the possibilities of this editor are beyond infinity. 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 3/20 Doubtful? Follow me. Let’s dive into the wonderful world of Vim together. Prerequisites: The Power Is In Your Fingers When I decided to learn Vim, I wanted to do it right. Vim allows you to forget your hands and let you really focus on the most important thing: what you’re writing. The Mouse: Your False Best Friend One of the advantage of Vim is to let your hands on the keyboard, without the constant need to grab your mouse. I see you’re afraid: your mouse is like your third hand! It’s so useful and easy! Why would you not use it? Your mouse is a bit like an implant a doctor would have put on your body at a very young age, telling your parent that it’s the best device to do something on a computer. You like it because you’re deeply used to it, for a very long time. Ask yourself: why on earth, if the mouse was so perfect, your favorite IDE has ൣൡൣൢ keyboard shortcuts? Maybe because using your keyboard is faster? Easier? More efficient? More comfortable? Your mouse is not your best friend. It’s just a friend. Your keyboard is the real brother-from- another-mother here. The power comes from it, and Vim is perfect for you to harness and unleash this power. 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 4/20 Note If you want to build a complete Mouseless Development Environment, you might be interested by this book. That’s why I deeply believe that before learning Vim, you should learn basic typing techniques. The benefits are great: You’ll type faster and more accurately. You’ll be able to increase your speed and accuracy over time. You won’t focus on your keyboard anymore. Not even a bit. If you already use these techniques, that’s great! You can directly go to the next chapter. Efficient Typing: The Two Rules We all agree that thinking, for a developer, is more important than knowing how to type. That said, it’s still nice to feel in control of your tools. As a developer, the keyboard is one of the most important! It’s very fulfilling to see your typing improving day after days, months after months, even years after years. The room for progression is huge, even if it’s pretty quick and easy to learn the basics. The first rule you need to learn is placing your hand correctly: 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 5/20 Source The keys a , s , d , f and j , k , l , ; are called the row keys. They are the starting points for your hands. From there, you’ll be able to grab any other key easily. You’ll notice that there are little bumps on the f and j keys on your keyboard: they are indicators for you to know where to put your indexes. When they are at the good position, simply place the other fingers on the other row keys. The second rule you need to train for: try not looking at your keyboard while you’re typing. If you don’t remember where a key is, try first to get it without looking, even if it feels random. I was only typing with two fingers for years. It felt totally foreign to try to follow these rules at first. Now, I could not type differently, mostly because it’s more comfortable. It took me only one to two weeks to learn this new way of typing. It’s not because I’m a genius (definitely not), but because it’s easy. The First Week When you decide to use the two rules I described above, you need to try to follow them all the time. We need ൡൠൠ% commitment here. When you surprise yourself using your old (and bad) techniques again, be patient, don’t see it as a failure, and come back to the good ones. This is the mandatory part of the learning process. 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 6/20 The first three days are the most difficult. You’ll alternate between good and bad technique without even noticing it. You’ll do mistakes, and you’ll be slow. Fortunately, at the end of the week, the amount of mistake will decrease, and you will less and less need to watch your keyboards. The Second Week You’ll notice during the second week the amount of mistakes decreasing even more, and your need to watch your keyboard will disappear. At the end of the week, you’ll see your typing speed already improving. The good feelings of reward will begin to please your sweet brain. Speed and Accuracy During your two weeks of initial training, you shouldn’t focus on speed or accuracy. Just type, as much as you can, and don’t worry about anything else yet, not even the mistakes you make. After that, you can focus on speed and accuracy: how fast you can type and trying to make as fewer mistakes as possible. To train these good typing techniques, from the beginning of your learning experience to the end of your life, you can use typing software which can drastically help you. Here’s a list of my favorite ones: Type Racer Online Typing Test WPM Speed Coder Vim Or Neovim? 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 7/20 With these fundamentals out of the way, let’s install Neovim. Neovim? What’s this new weird thing, you might rightfully ask? Neovim is a refactor of Vim. It’s compatible with everything Vim related. I would definitely recommend using it, instead of the regular Vim, since it’s optimized out of the box. Here are the official links for both software: Neovim Vim Because Neovim and Vim are almost identical (with a different philosophy), I’ll continue to call these two software using the generic term Vim in this article. Vim’s Configuration 3/28/2021 Is Vim Really Not For You? A Beginner Guide https://thevaluable.dev/vim-beginner/ 8/20 In Vim, uploads/Sante/ vim-guide.pdf
Documents similaires










-
36
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Oct 02, 2022
- Catégorie Health / Santé
- Langue French
- Taille du fichier 0.5496MB