« 13.05.05 | Main | 17.05.05 »

14.05.05

today i noticed that php has no yet been activated on my tiger. so ... let's go to the terminal, get vim at hand, and learn some basic commands for this powerful unix text editor!

sudo vim /etc/httpd/httpd.conf
use sudo because the file is read-only for mortals. enter password, and welcome to vim. now type:
/php[enter] . . . . . . . . search for the first occurrence of the string "php"
0 . . . . . . . . jump to beginning of the line
x . . . . . . . . delete character under cursor (just in case: use u to undo...)
n . . . . . . . . find the next occurrences of the previous search string
nn . . . . . . . . continue search
0 . . . . . . . . jump ...
x . . . . . . . . delete ...
:wq . . . . . . . . write and quit.

so far for editing the config file. now restart the http-deamon with sudo apachectl graceful and your password. and there is your php, up and running.

just to mention some more useful vim commands:
64gg . . . . . . . . jump to line 64
gg . . . . . . . . jump to beginning of file
G . . . . . . . . jump to end of file
i . . . . . . . . change to insertion mode ("textmode")
[esc] . . . . . . . . end insertion mode
u . . . . . . . . undo last command
[ctrl]R . . . . . . . . redo last undo
. . . . . . . . . repeat last command
dd . . . . . . . . delete current line
yy . . . . . . . . copy current line (yank)
p . . . . . . . . paste line after cursor (put)
:q! . . . . . . . . quit and discard changes
for a more complete reference, see http://tnerual.eriogerg.free.fr/vim.html