Finally got around to learning how to define keyboard shortucts in vim. It’s easy!
map <desiredkey> <targetaction>
So, for example, I split windows vertically and want to navigate via ctrl+pagedown or pageup.
Here’s what I did (include < and > when defining)
map <c-pageup> <c-w>h
map <c-pagedown> <c-w>l
Found via a vim wiki search
[Read more →]
Tags: programming · stuff
This concerns configuring an ATI Radeon 9600 under Linux to be dual head and run compiz-fusion. I’m not going into detail on what options make compiz run faster, just how to get two screens working well with compiz.
I’m posting this because I had a hell of a time finding all the info on it.
Update: This […]
[Read more →]
Tags: linux · stuff
September 28th, 2007 · No Comments
If you use Vim as your text editor, try this
:TOhtml
This will generate an HTML version of your source code, complete with color scheme. It’s pretty sweet.
Example here (opens a new window)
This just tickles me.
[Read more →]
Tags: programming · stuff · vim
Maybe someone will find this post and explain to me why SQL Server behaves like this. My question isn’t “how should I rewrite this query”, but “why does SQL Server act like this”. The behavior I see is that for some reason it’s easier to do TOP bignumber than TOP smallnumber. In my instance, TOP […]
[Read more →]
Tags: programming · stuff
When parentheses are important:
So, braces have higher precedence over do/end blocks. According to Pickaxe, when calling a method with no parentheses, the braces will be applied to the last method parameter, do will be applied to the invocation.
A Very Contrived Example:
def string_to_integer
if block_given?
yield.to_i
else
0
end
end
a = [1,2,3]
A) a.inject string_to_integer { ‘5′ } do |i,sum| i + sum […]
[Read more →]
Tags: stuff