how to save in terminal

==================================================
<For a distribution with a /sbin/insserv command>
Log in as ‘root’, add the following comments to the third line in
/etc/init.d/ccpd, and execute the ‘insserv ccpd’ command.

BEGIN INIT INFO

Provides: ccpd

Required-Start: $local_fs $remote_fs $syslog $network $named

Should-Start: $ALL

Required-Stop: $syslog $remote_fs

Default-Start: 3 5

Default-Stop: 0 1 2 6

Description: Start Canon Printer Daemon for CUPS

END INIT INFO

================================================================
i wanna do the above procedure.
after i log in as root,
i use the command vi /etc/init.d/ccpd
then ,after that i add in the comments
after that , wat should i do to save it?

:w (save), :q (quit), :q! (quit w/o saving)
:h (help)