7 ms·
Here is a trick that I used to use when I started learning VIM: - Write down 2-3 tricks/shortcuts in a piece of paper. Put that piece of paper in front of you
by csomar 8y ago
Here is a trick that I used to use when I started learning VIM:
- Write down 2-3 tricks/shortcuts in a piece of paper. Put that piece of paper in front of you (ie: tag it to your screen).
- Code with Vim. You'll eventually look at the piece of paper and find some of these shortcuts helpful. So you'll use them.
- After a while, these shortcuts will get into your muscle memory and you'll no longer need the piece of paper.
- When you are coding with VIM, detect annoying patterns: For example, I need to jump code, I need to replace often, I need to be able to select some text this way, I need GIT integration. You get the point.
- Put these observations on a list. Pull 2-3 items (shortcuts) from this list and tag another paper to your screen. Pull 2-3 items (plugins/functionality) and enhance your VIM.
- After a few years, your VIM will become extremely customized. You'll actually have trouble writing code on any other IDE.
- Here is mine: https://github.com/omarabid/vimrc https://github.com/omarabid/vimrc
Other bonus tips:
- Use GIT to keep track of your VIM configuration.
- Write a README file for your configuration. Other things that I should do: Update the README often, and add screenshots.
ps: in case you haven't noticed, I'm a die-hard VIM fan.
- ManDeJan 8y agoAfter ~2 years of switching between using and not using vim you have convinced me to try and make my own config
- jokh 8y agoTry github.com/amix/vimrc to start off. It has a nice look. You can then add more shortcuts/customize further as you gain more experience with vim.
- ma2rten 8y agoI recently made my own vim config. It was very easy and wish I had done it earlier.
- Bekwnn 8y ago2 biggest things for me were vimplug (or something to make plugin installation easy) and NERDtree, which lets you open a window for directory navigation, set bookmarks, and change your current directory path for other vim commands. I'm also super partial to Hydrangea scheme https://vimcolors.com/690/hydrangea/dark https://vimcolors.com/690/hydrangea/dark That site is good for browsing for something you'll like.
- kbenson 8y agoIt's important to note the context these articles are usually presented in, and also most the responses, which is Vim for developers (or at its most general, Vim for sustained local use). The reason I bring this up is that there's a whole other set us use that is often overlooked, which is Vim as a standard tool for sysadmins. Any system you connect to will have Vi, and probably Vim. This makes it an ideal tool for sysadmins that might need to connect to tens or hundreds of systems to know how to use, and to have a fairly standardized behavior. In those cases, having a customized config can actually be more of a hindrance, because switching from a highly customized local Vim instance to a stock remote Vi/Vim instance can be jarring. For anyone who is primarily a sysadmin, I would recommend sticking with the default behavior (which is rich, and lends itself to being more and more useful and they become familiar with more an more commands), and making a minimum of local config changes and plugins to suit their needs (it's a trade odd. Just choose wisely). This makes life easier when you spend a significant portion of time on random stock Vim instances (and even if it only saved a modicum of time, it saves a lot of aggravation as you don't feel like you're working with missing limbs). Then again, I've always been one to do develop scripts remotely to help with tasks (all the easier to test int he correct environment), so other people's experiences may differ. I'm primarily doing software engineering now, so I load main vim instance with a fair amount of specialization (but probably less than most).
- vram22 8y ago>It's important to note the context of this article, and most the responses, which is Vim for developers (or at its most general, Vim for sustained local use). The reason I bring this up is that there's a whole other set us use that is often overlooked, which is Vim as a standard tool for sysadmins. >Any system you connect to will have Vi, and probably Vim. This makes it an ideal tool for sysadmins that might need to connect to tens or hundreds of systems to know how to use, and to have a fairly standardized behavior. In those cases, having a customized config can actually be more of a hindrance, because switching from a highly customized local Vim instance to a stock remote Vi/Vim instance can be jarring. That's a great point. I had mentioned something to the same effect, briefly, in the blurb for my vi quickstart tutorial, here: https://gumroad.com/l/vi_quick https://gumroad.com/l/vi_quick I first wrote that tutorial at the request of a couple of Windows system admin friends of mine (at a company where I worked earlier), who were tasked with managing a few Unix boxes, without knowing Unix. They used the tutorial and later told me that it helped them to quickly start using vi to do their work on those boxes, including editing config files, simple shell scripts, etc. Edit: Since vi is mostly a subset of vim, the tutorial works for vim too.
- ma2rten 8y agoAnother tip: For ed commands (the ones that are like :something) spell them out initially, for example use :substitute instead of :s. It's much easier to remember and you can use autocomplete anyway. Once you have the command down you can start to abbreviate it.
- ggm 8y agoI am more an nvi than a vim person but unless there was a significant change the : commands are ex not ed. I mean yes in principle their roots are in ed but ex is the command line editor mode of vi since it's inception
- nickjj 8y agoThis is almost exactly what I did while learning to use Vim over the last month. I ended up having 7x sticky notes around my monitor with around 80 commands and motions written down after the first week. Now 1 month later, I don't use them and have about 80% of the most used things memorized. It's not 100% brain dead automatic yet, but most come to me in a few seconds. Current vimrc[0] is sitting at about 40 plugins and every single one of them came from a direct need. [0]: https://github.com/nickjj/dotfiles https://github.com/nickjj/dotfiles
- killjoywashere 8y ago> After a few years, your VIM will become extremely customized. You'll actually have trouble writing code on any other IDE. This would actually be a significant detriment to many Vim and vi users who do system administration, because they can't rely on any customization when the drop into a terminal on a random server. The one thing I really wish the browsers would adopt is a reliable vi/emacs toggle for text entry windows. Vimium, vimperator, etc, they're never reliably available, always at the mercy of the upstream browser.
- davewongillies 8y agoIf you just want a vi/vim toggle for your browser, wasavi[1] is what you're after. https://github.com/akahuku/wasavi https://github.com/akahuku/wasavi
- crehn 8y agoOn the other end, here's my plugin-free vimrc: https://github.com/hoffa/dotfiles/blob/master/.vimrc https://github.com/hoffa/dotfiles/blob/master/.vimrc I work on a bunch of servers from various devices and want zero friction when moving around. It also conditions me to be efficient and comfortable, even when everything is not perfectly aligned to my sensitivities.
- Narishma 8y ago> - After a few years, your VIM will become extremely customized. You'll actually have trouble writing code on any other IDE. How is that a good thing? That's the major reason I typically do as little configuration as I can to the software I use.
- Jtsummers 8y agoBecause it’s your flow. I’m an emacs user and it’s the same sort of thing. At the end of the day I’m just a lot faster at the things I want to do because of the practice (learning what it can do) and customization (making it do what I need to do). Learning random IDE #25 for an employer just slows me down. Imagine if I made you use Dvorak (or QWERTY if you already use Dvorak) just because. You’d crawl. Unless the IDE brings a lot to the table, the thing I need most is the editor part. So I want it to fit me and my flow.
- ilovetux 8y agoI think specialization can be a good thing. With tools, specialization can make you faster and more effective for a variety of reasons. It is, however, a tradeoff with flexibility as you've pointed out. I think the balance we strike here is very personal and might have a lot to do with ones daily workload.
- tuxxy 8y agoDoes anyone know of any good refactoring tools for Python? I've been casually looking for a bit and haven't found anything that I really like yet.
- kmarc 8y ago> - Use GIT to keep track of your VIM configuration. My question is: Why? I use git quite exhaustively for my daily job, I also have my vimrc git-tracked on github, but TBH I cannot really see the point anymore :-)