1. Copy the/etc/profile to/tmp/directory and use the Find replacement command to remove the white space characters from the beginning of the/tmp/profile file
%s/^[[:space:]]*\([^[:space:]]*\)/\1/g
2. Copy the/etc/rc.d/init.d/functions file to the/tmp directory, and add a # number to the beginning of the line beginning with a blank character for each line of/tmp/functions with the Find replacement command
%s/^\([[:space:]]\)*/#\1/g
3. Set tab indent to 4 characters in Vim
vim .vimrc 输入 set tabstop=4
4. Copy the/etc/rc.d/init.d/functions file to the/tmp directory and replace the/etc/sysconfig/init in the/tmp/functions file with the/var/log
%[email protected]/etc/sysconfig/[email protected]/var/[email protected]
5. Delete the # number at the beginning of all lines in the/tmp/functions file that begin with # and have at least one blank character after #
Vim Extended Command Exercises