/ factorpad.com / tech / linux-essentials / vim-command.html
An ad-free and cookie-free website.
Beginner
Learn to edit text with a fast local editor at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux vim Command Summary with Examples (3:38)
Our fifty-seventh word, or command to memorize is
vim
from our category
Text.
vim
allows you to edit text files.
-options | description |
---|---|
-h ,
--help |
Print help screen |
Esc: help |
Internal help manual |
Esc :q |
Internal command to quit |
Recall from video 20 on nano
and
video 56 on emacs
, I'm introducing
three text editors, so you know what's out there, but not to dive into
the functionality.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The vim
command has
over 50 options and the argument is a text file you'd
like to edit, and because vim
is a
highly-customizable text-editing program, its list of internal
keystrokes is beyond our scope here.
Like most commands, help is available with double-dash
--help
. Once inside vim, see internal
help by hitting the escape key
Esc
, then
:
, then typing
help
and
Enter
.
To leave, hit escape Esc
, then colon
:
,
q
, and
Enter
.
So why is vim
an important command?
Well coders spend a lot of time editing text, often without taking
hands off the keyboard, so evaluate if
vim
is for you.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's start with the
vim --help
option, and redirect it
>
to a file called
video57.txt
, similar to what we did in
video (tutorial) 56.
Next, type vim
and that filename
video57.txt
.
Here it is, you can use arrows, and
PgUp
and
PgDn
to scroll. Here we only have time
for this quick look, unfortunately.
So, to quit, type that combination
Esc
,
:
,
q
and
Enter
.
And last, let's head back in without a file
(using vim
).
And here the Esc
,
:
,
help
, and
Enter
. Here's some information, so
please review this later.
And then let's leave. Here we go Esc
,
:
,
q
, and
Enter
.
Very good.
Okay now you know how to use vim
.
And you know the syntax for commands, options and arguments.
One last tip about the vim
command. So showing you emacs
quickly
here was meant to kick off your journey and should you work best in
a GUI, both programs are available there too.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the vim
(editor) command.
To be totally fair, this tutorial is the simpleist of introductions. My preferred editor is now vim and I'm working on a tutorial dedicated to it. Sign up for reminders so you're informed when it comes out. Thanks, -Paul
Links below offer an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, and other Vim content found here.
This whole website is edited by me, part-time, using the Vim editor, so I know first hand how powerful Vim can be once you make it over the steep initial learning curve. Check out other Vim resources here if you want to learn to code and edit faster.
emacs
command,
hit Back.history
command. Click Next./ factorpad.com / tech / linux-essentials / vim-command.html
A newly-updated free resource. Connect and refer a friend today.