My VIM .vimrc file for working with Python

Here is the VIM .vimrc file that I use to work with Python.

set nu
set ts=4
set sw=4
set sts=4
set autoindent
set smartindent
set expandtab
set smarttab
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd BufWritePre *.py :%s/\s\+$//e

It will

  1. Display the line number.
  2. Set tab stop to 4.
  3. Enable you to use < and > to indent or unindent a block in visual mode.
  4. Insert spaces instead of tab, when pressing the tab button.
  5. Automatically indent the next line after this keywords: if, elif, else, for, while, try, except, finally, def, class.
  6. Remove all trailing spaces during exit.
Posted in Python | Tagged , , | 10 Comments

Multiple column layout in LaTeX

To create a multiple column layout in LaTeX is easy. What you need is the multicol package.

\usepackage{multicol}

For example, to create a two column layout.

\begin{multicols}{2}
put the contents here
\end{multicols}

To manually break the column, use the \columnbreak command.

\begin{multicols}{2}
Column 1
\columnbreak
Column 2
\end{multicols}

If you are using standard LaTeX class, such as “article”, you can simple create a two column layout using the code below:

\documentclass[twocolumn]{article}
Posted in LaTeX | Tagged | 3 Comments

How to change Shiretoko codename to Firefox

Shiretoko is the development codename for Firefox 3.5.x.

To change the User-Agent identification to Firefox,

  1. Enter about:config in the address bar.
  2. Enter general.useragent.extra.firefox in the field at the top.
  3. Change its value from Shiretoko/3.5.4pre to Firefox.
Posted in Linux | Tagged , , , | 3 Comments

Masjid al-Hamidiah, Kg. Genayat, Gerik.

Masjid al-Hamidiah, Kg. Genayat, Gerik.

Posted in Travelog | Tagged , , , , | 4 Comments

LaTeX editor with live preview pane for Ubuntu/Linux

Gummi is a lightweight LaTeX editor written in Python/GTK+ released as open-source software under a dual MIT/Beerware license, and was written by a BSc student of Artificial Intelligence at the University of Amsterdam, Alexander van der Mey.

Gummi

The main feature of Gummi is that the Preview Pane will update as you are typing. In my opinion, this feature is good if you are learning LaTeX.

Give Gummi a try, and tell me your opinion.

Click here to download.

Posted in LaTeX | Tagged , , , , | Leave a comment