JP Vossen on 15 Jun 2015 22:00:42 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Vim

At PLUG W we had some Vim confusion and discussion, so without kicking
off a religious war, I though I'd throw some resources out there.  This
would also be great fodder for a preso and demo.

The most critical thing is probably ESC:q!  That is hit the ESC key then
literally type ':', then 'q' then '!' and that will exit without saving
any of the changes you just made by accident while trying to exit.  Then
`apt-get install nano` or `yum install nano` and get your work done
until you have time to study up on Vim a bit.  :-)

The next most critical things are a toss-up between:
	:help <thing>

`vimtutor` is what it says it is.  ":help" is the Vim help command
(literally type ":help" or ":help motion.txt" or something).  "i" puts
you into "insert" mode where you can type and move around in a very
limited way.  The ESC key exits back to command mode, where you can ":x"
to save (if needed) and exit.  ":x" is similar to the perhaps more
common ":wq" but that forces a write then quits, while ":x" only writes
if needed and is one fewer keystroke.

Why use/learn Vim?  Because it is *always* there on any
Unix/Linux/BSD/Mac (OS X+) and it's available in command line and/or GUI
for anything and everything else.  There are many other answers but they
are a slippery slope into religious war.  For some other pretty neutral
thoughts, see  Note that gVim is
a GUI version, which can be really handy because it allows use of menus
and mice to ease into Vim.  See also "Cream" [1] and `vim -y` [2].

By the way, Vim is "vi, iMproved."  vi was written just about 40 years
ago as a VIsual layer on top of `ex` [3], and the details are
fascinating.  (Well *I* think they are! [4,5])  Take a look at the
ADM-3A terminal keyboard layout in [4] to see why the modal nature and
all the crazy keys, including ESC, actually make sense.  (Bonus re: ESC

There are a ton of free resources on the 'Net, and I'll mention some,
but if you like books get:
	_Learning the vi and Vim Editors_ and
	_Practical Vim_ in that order

_Practical Vim's_ subtitle is "Edit Text at the Speed of Thought" and if
you are a good touch-typist and you read this book and practice...well,
see for yourself.


* Run 'vimtutor' on the command line
* 572 page
* 20 page(!) Quick Reference Guide
* 2 page

[3] `ex` lives on in "ex" mode in vi and Vim.  Among other things this
make Vim scriptable!
[6] Remapping Caps Lock to ESC can be a giant PITA because how you do it
(if it's even possible) varies widely per OS and distro.  There is a
long discussion at with
some great ideas.  But I don't think you can beat the "jk"/"kj" "smash"
mapping at

JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --