msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

14 Jul 2010 Indent/format an entire file using vim

You can format/indent an entire file using the vim editor and the gg=G command.

    gg - Goto the beginning of the file
    =  - apply indentation
    G  - till end of file

If you decide not to indent your file, just press u to undo the last operation.

Tags:

Posted by

17 Oct 2007 Switch off annoying bell/beep in xterm

My colleagues don’t like all the bell/beep sounds I make when I’m working in a xterm through my putty ssh client.

To please them I’ve added this line to /etc/inputrc to disable bell on tab-completion.

set bell-style none

Tags: , ,

Posted by

09 Sep 2007 Make arrowkeys in Debian vi work

Put this line in your ~/.vimrc

set esckeys

Another alternative is to install vim

aptitude install vim

And do the necessary changes on the settings file /etc/vim/vimrc

Tags: , , ,

Posted by

07 May 2007 vim search and replace text

Different ways of replacing text etc.

Replace every occurrence of pattern1 (pat1) with pat2

:g/pat1/s//pat2/g

Replace every occurence of pattern1 (pat1) with a newline

:g/pat1/s//\r/g

In practice this inserts a newline after every occurence of pat1.

Tags: ,

Posted by

30 Apr 2007 Change all entries in DHCP from 0: to 00:

This command have to be performed in the vim editor:

:%s/hardware ethernet 0:/hardware ethernet 00:/

Tags: ,

Posted by