Posts Tagged ‘Vim’

July 6th, 2007

Arrrrrrgh Ubuntu (1)

Tags: , ,

Error: Required vim compiled with +ruby
E117: Unknown function: rubycomplete#Complete
I had this magic vim-ruby package installed, but it wouldn’t let me :rubydo or use Ruby omni-completion in Vim. I had to force-uninstall every vim-related package. It whined when I did that because apparently some system package had a dependency on vim.
It turns […]

June 28th, 2007

Vim: Expression register (0)

Tags:

Today’s Vim discovery is the expression register, “=. I wanted to insert the value of a Vim option (namely iskeyword) into a buffer so I could edit / play with it. Normally I’d have done
:set iskeyword?
to display the value, and then typed the result out by hand by reading what it output. […]

June 27th, 2007

Vim jumplist (0)

Tags:

To continue my habit of writing this stuff out in an attempt to work more Vim commands into my everyday ingrained vimming habits and memory: CTRL-I and CTRL-O (in Normal mode) are enjoyable. I have long used ” (two single-quotes) to jump me back and forth between the last cursor jump and the current […]

June 21st, 2007

Mmm… unit tests (3)

Tags: ,

I upgraded my old Ruby 1.8.2 install at work to 1.8.6 today. Thank god for unit tests. A good dozen tests of 900 failed, in the code I’ve churned out over the past year. If I hadn’t caught the bugs all right away they would’ve wreaked havoc. I’ve learned the hard […]

May 9th, 2007

Firefox + vim (2)

Tags: ,

In about:config change view_source.editor.external to true and you can pick a “View Page Source” editor via view_source.editor.path. /usr/bin/gvim for example. Wish I’d have discovered that a couple years ago.

April 25th, 2007

Vim Ruby (0)

Tags: ,

Note to self: vim-ruby’s matchit support is delicious. It lets you bounce on the % key to switch between class/end and def/end and if/else/end.
For whatever reason, at work when I installed Vim, matchit was installed by default along with Vim, but you have to manually copy it to the proper directory and […]

March 5th, 2007

Vim regexes (7)

One thing I very much miss in Gentoo is controlling what is compiled into my Vim. You need to enable perldo and rubydo support at compiletime. Gentoo had USE flags to do it. In Ubuntu I get perldo but no rubydo by default, which is annoying.
The reason I need perldo/rubydo is because […]

February 19th, 2007

Vim brute force (0)

Tags: , ,

In the end all code ends up as machine language. Generally the way to write effective code is to use a high-level language and let a smart compiler expand a tiny bit of high-level code it into a great deal of low-level machine language.
But another way I seem to end up doing this is […]

January 31st, 2007

Vim: g + norm (0)

Tags:

My recent favorite vim trick is g + norm. Look in :h g and :h norm to see what these do. Basically g will search all lines in a file for some pattern, and then do something on those lines. norm will take a string of text as an argument and process […]

January 11th, 2007

Unique-ify lines in Vim (0)

Tags: , , ,

If I want to get rid of duplicate lines in a text file, in Linux I can simply pipe it through uniq. Windows doesn’t have an equivalent (or else I don’t know about it). There may be a Vim equivalent also, but I don’t know it if there is. Instead you can […]