Category: Vim
Vimperator!
By Chee Ming on Nov 1, 2007 | In Technical, Exoweb, Vim | Send feedback »
Although I am a pretty conservative Vim user, my preferred method of interacting with the computer has always been a bit Vim biased. I have always wished that I could use Firefox with Vim style. In fact, check out how my Firefox looks like now:

This is made possible if you install the Vimperator plugin for Firefox. You can do most of the stuff that you are used to in Vim such as h,j,k and l for movement, ctrl+f, ctrl+b for scrolling, '/' (slash) for searching and etc.
I am pretty amazed that they also included an "Ignore mode" so that you can use the keyboard shortcuts in web applications like gmail, google reader and etc. Check it out and have fun!
Conservative Vim user
By Chee Ming on Oct 3, 2007 | In Exoweb, Vim | Send feedback »
I don't really configure my Vim. I am pretty happy using most of the default settings.
I guess I'll need to take some Vim lessons from Exoweb's Vim King.
Here are my MUST have settings for Vim:
syntax enable set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set autoindent set incsearch set hlsearch set mouse=a
The built in functionality for Vim is pretty good but sometimes it can be a real adventure searching for the answer. I guess I'll have to make a mental note to do it more often, if not it won't become a habit and I won't become an effective Vim user.
I've been running our daily scrums voluntarily during this holiday week and realised that I have to copy the IRC logs from my IRC chat client into our wiki system. There is one small issue because if I just do a copy and paste the generated wiki page wouldn't look very nice. To make it look nice, I need double spacing for the whole log.
I was asking myself how I could do this easily in Vim? I could just save it in a file and put it through sed. But I realised that I might need that functionality in Vim and decided to do a bit of searching for the answer. I stumbled upon this article and was reading it a bit.
Under the Executing Unix commands in vi section, I realised that you can do the following to read the output of ls or any commands into Vim.
:r !ls
Wow, that's pretty useful. I can imagine a lot of things that I might need that would benefit from that. I am just so lazy to pipe the output to a file and then open the file in Vim, or maybe even doing copy and pasting and sometimes getting the formatting a bit wrong. I am digressing because I still haven't found my answer yet. Reading a bit more of the article I found my answer, the solution looks a bit like this:
:1,$ !sed 's/$/\n/'
Very sweet indeed I told myself. I can imagine all the time I would have saved if I knew about this earlier. Okay, that is one more tip that I can put to use pretty often. I hope it was useful for anyone who stumbled upon this humble blog.
Note to self: Need to learn more of bash, sed, awk, sort, uniq and other Linux command line tools.
