Tag Archives: vim

assignment alignment in vim

I’ve just been reading some articles about programming vim from Damian Conway. * Scripting the Vim editor, Part 1: Variables, values, and expressions * Scripting the Vim editor, Part 2: User-defined functions The latter has a very useful example. function AlignAssignments() " Patterns needed to locate assignment operators. " let ASSIGN_OP = ‘[-+*/%|&]\?=\@<!=[=~]\@!’ let ASSIGN_LINE […]

Removing Byte Order Marks

I keep getting sent files, which are encoded in UTF-8, but include a BOM. Which is completely unnecessary. Thankfully, it’s pretty easy to remove with vim. Just load up the file and type in :set nobomb (docs for the bomb option) and save. Problem successfully defused!

vim completion

I’ve just found something rather useful in vim: :set wildmode. Normally in vim, you can use TAB to complete filenames. So you enter :e some/ve<TAB> and vim pads it out to :e some/very_long_filename.html. Lovely. But in a directory full of files with similar prefixes, it’s less than helpful. I hit :e acc<TAB> and vim expands […]

My Sysadmin Toolbox

After seeing lots of these at Linux.com recently, I thought I’d try to come up with my own list. I used to be a sysadmin (I’m now a programmer), and I’ve long felt that you really a good set of tools (and to know how to use them) in order to be most productive. zsh […]

A Month of Mac

It’s now been a month since my shiny new Mac arrived. Overall, I’m still really, really happy with it. I’ve bought NetNewsWire for feed reading and textmate for editing. I’m a little concerned that I don’t have the source code for my editor, but we’ll see how that goes. I’m normally a devout Emacs or […]

Vim Syntax for Textile

I’ve been using textile more and more these days. It’s quite convenient for writing. But what’s annoying is that there is no support for it in Vim. So, after a bit of messing around with the vim manual Your own syntax highlighted, I now have textile.vim. It’s definitely a first attempt at such things. There’s […]