It moves the cursor to the beginning of the new line it is also used to confirm commands
Ngày đăng:
31/10/2022
Trả lời:
0
Lượt xem:
103
What is vi?The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate editors for UNIX environments include pico and emacs, a product of GNU.] Show
To Get Into and Out Of viTo Start viTo use vi on a file, type in vi filename. If the file named filename exists, then the first page (or screen) of the file will be displayed; if the file does not exist, then an empty file and screen are created into which you may enter text.
To Exit viUsually the new or modified file is saved when you leave vi. However, it is also possible to quit vi without saving the file. Note: The cursor moves to bottom of screen whenever a colon (:) is typed. This type of command is completed by hitting the
Moving the CursorUnlike many of the PC and MacIntosh editors, the mouse does not move the cursor within the vi editor screen (or window). You must use the the key commands listed below. On some UNIX platforms, the arrow keys may be used as well; however, since vi was designed with the Qwerty keyboard (containing no arrow keys) in mind, the arrow keys sometimes produce strange effects in vi and should be avoided. If you go back and forth between a PC environment and a UNIX environment, you may find that this dissimilarity in methods for cursor movement is the most frustrating difference between the two. In the table below, the symbol ^ before a letter means that the
Screen ManipulationThe following commands allow the vi editor screen (or window) to move up or down several lines and to be refreshed.
Adding, Changing, and Deleting TextUnlike PC editors, you cannot replace or delete text by highlighting it with the mouse. Instead use the commands in the following tables. Perhaps the most important command is the one that allows you to back up and undo your last action. Unfortunately, this command acts like a toggle, undoing and redoing your most recent action. You cannot go back more than one step.
Inserting or Adding TextThe following commands allow you to insert and add text. Each of these commands puts the vi editor into insert mode; thus, the
Changing TextThe following commands allow you to modify text.
Deleting TextThe following commands allow you to delete text.
Cutting and Pasting TextThe following commands allow you to copy and paste text.
Other CommandsSearching TextA common occurrence in text editing is to replace one word or phase by another. To locate instances of particular sets of characters (or strings), use the following commands.
Determining Line NumbersBeing able to determine the line number of the current line or the total number of lines in the file being edited is sometimes useful.
Saving and Reading FilesThese commands permit you to input and output files other than the named file with which you are currently working.
What is used to move the cursor to the beginning of a new line?The Home key moves the cursor to the beginning of the current line of typed characters, the End key moves it to the end.
Which key is used to move the cursor to the beginning of the document?The shortcut Control+Home/ C-Home, or Ctrl+Home is used to move the cursor to the beginning of a document.
Which is used to move the cursor on the screen?With Mouse Keys, you can use the numeric keypad on your keyboard—instead of the mouse—to move the pointer.
|