... Vim?
Here's a little info about how/why I got into vim.
I've been a professional programmer since 1998. I've gone through a number of text editors, most of which I've felt pretty meh about. For a long time, I used an editor called Glimmer, simply because it supported multiple languages (and by supported, I mean it had syntax highlighting for them) and it had tabs. This is the basis of what I like in an editor. I stopped using Glimmer, because the author stopped putting out releases. Not necessarily that it wasn't a good editor.
I never really liked any IDE's, because even if they did support multiple languages, it was in a limited or style changing fashion.
When I started writing JBother in 2003, I switched to jEdit. I love this editor. It was simple and everything I needed. I started using plugins like the ProjectManager (which allowed you to manage different projects in an easy and intuitive way) and JavaStyle (which would format your Java code to whatever standards you specified). jEdit's power is in it's plugins. I would guess that it has somewhere aound 100 of them (I'm merely guessing here), from code formatting to CVS integration, whitespace management, FTP support, and more. A complete list can be found here. jEdit at it's base is a very very simple editor, and most people are put off by this. Most applications don't leave most of their power to plugins, although, I think it's the way to go :)
At this point, I had been using vim to edit config files on the server and such, and knew the very basics of navigation and searching. I had been very aware that it could be a very powerful text editor for programmers, but I was put off by the fact that there wasn't any easy way to manage multiple files - to me, this was essential. I did some googling early on, and found the minibufexpl plugin which allowed for so called "tabs" in your vim window, but it was ugly and didn't work how you expected it to sometimes.
About the same time I started Exaile (March 2006), I discovered project.vim. An example of this script/plugin can be seen here, on the left. This was what I was looking for. It allowed you to manage all the files in your project, quickly and easily. You can add files in directories manually by simply typing them in, or you can have the plugin do it automatically based on a filter. Once you have them in there, you can just hit enter on a file to open it in the window on the right, type \S to split the window on the right and open the file in the bottom, or you can even just double click on a file to open it. Beyond what I use it for, you can specify a vim script that will execute when you open a file, and one to execute when you close a file. Absolute awesomeness right here.
That same day I vowed to learn vim, and uninstalled jEdit. It has been one of the most productive things I've done since I started programming. In about 2 weeks, I was editing more efficiently and learning quickly.
Vim. If you're having second thoughts because of the learning curve, just stop it. You will thank yourself later.
vim tip: Counts
With every command given in command mode, you can specify the number of
times you want it to be done. For example, the letter k
moves the
cursor up one line, but if you type 5k
, it moves the cursor up 5
lines. I'm fairly sure this works with every command in vim.
Restored from VimTips archive
This article was restored from the VimTips archive. There's probably missing images and broken links (and even some flash references), but it was still important to me to bring them back.