Using Markdown in Vim

Vim does a pretty good job of giving you a stylized preview of your Markdown. Especially when you consider the inherent limitations of an editor that must be able to run within the terminal. For example: Note that italics are handled differently in terminal Vim, because most terminals can’t display italics. If you prefer a more streamlined look, where your text isn’t cluttered by formatting characters for your bold and italic text you can “conceal them. [Read More]

Wrapping Text In Vim

Terminology: Hard Wrap vs Soft Wrap A “soft” wrap is when your text editor just makes the text look like it has been wrapped at the edge of the screen, when in reality it’s just one very long line. This is pretty obvious when line numbers are turned on because there are multiple lines of text but the line number to the left doesn’t increase. A “hard” wrap is when your text editor is configured to actually insert a newline character \n at a predefined width. [Read More]

Showing Invisible Things In Vim

Showing normal invisible characters Sometimes you want to see invisible things. Imagine you’re programming in Python, where it really matters if something is indented with spaces or tabs and the number used matters too. First we turn on list. Sadly, I can’t tell you why. The help docs are all about using lists in VimScript and not what this command does. What I can tell you is that this stuff doesn’t work without it. [Read More]

Configuring Vim

Configuring Vim A coworker recently said To change config in vim, you have to be a power user - including understanding how to configure plugins. I’m sorry to say that he is not alone in this belief. Vim won’t hold your hand by giving you a bunch of preferences windows with checkboxes to turn functionality on and off. So, yes it is “harder”, but it absolutely does not require “Power User” levels of understanding. [Read More]

Editing your .vimrc file

Vim’s core configuration file can be found at ~/.vimrc Without it you’ll have the default configuration: no syntax highlighting, no line numbers, etc.. ~/.vimrc is where you put all your global stuff, like turning on syntax highlighting by default. Editing your ~/.vimrc is something you shouldn’t fear. It’s actually pretty difficult to screw up your Vim configuration so badly that it’s unusable, and in a worst-case-scenario you can always tell vim to ignore it upon launch by saying vim -u NONE and then remove whatever you borked. [Read More]

Line Numbers in Vim

Geeks like line numbers. I think Vim geeks really like line numbers, because we use them for more than just finding a specific place in the code. Jumping to a line number Out-of-the-box you’ve got three choices. Just pick the one you like best and don’t worry about remembering the others. I’ve used the 1st one for years and never had any need for the others. Minimal typing Type the number of the line you want to go to followed by capital G. [Read More]

Opening Files in Vim

When you launch Vim It’s important that you always launch Vim from the command line and at the root of your project. I’ll explain why later in the section on projects, but for now just remember to start your work from there. From your shell We already saw this one in the hello world: $ mvim path/to/file.txt Every time you do this you’ll open up a new window. [Read More]

Working With Vim Plugins

Plugins are 80% of what makes Vim awesome. You take this great foundation, and then you pile on 25 years worth of developers going “ooh, I bet I can make it do this nifty thing.” The result is amazing, and as far as I can tell, all those ancient plugins still work. Everything isn’t perfect in the land of plugins. For a while it was download, and expand a zip file, or load a vimball (don’t ask). [Read More]