Thursday, 3 October 2024

 Introduction to vim, nano, gedit, gvim LAB

 

1. Vim: The Modal Editor

  • Open Vim: In a terminal, type vim.
  • Navigate: Use the arrow keys to move around the text.
  • Edit: Press i to enter insert mode, then type your text. Press esc to return to normal mode.
  • Save and quit:
    Type :wq and press Enter.
  • Image of Vim editor in normal mode

2. Nano: The Simple Editor

  • Open Nano: In a terminal, type nano.
  • Edit: Type your text directly.
  • Save and quit: Press Ctrl+X, then Y to confirm, and Enter.
  • Image of Nano editor

3. Gedit: The Graphical Editor

  • Open Gedit: Click on the Gedit icon in your applications menu.
  • Edit: Use the mouse and keyboard to edit your text.
  • Save and quit: Click "File" -> "Save" and then "File" -> "Quit".
  • Image of Gedit editor

4. GVim: The Graphical Vim

  • Open GVim: In a terminal, type gvim.
  • Navigate and edit: Use the same commands as Vim, but with a graphical interface.
  • Save and quit: Type :wq and press Enter.
  • Image of GVim editor

Lab Exercises:

  1. Create a new file: Use each editor to create a new file named example.txt.
  2. Write some text: Type a few lines of text into each file.
  3. Save and quit: Save the files and exit each editor.
  4. View the files: Use the cat command in the terminal to view the contents of the files.
  5. Edit the files again: Open each file again and make some changes.
  6. Save and quit: Save the changes and exit the editors.

No comments:

Post a Comment