Errata

Learning the vi and Vim Editors

Errata for Learning the vi and Vim Editors

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version 10
"Keystrokes" paragraph and everywhere else in the book.

In the mobi version of the book special keystrokes are not shown in a box, as stated in the text and as found in the other versions.
This makes the book difficult to read.

An example, is the ESC keystroke, in the follow text (about at position 10, in the mobi version):

Special keystrokes are shown in a box. For example:
iWith aESC
Throughout the book, you will also find columns of vi commands and their results:


Is it possible to generate a correct version in mobi format?

Thanks!

Mad77  Jan 01, 2012 
28
Table at top of page, Keystroke is jp and should be P

At this point, the j command hasn't been introduced, so this is probably a typo, but may have at one point been an example of using j?

amaday555  Mar 19, 2010 
Printed Page 86
Example 13

The following substitution command is given to delete all spaces at the end of every line:

:%s/\(.*\) *$/\1/

I tried this in vim version 7.2.330, and it doesn't work--for lines with more than one space at the end, it only removes one of them.

I think this is because the '.*' earlier in the pattern is greedy, and consumes as many characters as it can without causing the match to fail. The first space in the pattern forces the '.*' not to match the very last space in the line, but it matches all the other trailing spaces, leaving the '<space>*' to match zero characters.

A pattern that works (and is also much shorter!) is:

:%s/ *$//

(again with two spaces before the '*').

It's not an error, but I also think the analogous pattern for removing leading whitespace would be better than the one currently given as example 12, i.e.:

:%s/^ *$//

instead of

:%s/^ *\(.*\)/\1/

Thanks for a very helpful book!

Scott Cederberg  Jun 24, 2012 
Printed Page 87-88
Example 20

In this example, two commands are presented for moving any line that doesn't begin with a number to the end of the file:

:g!/^[[:digit:]]/m$

and

:g/^[^[:digit:]]/m$

The subsequent text says these two commands have the same effect, but they do not (in Vim 7.2.330). The first command moves blank lines to the end of the file, but the second does not.

This is because the second command matches lines whose first character is not a digit, which is subtly different from "lines that don't begin with a number."

In this case it's not clear whether one or the other is more useful, but in general this is an important distinction.

Scott Cederberg  Jun 24, 2012 
Printed Page 88
example 22

The solution for example 22 in the book can not exactly match the heading number.
%s/^[1-9][0-9]*\.[1-9][0-9.]* //
will also match 5.3.00.01,5.3.....,5.3.0.0.0 etc,but maybe these numbers can not be used as indexes of chapters.Please consider my solution :
%s/^[1-9][0-9]*\.\([1-9][0-9]*\.\)*[1-9][0-9]* //

xilongyu  Jan 13, 2011 
Printed Page 163
First paragraph after list of examples of the Remote options

The error is that this paragraph tells you in-order to see a more complete discussion of all command-line options ( it implies that this includes the just referenced command-line "-remote" argument ) to go to page 377 { Appendix A } for more details.

Well, I've gone to this Appendix A and looked up and down this reference and also further in the Appendixes, and found No mention of these commands. So in my opinion this is an Error.

This forced me to then turn to the internet and the Vim dot org's Support page in-order to accomplish a Search for the promised "complete discussion" on this option. I was then able to read the on-line reference regarding "remote" and the search also matched other references on the Vim FAQ Wiki.

IMHO, this misstep was a true Error that provided only half of the presented information and it could have at least referenced the on-line help for those who are interested < // vimdoc (dot) sourceforge (dot) net / htmldoc / remote (dot) html >.

I do not know, since version eight (8) of Vim is already out, if this option is still available in this version or dropped. This was the latest publication I could find on Vim. This functionality is, IMO, needed previously and may even be more important now in these DevOps times (2019).

Anonymous  Oct 02, 2019 
PDF Page 164
System and User Configuration Files, the "exrc option" description

the description states that "If the Vim exrc option is set, Vim looks for the three additional config files: [._]vimrc; [._]vimrc; and [._]exrc."

Shortening that list of searched files is not a good idea: there's only two distinct config files in it: [._]vimrc and [._]exrc, not three ;-)

That list should be reworded to specify the three files depending on the OS and also to specify that they are searched into the current directory.

Maybe something like: "If the Vim exrc option is set, the current directory is searched for three additional config files. The first found is used. For Unix, Amiga, OS/2, and Mac OS X, the files are: .vimrc, _vimrc, and .exrc and for DOS/Windows: _vimrc, .vimrc and .exrc"?

BlaF  Dec 12, 2011 
PDF Page 184
first note

The note ends with: "and to use the winheight option to size your command window.", but my guess is you really meant to write "cmdheight", described on the next page.

BlaF  Dec 13, 2011 
PDF Page 224
First sentence

"Notice how the menu in Figure 13-3 is moved and floats over completely unrelated application."

Figure 13-2 corresponds to that description, not 13-3.

BlaF  Dec 15, 2011 
PDF Page 233
Figure 13-13

The image used in this figure does not correspond to the code sample (missing vertical space between first and second entry). The right image is the one shown in Figure 13-14 (p.234).

BlaF  Dec 17, 2011 
PDF Page 234
Figure 13-14

The image used for this figure does not correspond to its legend ("gvim?s toolbar".)

BlaF  Dec 17, 2011 
Printed Page 261
Heading "Insertion Completion Commands"

For the 7th Edition: It's a niggle rather than an error, really, but it would be useful to add just a bit of text to the section "Insertion Completion Commands" that reminds the reader that the keystroke sequences are usable only after pressing "i" to put Vim into Insert mode.

I quickly figured the use-case out, and of course the word "Insertion" in the heading is a big clue. But a simple statement that one prefaces the keystroke sequences by entering Insert mode would make it easier for newer Vim users who have stumbled onto the section and don't automatically get the use case.

Riley  May 09, 2012 
Printed Page 277
3rd line after Lorem ipsum excerpt

The file latin.vim should be created in $HOME/.vim/syntax, not in $HOME/.vim.

Enrico Maria De Angelis  Apr 18, 2020 
Printed Page 463
bottom left

vim (I'm running 7.3) sometimes shows "recording" at the bottom of the xterm window.

It's recording into a buffer- and that can be stopped and then played back.

I don't see "recording" in the Index - and don't find it in the book after a little looking.

Henry Schaffer  Feb 22, 2015