1. Taming Vim — 1. Introduction

    This is the first part in the series Taming Vim, a series focused on improving the intermediate Vim user’s understanding and operation of the text editor.

    Preface

    Firstly, I’d like to thank all the people who put their .vimrc on the Internet, with comments for everyone else to learn from, these have been incredibly helpful. I’d also like to thank Piet Delport for being patient with me and encouraging me to learn, Tristan Seligmann for introducing me to Vim many years ago, and JP Viljoen for suggesting I write this.

    Secondly, I feel it is important to state that my primary use for Vim is writing source code. Today source code is still text and many concepts apply equally as well to prose as they do to source code, if not better, so while not everything in this series may be relevant to prose there are still some general concepts that can improve programmers and writers alike.

    Finally, I write this as someone who, until recently, was generally frustrated with Vim and, to some extent, my own inability to adequately wield some of the power of this editor. I write this in an attempt to help the people who feel the same way.

    Introduction

    Obvious as it may be, you’ll want to mentally steel yourself for the fact that you will be doing a lot of reading in the process of widening your Vim knowledge. Following on from that, it is important to habitually consult :help (:h for short since you’ll be typing it a lot) for any options or commands you encounter, especially if you think you already know what they do.

    Jim Dennis’ extremely comprehensive answer explaining the “Zen” of Vi is a great read, read it. If you find yourself doing something repetitive or lengthy (like deleting the text inside of quotes the long way) it’s extremely likely that you can apply Jim’s advice to greatly improve your productivity.

    My own .vimrc is available on Launchpad, along with my .vim directory.

    Color scheme

    While the attractiveness of something’s appearance is a deeply subjective topic, I cannot stress enough the importance of finding a color scheme that allows you to comfortably read large bodies of text for extended periods of time. Be wary of beautiful bright and colorful schemes like Monokai for these may be the cause of eye fatigue.

    I’ve recently switched to Solarized, as a programmer there is something comforting about a color scheme based on practical facts. I suggest enabling the highest contrast mode for Solarized by adding let g:solarized_contrast='high' (before the colorscheme command) to your .vimrc.

    There are many Vim color schemes to try on the Internet, Google is your friend.

    Fonts

    Like color schemes, fonts are deeply subjective and you should carefully weigh your own tastes against anyone else’s opinion. I use Monaco (sans anti-aliasing) on my Mac and Consolas on my Windows machine, Dan Benjamin has a good write up and there are also about 31 million other things on the Internet about programming fonts.

    I find it convenient to use a font size big enough to be comfortable to read even beyond normal typing distance but also small enough such that a vertical split, of a maximized OS window, leaves me with two windows at least 80 columns wide.

    Fade to grey

    Take your time deciding on a color scheme and font that feels comfortable (and attractive) to you. I encourage you to stray from the defaults and suggest trying a change for at least an hour before making a decision.

    In the next installment I’ll talk about some Vim plugins and why they’re worth using.

Notes

  1. layzie313 reblogged this from preciselythat and added:
    This is the first part in the series Taming Vim, a series focused on improving the intermediate Vim user’s understanding...
  2. preciselythat posted this