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: vim
Posted by Hans-Henry Jakobsen
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
Posted by Hans-Henry Jakobsen
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
Posted by Hans-Henry Jakobsen
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.
Posted by Hans-Henry Jakobsen
This command have to be performed in the vim editor:
:%s/hardware ethernet 0:/hardware ethernet 00:/
Posted by Hans-Henry Jakobsen