Vim can be configured by creating a .vimrc file; for details, type :help vimrc-intro within Vim.
4.4.3.1. ...using vi with a GUI?
If you execute gvim instead of vi , a window will appear with a full graphical user interfaceincluding pull-down menus and a toolbaras shown in Figure 4-5 . Using the File→Save menu option, clicking on the Save toolbar icon, or typing the vi save command ( :w) will perform the same operation.
Figure 4-5. gvim: vi with a GUI
4.4.3.2. ...using other text editors?
In addition to vi , Fedora ships with a plethora of other text editors, including:
nano (an improved clone of the easy-to-use editor Pico )
mcedit
joe (the commands jstar , jmacs , or jpico will start joe configured to emulate WordStar , emacs , or Pico ).
emacs and emacs-x
kedit and gedit
All of these text editors are capable of editing just about any text file. Each has its advantages and disadvantages.
Since the choice of editor is very personal, take some time to experiment with each of the editors to see which one you prefer. In any case, I'd recommend knowing the basics of vi so that you can always fall back to it if you encounter a situation where your favorite editor is unavailable.
4.4.4. Where Can I Learn More?
The Vim web site: http://www.vim.org/
The vi help file and online tutorial: start vi , then type :helpand press Enter
Fedora can be booted into different runlevels , each of which starts a specific collection of software for a particular purpose. The most commonly used are runlevel 3, which starts the system with a character-based user interface, and runlevel 5, which starts the system with a graphical user interface. Table 4-11 lists the standard runlevels.
Table 4-11. Standard runlevels
Runlevel |
Description |
Purpose |
s (or S) |
Single-user maintenance mode |
Emergency system recovery work |
0 |
Halt |
Stops the system |
1 |
Single-user mode |
System administration |
2 |
(Multiuser without networking) |
(Not normally used) |
3 |
Multiuser, character-mode |
Normal system operation without graphical login; useful for servers |
4 |
(Not defined) |
(Not normally used) |
5 |
Graphical |
Normal system operation with graphical login. |
6 |
Reboot |
Restarts the system |
7, 8, 9, a, b, c |
(Not defined) |
Available for custom purposes |
The ability to choose the runlevel lets you save system resources (for example, by not running the graphical user interface when it isn't needed) or start the system in a minimal configuration so that you can fix problems.
You can change the runlevel on the fly, or configure your system to start in a different runlevel.
4.5.1.1. Choosing the runlevel at boot time
The Fedora boot menu can be used to specify the runlevel:
1. Press a key (such as the spacebar) when the Fedora Core boot display appears. This will reveal the boot menu.
2. Select the Fedora Core boot option you wish to use using the arrow keys.
3. Press the letter a (Append). An edit display will appear that allows you to append information to the boot command line.
4. Add a space and then the runlevel to the end of the list of boot options (for example, press space then 3 to select runlevel 3).
5. Press Enter to boot into the runlevel that you've specified.
If you have configured a GRUB password, you will be prompted to enter it before changing the boot options.
4.5.1.2. Changing the runlevel after booting
Take the following steps to change the runlevel after booting:
1. Obtain a root prompt using the su command:
2. $ su
3. Password: rootPassword
4. #
5. Use the init command to change to the runlevel of your choice:
6. # init 3
4.5.1.3. Changing the default runlevel
System administrators often configure servers to start in runlevel 3, freeing up memory to increase the server's performance.
The default runlevel is controlled by a line in the file /etc/inittab ; to change the default runlevel, edit that file using the vi editor:
1. Obtain a root prompt using su .
2. Start vi with the /etc/inittab file:
3. # vi /etc/inittab
4.
5. Find this line in the file:
6. id:5:initdefault:
7. Change the second field to the default runlevel of your choice; in this case, I've used 3 :
8. id: 3 :initdefault:
9. Save the file and exit vi . The change will take effect next time you boot the system.
4.5.1.4. Creating entries for different runlevels on the boot menu
The boot menu is configured using the file /boot/grub/grub.conf . You can edit this file so that options for various runlevels appear on the boot menu:
1. Obtain a root prompt.
2. Start vi with the /boot/grub/grub.conf :
3. # vi /boot/grub/grub.conf
4.
5. The file will look something like this:
6. # grub.conf generated by anaconda
7. #
8. # Note that you do not have to rerun grub after making changes to this file
9. # NOTICE: You have a /boot partition. This means that
10. # all kernel and initrd paths are relative to /boot/, eg.
11. # root (hd0,1)
12. # kernel /vmlinuz-version ro root=/dev/Main/root
13. # initrd /initrd-version.img
14. #boot=/dev/hdc
15. default=0
16. timeout=5
17. splashimage=(hd0,1)/grub/splash.xpm.gz
18. hiddenmenu
19. title Fedora Core (2.6.17-1.2517.fc6)
20. root (hd0,1)
21. kernel /vmlinuz-2.6.17-1.2517.fc6 ro root=/dev/Main/root rhgb quiet
22. initrd /initrd-2.6.17-1.2517.fc6.img
23. title Windows XP
24. rootnoverify (hd0,0)
25. chainloader +1
26. This example shows two Fedora Core entries for two different kernel versions. There may be additional entries for other operating systems (such as Windows) or additional kernels.
27. Find a Fedora Core entry (the bold lines in the example above) usually, the one with the latest kernel. Make an identical copy of it immediately after the original location in the file:
28. title Fedora Core (2.6.17-1.2517.fc6)
29. root (hd0,1)
30. kernel /vmlinuz-2.6.17-1.2517.fc6 ro root=/dev/Main/root rhgb quiet
Читать дальше