Lab Assignment 2 Monday
Lab Assignment 2 Monday
1. Opening a File:
To open a file using Vim, open your terminal and type:
vim filename
Replace "filename" with the name of the file you want to edit.
2. Modes:
Vim Editor has different modes. The two main modes are:
• Normal mode (default): Used for navigation and manipulation.
• Insert mode: Used for inserting or editing text.
To switch from Normal mode to Insert mode, press ‘i’. To switch back to Normal mode,
press ‘Esc’.
3. Navigation:
Following points will be helpful for navigation in Vim Editor.
• Use the arrow keys to move the cursor.
• ‘h’, ‘j’, ‘k’, ‘l’ for left, down, up, and right respectively.
• ‘Ctrl + f’ for page down and ‘Ctrl + b’ for page up.
• ‘$’ to move to the end of a line, ‘0’ (zero) to move to the beginning.
4. Editing:
• Inserting text:
o Switch to Insert mode ‘i’ and start typing.
o Press ‘Esc’ to return to Normal mode.
• Deleting text:
o ‘x’ deletes the character under the cursor.
o ‘dd’ deletes the entire line.
• Undo and redo:
o ‘u’ for undo, ‘Ctrl + r’ for redo in Normal mode.
8. Exiting Vim:
If you are stuck or accidentally entered command mode without intending to, you can always
type ‘:q!’ to quit without saving changes.
10. Open the file Dataset1_facial_recog.txt using vim editor and perform all the above
operations.