Vim

[Another in my series of posts on Vim]

If you’re a developer, you will often find yourself having to insert a line of dashes or hashes (#) or asterisks into your comments.  In this post I’ll show you how to do this quickly.  Memorize this because you’ll wind up doing this often.  Position the cursor to the beginning of a blank like (in command mode) and enter the following:

80a#<ESC>
more...

When I first learned how to exist on UNIX, in 1988, I used vi as my primary editor. During the next nine years I taught myself how to become a power user - migrating from the simple motion and copy and paste to more complex skills like marks and named registers. When I started graduate school I saw many of the professors and grad students using emacs.  I tried it out a couple of times, but it was not until 1997 that I decided to take the time to stick with emacs and take the time to learn the right way to do things even when I could get the job done faster in vi.

more...
© 2022 Aijaz Ansari
The Joy of Hack by Aijaz Ansari is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Powered by Pelican