Tag Archives: vim

I should have known better


I spent a some time configuring the Eventlog-to-Syslog service on my domain controllers, yesterday. A bunch of that time was spent trying to figure out why the service wasn’t able to read the config file I had created.

The upshot is that I had installed a 32-bit version of my text editor of choice. When I created the config file in c:windowsSystem32 using 32-bit Vim, the WoW64 file system redirector on Server 2008 R2 was transparently relocating that file to c:windowsSysWOW64. Then, when I tried to start the service, it failed to find or load the config file because it didn’t exist in the correct location.

So, I have replaced the standard gvim install with the native 64-bit version.

VirtualEdit in Vim

I really like vim, and here’s yet another reason. I can transpose columns in a text table, using visual block mode. As a quick example, let’s say I have a file containing usernames and display names. If I want to switch the order of the columns, here are the steps:

  1. enable virtualedit: set virtualedit=all
  2. move to the upper-left corner of a column I want to select
  3. invoke visual block mode: CTRL-V (CTRL-Q if CTRL-V is mapped to Paste)
  4. move the cursor (h,j,k,l or shift-arrow) to select the column
  5. delete the selection: x
  6. move the cursor to the location where I want to insert the column. (Note that with virtualedit enabled, I can move beyond the actual end of a line)
  7. paste the column: p

More info at vim docs online.