Text Editors in Linux - Archive
Introduction:
This workshop will introduce how to use the vim command-line text editor within a Linux environment.
It will cover the basics on opening and updating a text file, how to navigate around the text, and how to search for terms.
After the workshop, participants will have the skills to use a text editor to create basic scripts.
Participants are expected to have an introductory level of experience using Linux from the command line – such as that provided by the Intro to Linux workshop.
Course Goals:
To introduce users, using the Linux command line environment, to text editors: Specifically vim.
Open, edit, update, save and quit a text editor.
Use the keyboard and shortcuts to navigate around the text file.
Use the command line to search for terms within the text file.
01 Getting Started
01.01 Login
Open up Chrome
Navigate to: https://southpass.arcc.uwyo.edu/
Start Beartooth Shell Access
01.02 Download Slides
02 Why do we need a Text Editor?
02.01: Using the Terminal/Command-Line
We have a non-GUI/non-Windows environment.
Unable to start a GUI/Window text-editor type application.
We’re using the command-line.
02.03: Available Text Editors
Just one of several available command-line based text editors.
02.04: Why vim?
Considerations:
What’s available on the system you’re using?
Can you install other editors?
What is your personal choice?
Note: On our Beartooth cluster, vi is an alias for vim – meaning if you start vi, vim will start.
03 Vim Tutor
03:01 Vim Tutor
Using the vimtutor to “teach by use”
Should be available on other systems you use vim upon.
Can continue to learn.
[arc-t05@blog2 ~]$ vimtutor
===============================================================================
= W e l c o m e t o t h e V I M T u t o r - Version 1.7 =
===============================================================================
Vim is a very powerful editor that has many commands, too many to
explain in a tutor such as this. This tutor is designed to describe
enough of the commands that you will be able to easily use Vim as
an all-purpose editor.
...
04 Vimtutor: Lesson 1: Cursor Exit Delete Insert Append
Lesson 1.1: MOVING THE CURSOR
Lesson 1.2: EXITING VIM
Lesson 1.3: TEXT EDITING - DELETION
Lesson 1.4: TEXT EDITING - INSERTION
Lesson 1.5: TEXT EDITING - APPENDING
Lesson 1.6: EDITING A FILE
04:02 Vimtutor Lesson 1: Summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
4. To delete the character at the cursor type: x
5. To insert or append text type:
i type inserted text <ESC> insert before the cursor
A type appended text <ESC> append after the line
NOTE: Pressing <ESC> will place you in Normal mode or will cancel
an unwanted and partially completed command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
05 Vimtutor: Lesson 2: Delete Move
05:02 Vimtutor Lesson 2: Summary:
06 Vimtutor: Lesson 3: Put Replace
06:02 Vimtutor Lesson 3: Summary
07 Vimtutor: Lesson 4: Search
07:02 Vimtutor Lesson 4: Summary
08 Next Steps
08.01 Next Steps on using Vim
vimtutor: Continue…
Google: Many online tutorials:
LinuxFoundation: Vim 101: A Beginner’s Guide to Vim
OpenSource: Getting started with Vim: The basics
FreeCodeCamp: How to Use Vim – Tutorial for Beginners
OpenVim: Interactive Vim tutorial
Cheat Sheets: (find what works for you)
08.02 Further Trainings: UWYO LinkedIn
08.03 Summary
In this workshop we have:
Introduced users, using the Linux command line environment, to text editors: Specifically vim.
Demonstrated how to:
Open, edit, update, save and quit a text editor.
Use the keyboard and shortcuts to navigate around the text file.
Use the command line to search for terms within the text file.