
VIM CLOSE ALL WINDOWS BUT CURRENT ONE KEYGEN

When you open an existing file, vi copies that file from the hard disk (or floppy, CDROM, etc.) to a buffer. Vi works with a buffer (a block of memory in the RAM chips). This is sometimes referred to as a "forced quit." To close a file to which changes have been made (such as text having been added or removed) without saving the changes, hit ESC, type :q! and then press ENTER. (The term "hit" is used here instead of "press" to emphasize that it is not necessary to keep the ESC key held down but just to press it momentarily.) To close a file to which no changes have been made, hit ESC (the Esc key, which is located in the upper left hand corner of the keyboard), then type :q (a colon followed by a lower case "q") and finally press ENTER. They will disappear as your typing extends down the screen. These are merely row markers and are not part of the text. Stretching down the left hand edge of the screen is a column of tildes (~). That is the cursor, and its role is to tell you what character or position in the file is currently ready to be acted upon. You will also notice a blinking black rectangle in the upper left hand corner of the screen. When commands are entered, the bottom line is used instead to show the entry of such commands. This information initially includes the number of lines and the number of characters in the file. The only exception is the very bottom line, which provides information about the file. When you open an existing or new file, you will notice that nearly the entire screen is either devoted to the text of the file or available for entering text. For example, to open an existing file named "pear" in the directory /usr/local/, type: Just type vi followed by the name of the file. The technique for opening existing files is identical. This example assumes that you have the proper permissions to create files in the /jane directory.) (As you probably already know from your study of Linux or Unix, the above example can be performed regardless of where your current directory is on your system because the path for the command begins with a root directory, i.e. For example, to create and open a file named "apple" in the directory /home/jane/, type: New files can also be created in directories other than the current directory. In Linux this is merely a matter of convenience (or habit), and it generally makes no real difference for the file because it remains a plain text file in either case. If you want, you could create the same file with an extension such as ".txt" added to the end of the file name.

This creates a new file named "apple" in the current directory (the directory or folder which is currently open on your all-text screen or your terminal window). If Vim, the most popular clone, is installed in your system, the initial screen will have some text in the center that begins with something like "VIM - Vi IMproved." vi clones will be discussed in more detail in a later section.)Ī second way to open a new file is by typing vi followed by the name of the file to be created, for example: This is no problem, as the core commands of vi are also used in the clones. The reason is most likely that your computer is using a clone of vi instead of the real thing. (You might initially see something different than the nearly empty screen described above. This topic will be covered in the next chapter. Do not be concerned about trying to type any text into the screen yet (although you will probably want to). You will notice that a (mostly) blank window opens after you type this command. This creates an empty file that will not have a name until you save its contents to disk (i.e., transfer the text you typed into it to your hard disk, floppy disk, etc. One is by just typing vi at the command line, like this: There are at least two ways to use vi to simultaneously create and open a new file. It can be convenient to add the icon for the terminal window to the launcher panel along the bottom of the screen, if it is not already there.) (In the case of Red Hat Linux, the terminal window can be opened by clicking on the icon of a red hat in the lower left hand corner of the screen, opening the System Tools menu and then selecting Terminal from that menu. A terminal window is a text-only window, and it can usually be opened by clicking on an icon (small image) of a computer screen. When it is in GUI mode (usually KDE or Gnome), vi runs in a terminal window. Vi can be used both when your system is in text mode (the entire screen is devoted to text and there are no images) and when your system is in GUI mode (the screen contains windows, images and menus).
