August 27th, 2009
vim is a command line text editor popular among Linux and Unix users. It is an extension of the famous vi editor, and is (as I see it) one of the “big two” editors in the open source world, the other being emacs. These two are often seen in techie comic strips and are frequently at the heart of deep-felt religious debates.
I’ve always known enough about vim to use it at a basic level. When developing on Linux, you inevitably need to use it at some point, usually when doing some work on a remote server. I had been fumbling along with the fairly decent jEdit for some time; it did all I needed it to do and served me quite well, but I decided that at some point I would have to take a leap of faith and move to that higher level of development know-how; I would have to fully learn one of the big two. I would have to learn vim (I tried emacs once but I just didn’t like it that much!).
The learning curve is pretty steep though; steep enough to keep me from using it seriously until now, and if it wasn’t for a couple of things that happened recently, I may not have taken the plunge. An ever increasing sluggishness presumably caused by my use of several Java apps and the discovery of the rather nifty Grep plugin for vim pushed me over the edge: a want to drop jEdit and the one tool I needed to do my work, a “find in files” type function for my editor of choice.
It’s been a taxing week. Every little thing that is so instinctive in your old editor needs to be looked up on the web, noted and memorised; and with vim, such things are usually radically different. Even saving a file requires the command :w, whereas in most other IDEs and editors it is the classic Ctrl+s. Yet, despite all this, I am starting to feel the power behind it, and can understand the decades of praise and hype that it has received. The major benefit is that you never need to use your mouse, and with it running directly from the command line, you can switch to another shell to do anything else you need to do, again without the mouse. The “command mode” allows you to navigate around the document without even using the arrow keys, meaning you can do your work without your fingers even leaving the home keys! Talk about efficient. (I am finding my general typing skills improving as I use vim more and more; another thing I’ve been meaning to work on that is being fixed by the switch.)
As mentioned, I noted down some of the commands I looked up and wanted to remember; some of which are listed below. I also found the VIM Quick Reference Card very helpful and had to laugh at a Vim Introduction and Tutorial:
I often tried to learn the great Emacs editor/IDE/operating system. The last time I tried it, I spent some time getting comfortable with it until I wanted to customize my .emacs file.
That was the point when I entered vi .emacs. As soon as I realized what I’ve done, I knew that Vim has won me over a long time ago.
Anyway, here’s my list:
- gt, gT – goto next/prev tab
- Rgrep
- Rgrep PATTERN *
- :ccl – close quickfix buffer
- :cwindow – open quickfix buffer
- quickfix
- :let Grep_Default_Filelist = ‘*.c *.cpp *.asm’
- :ls – list all buffers
- :b 1 – jump to buffer number 1
- ctags -R *
- ctrl ] – jump to sub/method definition
- ctrl t – go back to where you came from
- ctrl i and ctrl o – traverse the tag stack
- ctrl G – show current filename
- :e – reload buffer from disk
- ctrl [ – same as ESC; exit editing mode
- * – jump to next occurrence of word under cursor
- # – jump to previous occurrence of word under cursor
I urge you to use and learn this great editor, maybe starting with some of the resources mentioned here. Even from my brief time using it, I can tell that the effort is more than worth it in the long run. For years it has been designed and refined to make editing code fast, easy and intuitive. I’m the words of a friend and former colleague, vi rocks man!
August 8th, 2009
What’s next for MaluriView.com?
I’ve just launched, yet this is really just the beginning. Here’s a few things I plan to explore next…
Wordpress: Own Theme
Wordpress is a great backend, and its full range of features let me get up and running quickly without getting involved in any of the details of developing a website. One feature that helped me was the ready-made themes on offer, and to get to launch as soon as possible I decided to use the delightful Copyblogger theme by Chris Pearson. Ultimately though I’d like to return to my web development roots and design my own theme, hopefully inspired by the city of Kuala Lumpur.
Wordpress: Widgets etc.
I’d like to take a good look at what’s available for developers, and get to know the Wordpress codebase a little. I’ll start by building a couple of small widgets to help me build the side column as I’d like it. Looking forward to getting under the hood of this impressive system.
Promotion of some products
There are a couple of web based products that I have been really impressed with and would like to promote through the affiliate programmes they offer. I love to read and always recommend books to people, so have decided to do this a little more structurally by pointing people towards Amazon.com from book reviews I write here. I also love and am continually surprised by the quality of service and sheer amount of features offered by my hosting provider Dreamhost, so I’ll be recommending them as well.
Of course, I only recommend based on my opinion of a service, and would only do so if I really thought the product on offer was outstanding. As such you won’t see a lot of this kind of thing on MaluriView; only what I really like will be showcased in this way.
Google Analytics
It’s a great tool measuring your site’s usage and gives you the ability to really drill down into the information gathered, so before too long you will see calls to Google Analytics‘ tracking code loading along with the pages of this site.
More posts
And of course, the whole point of creating a blog is to write, and write I will! I intend to churn out posts over the coming months, building up a backlog of experiences and perfecting my writing ability in the process. I don’t expect much following for a long time, but that’s good in a way because I think I (and anyone new to this) needs that time to practice the art of blogging…
So, as you can see, plenty more to come.
August 5th, 2009
It has taken me a while to get here. What you see may look like just another blog, but the road to MaluriView has been a long one. This was mostly due to my attempts to mix building a blog with learning some new technologies and languages. Here’s how it went:
Django
I started with Django, an MVC (or should I say MTV) web development framework written in Python. With Python being a fairly hot language right now, I thought I could get to know it a little whilst also building a blog. It also has an “out-of-the-box” admin area so that you can perform CRUD operations on your models, which I thought would fit in pretty well with what I wanted to build. Although I found development quite comfortable, I felt I was trying to learn too many new things and wasn’t moving ahead fast enough. So Django was dropped and something more familiar picked up…
Catalyst
Perl. I’ve worked with it for several years now in my day job and although it has a bad reputation and is generally a bit quirky, if used responsibly can be very useful and powerful. Probably the hottest thing in the Perl world at the moment is Catalyst, a very elegant MVC framework. Since I know the language well, I expected the only learning curve would be the framework itself. I worked over the tutorial, and yes, it is a very nice framework which I really enjoyed working with, but I ran into a couple of problems.
Installing the latest version of the module (which uses Moose) was not trivial, and generally getting all the dependencies installed on my local machine was quite troublesome. I got there with some help from dh-make-perl, but it was quite a painful experience. When it came to installation on my Dreamhost account, I found the task even trickier (I didn’t manage to successfully install it there actually). All this got me thinking about keeping my dev. and production environments in sync with each other, about using local::lib + SVN, then it struck me that this level of organisation shouldn’t be necessary for a simple personal blog. Catalyst is definitely a great choice for a larger scale project, but I was wasting my time thinking about things that were just not relevant for what I really wanted to build. Catalyst was shelved for another day.
ModX
This CMS was recommended to me some time ago. Compared to a few others I’ve worked with, modX is nice and straight-forward and easy to set up. I got a release from the Evolution line installed locally and started to go about setting things up. The first thing I looked for was a plugin/extension for blogging, but instead found this article, which basically said modX is great for “websites” but if you are setting up a blog why not just use…
Wordpress
For years I’ve associated Wordpress with blogging, yet I never bothered to actually take a look at the project closely. Their homepage gave me the impression that they were a hosted solution, but I soon found the .org site where you can download their code for use on your own server. But before I downloaded anything I thought I’d check Dreamhost’s one-click installation section, and there it was top of the list. So fifteen minutes after considering using Wordpress, I had it installed any ready to configure on my hosting! Brilliant service from Dreamhost. And before long MaluriView was shaping up and quickly becoming a reality.
Many solutions were experimented with on the road to this blog, but ultimately the best-fit, fully featured product finished triumphant. This was mostly due to it having all the required functionality right there ready to use. Mixing in too many other experiments can easily leave you sidetracked, so best to find a solution that fits your project and focus on doing (and finishing) only what you set out to do.