December 4th, 2004

Programming

Saturday, December 4th, 2004

While programming today, I came up with some nice vim bindings. If you use vim, and want tags-powered “intellisense-like” stuff, use this. Also thrown in there are hotkeys for :Tlist (indispensible vim plugin) and saving quickly (I save often, so I like to have a single key in either normal or insert mode).

” intellisense - yea well close enoughnoremap <F2> mz<C-w>1]noremap <F3> <C-w>c`zanoremap <F4> <C-w>11_

” for insert mode, goes back to unmatched brace” so it’s good for function prototype lookupsinoremap <F2> <ESC>mz 999[(b<C-w>1]

” tlist hotkeysnoremap <F8> :Tlist<CR>noremap <F9> :TlistUpdate<CR>

” save hotkey for normal and insert modesnoremap <F10> :w<CR>inoremap <F10> <ESC>:w<CR>a

Algorithms and vim

Saturday, December 4th, 2004

I spent about 5 hours today doing algorithm homework/studying. I like that class a little more now, even though some of it is a pain. Divide and conquer and dynamic programming actually are powerful concepts, once you get a feel for them.

Then I came back to my dorm, ate some food, and played with vim for literally 2 hours. I guess that was a waste of time, but I learned so much about this editor. Now I feel I can be twice as productive when I code. Especially with all the stuff I implemented for prototype previewing in my vimrc, and with all the support for ctags vim always had but I never used. Wow, this is one powerful programmer’s editor.

Matt has been telling me that I should use emacs with vi emulation (viper), and then I’ll get access to all that great emacs stuff. Maybe. I have nothing against it, except that emacs seems like an operating system unto itself. Eh, it doesn’t matter I guess, I just need to know one of the two well. They are both portable, and run on all major platforms.