Tuesday, October 21, 2008

VIM

Since my migration to linux I've set myself on a quest to find the ultimate text editor (haiiah, lebay :p). well anyway I have my own requirement for such a tool
  • lightweight and fast
  • syntax highlighting and formatting
  • tab-editing
  • auto-complete
  • flexible and configurable (support custom script)
when I'm still using windows, I didnt really pay attention on those criterias, coz most of the time I'm stuck with an IDE(not just a text editor). Komodo, eclipse to name a few. and just lately I realized that most of the tool those IDE provided is less usefull for me(well mostly because some of em isn't free :D), I just need the editor, and yes syntax highlight and formatting is a tempting feature for sure. So I started to googling, to find a good editor which presumably free, been trying this and that, and there it is VIM !.

VIM (Vi IMproved) is a console based / command line editor a charityware wrote by Bram Moolenaar, and available as default in most of linux distro (the silly part is that the whole time the one I'm looking for is right under my own nose yet I'm searching or downloading from various places). With a default plugin gVim (gnome version of vim) load up less than a second in my 1420 inspiron box, whoossh.... It support syntax highlight and formatting for most of programming/scripting language, and my favorite is the omni completion feature, its an auto-complete feature with a dozen of option and preferences to suit my need, it can use a dictionary file or just simply scan a whole directory to find the completion words.

Highly configurable, vim support custom script called vimscript (beside it's support on phyton, perl, and other script), which make it a lot more usefull for many editing purpose, theres a lot of ready made script from it's main site, some of the script I've been using are
  • NerdCommenter, this plugin helps to do any function of commenting and uncommenting, and it support comment for huge number of programming language and script,
  • snippets_emu, this is a wonderfull one, just type few letter and shift+tab(my mapping keys) and boom!the whole snippet of code is there! save a lot of time of typing, you could define your own snippet especially for something you'd type frequently
  • NerdTree, its like an explorer built in the editor, you can browse file and directory from it
  • TagList, you can tag a file of code or a whole directory ( in *nix u can use ctags), and jump between various tag in a file, this is a lot faster than using pageup-pagedown, or scrolling your mouse up and down to go to different section in your file
  • VimTip, for any of you that just start learning vim this plugin is a must!, every day it pops a tip bout what you can do with vim, contributed from various user all over the world.
  • and a lot of any other I cant mention here, I cant thx enough to every of you that develop these vimscript and plugins !
One unique thing about it, is that VIM is a modal-based editor, which means it responds input differently based on its mode(state), for example vim has (from several other modes) input-mode and command-mode, when in input-mode vim behave like any other editor, everything I type is considered as text input, but when in command-mode the typing goes as command, I love it so much coz it allows me to use most of vim's editing function without have to move my finger off my keyboard home keys !!, it makes editing process a lot more efficient!

Gosh, theres a lot of feature and advantage I just wont have enough time and space to tell em all, and yes, every day I always learn something new bout this editor, not so much different with most of you, I'm still a newbie vimmer.

Well, I have admit there are some drawback. The first maybe because of the learning curve, it takes some amount of brain power to at least start editing efficiently, and for me, it kind of hogging my short term memory the first time I learned it(but trust me, its a worthy investment)

until the day I post this, vim development is still going active (thx Bram!!), the last stable version was Vim 7.2, unfortunately it seems ubuntu wont put these updates in the main repo for at least another release cycle, well we can always download the source and compile it for ourself cant we :p

happy vimming !!

No comments: