Commits

Steve Losh committed f384072

Proof 19-20.

Comments (0)

Files changed (2)

chapters/19.markdown

 
 Up to this point we've covered single commands.  For the next third of the book
 we're going to look at Vimscript as a *programming language*.  This won't be as
-instantly gratifying as the rest of what we've learned, but it will lay the
-groundwork for the last part, which walks through creating a full-fledged Vim
-plugin from scratch.
+instantly gratifying as the rest of what you've learned, but it will lay the
+groundwork for the last part of the book, which walks through creating
+a full-fledged Vim plugin from scratch.
 
-The first thing we need to talk about are variables.
-
-Run the following commands:
+Let's get started.  The first thing we need to talk about are variables.  Run
+the following commands:
 
     :::vim
     :let foo = "bar"
     :let foo = 42
     :echo foo
 
-Vim will display "42", because we've reassigned `foo` to the integer "42".  From
-this it may seem that Vimscript is dynamically typed.  That's not the case, but
-we'll talk more about that later.
+Vim will display "42", because we've reassigned `foo` to the integer "42".
+
+From these short examples it may seem like Vimscript is dynamically typed.
+That's not the case, but we'll talk more about that later.
 
 Options as Variables
 --------------------
     :echo &wrap
 
 This time Vim displays "1".  This is a very strong hint that Vim treats the
-integer "0" as "false" and the integer "1" as "true".  It's reasonable to assume
-that Vim treats *any* non-zero integer as "truthy", and this is indeed the case.
+integer `0` as "false" and the integer `1` as "true".  It would be reasonable to
+assume that Vim treats *any* non-zero integer as "truthy", and this is indeed
+the case.
 
 We can also *set* options as variables using the `let` command.  Run the
 following commands:
     :echo @/
 
 Vim will echo the search pattern you just used.  This lets you programmatically
-read and modify the current search pattern, which can be very useful at times.
+read *and modify* the current search pattern, which can be very useful at times.
 
 Exercises
 ---------
 
-Go through your `~/.vimrc` file and change some of the `set` and
-`setlocal` commands to their `let` forms.  Remember that boolean options still
-need to be set to something.
+Go through your `~/.vimrc` file and change some of the `set` and `setlocal`
+commands to their `let` forms.  Remember that boolean options still need to be
+set to something.
 
 Try setting a boolean option like `wrap` to something other than zero or one.
 What happens when you set it to a different number?  What happens if you set it

chapters/20.markdown

 language like Python or Ruby.  For the most part variables act like you would
 expect, but Vim adds a certain twist to variables: scoping.
 
-Open two buffers in separate splits, then go into one of then and run the
-following commands:
+Open two different files in separate splits, then go into one of them and run
+the following commands:
 
     :::vim
     :let b:hello = "world"
     :echo b:hello
 
 As expected, Vim displays "world".  Now switch to the other buffer and run the
-echo command again:
+`echo` command again:
 
     :::vim
     :echo b:hello
 don't know what some of them mean, just take a look and keep them in the back of
 your mind.
 
-