| Terminology |
Definition |
| Graphical User Interface (GUI) |
An environment for passing commands to a computer by using a graphical, mouse-driven interface rather than by using text-based commands |
| Command Line Interface |
A text-based interface between the user and the operating system that accepts input in the form of commands |
| Text Editors |
An application that enables you to view, create, or modify the contents of text files |
| Secure Shell |
An application protocol supporting secure tunneling and remote terminal emulation and file copy. SSH runs over port 22 |
Linux Stores most of its configuration files in text, and there are some versons of linx that can be deployed that have no graphical user interface. That being said there are many text editors that you can use in Linux through the CLI
- vi - A visual text editor originally created for Unix and was later cloned into free and open source software
- vim - The Default text editor in most Linu distrobutions
- GNU Nano - A small user-friendly text editor
- Emacs - A flexible,powerful, and popular text editor used in Linux and Unix
- gvim - The graphical version of Vim
- gedit - A simple yet powerful GUI-based text editor used in GNOME
Vim is the vi imporved editor, and comes preinstalled on most linux distro's
- Vim has different mode and they are switched between using:
- ESC - Enters the command mode
- : Enters execute mdoe
- i Eners insert mode
¶ Command Mode
Command mode is a powerful way to interact with a text document in Vim
-
To move to the top, bttom, or specified line in a file:
- gg - Moves to the top
- G - moves to the bottom
- 42G - Moves to line 42
-
To move the cursor around the text
- h - Moves the cursor left
- j - Moves the cursor down
- k - Moves the cursor up
- l - Moves the cursor right
-
To delete a word, a line, or a specified number of lines of text:
- d - Deletes word at cursors position
- dd - Deletes line at cursors position
- 3dd - Deletes three lines at cursors position
-
To copy and paste lines of text:
- yy - Copies the line at the cursors position
- p - Places the copied line
-
To Save and close the file
- ZZ - writes the file to disk and exits Vim
- While execute mode has several commands to use the most common commands in execute mode are the ones used to write and quit the program
- :w - Writes to the disk
- :w - new-filename
- :q - Quits Vim
- :wq - Writes and quits
- q! - Quits Vim without changes
- Insert mode is the most commanly used interface in VIM, as this is the mode that you use to edit text
- You can enter insert mode in many different ways though i is the most common
- i - inserts text before the cursor
- I - Inserts text at the beginning of the selected line
- a - Inserts text after the cursor
- A - Inserts text on a new line below the selected line
- o - Inserts text on a new line below the selected line
- O - Inserts text on a new line above the selected line
You can split Vim into two or more horizontal windows using the key combo Crtl+W and you can split Vim into two or more vertical windows using the key combo Crtl+W v, You can also cycle between the windows using Crtl+W w