Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Proof 29-31.

  • Loading branch information...
commit 4a86af8e1c79f3329cf9fb2c9dab0d05fcb65dfe 1 parent a46fadc
@sjl authored
View
13 chapters/29.markdown
@@ -49,9 +49,9 @@ Luckily Vim has a `normal!` command that does exactly this. Run this command:
This time Vim moves to the bottom of the file even though `G` has been mapped.
-When writing Vim scripts you should **always** use `normal!`, **never** plain
-old `normal`. You can't trust what keys your users will have mapped in their
-`~/.vimrc` files.
+When writing Vim scripts you should **always** use `normal!`, and **never** use
+plain old `normal`. You can't trust what keys your users will have mapped in
+their `~/.vimrc` files.
Special Characters
------------------
@@ -67,10 +67,9 @@ you'll see that it doesn't work. The problem is that `normal!` doesn't parse
special character sequences like `<cr>`.
In this case Vim thinks you wanted to search for the character sequence "f, o,
-o, left angle bracket, c, r, right angle bracket", and thinks that you never
-even pressed return to perform the search!
-
-We'll talk about how to get around this in the next chapter.
+o, left angle bracket, c, r, right angle bracket", and doesn't realize that you
+even pressed return to perform the search! We'll talk about how to get around
+this in the next chapter.
Exercises
---------
View
6 chapters/30.markdown
@@ -2,7 +2,7 @@ Execute Normal!
===============
Now that we've seen `execute` and `normal!` we can talk about a common Vimscript
-idiom. Run the following command:
+idiom in more detail. Run the following command:
:::vim
:execute "normal! gg/foo\<cr>dd"
@@ -24,8 +24,8 @@ the following command:
What does this do? Let's break it apart:
* `:execute "normal! ..."`: run the sequence of commands as if they were entered
- in normal mode, ignoring all mappings, and replacing escape sequences with
- their results.
+ in normal mode, ignoring all mappings, and replacing string escape sequences
+ with their results.
* `mq`: store the current location in mark "q".
* `A`: move to the end of the current line and enter insert mode after the last
character.
View
12 chapters/31.markdown
@@ -7,7 +7,7 @@ expressions, but as usual there are some quirks.
Type the following text into a buffer:
- :::python
+ :::text
max = 10
print "Starting"
@@ -17,11 +17,13 @@ Type the following text into a buffer:
print "Done"
-This is the text we'll use to experiment with Vimscript's regex support.
+This is the text we'll use to experiment with Vimscript's regex support. It
+happens to be Python code, but don't worry if you don't know Python. It's just
+an example.
I'm going to assume that you know the basics of regular expressions. If you
-don't you should definitely stop reading this book and start reading [Learn
-Regex the Hard Way][regex] by Zed Shaw. Come back when you're done with that.
+don't you should stop reading this book and start reading [Learn Regex the Hard
+Way][regex] by Zed Shaw. Come back when you're done with that.
[regex]: http://regex.learncodethehardway.org/
@@ -180,7 +182,7 @@ Exercises
Read `:help magic` carefully.
Read `:help pattern-overview` to see the kinds of things Vim regexes support.
-Stop after the character classes.
+Stop reading after the character classes.
Read `:help match`. Try running the `:match Error /\v.../` command a few times
by hand.
Please sign in to comment.
Something went wrong with that request. Please try again.