My Site
Categories
Blogs
Useful Links
My Introduction
Written by: Johannes Sasongko (sjohannes)

Adam has kindly let me post here, and it’s only fitting that I use my first post to introduce myself. I’m Johannes Sasongko, I live in Brisbane, Australia, and I’m currently studying for my IT degree. I’m involved in a few open-source projects at the moment: Ruby.NET (as tester), Exaile (as programmer), and K-Meleon (as bug triager / BTS cleaner, though the quality of the recent versions has left me with little work).

Following Adam, and in the spirit of this site’s domain name, I will of course post Vim tips after my posts. And since this is his blog, I’ll be writing about things that he would be interested in. I have little interest in leaving ‘Web-space junk’ anyways; the signal-to-noise ratio of the ‘Net is already bad as it is.

vim tip: Indentation

Vim has a few settings you can use to configure the indentation of your code. expandtab (et) is a boolean setting that does what it says, it specifies whether to expand tabs into spaces; set noexpandtab (noet) to disable it. tabstop (ts) specifies how wide tabs characters are displayed. softtabstop (sts) specifies the ‘virtual tabstop’, the tabstop that you feel when you press Tab or Backspace. shiftwidth (sw) specifies the indentation applied when using autoindent (e.g. the line after an if statement will get indented by this amount).

For example, while working with Exaile, you have to :set et sts=4 sw=4 because Exaile always uses four spaces for indentation. However, while editing a makefile you would normally set noet and use the same number for ts, sts, and sw.


File under: Miscellaneous
Comments:

No comments have been added yet


Add a comment:

Name:
Type Vim Here:   (It's a human test)
Email Address:   (optional for reply subscription)
Comment:   
 
Note: If you enter your email address, you will be subscribed to this article and will recieve comment updates via email. This is the only thing your address will be used for. A link will be provided at the end of each email that will allow you to unsubscribe should you need to, or you can go to http://www.vimtips.org/unsubscribe to unsubscribe from any/all updates.