# HG changeset patch # User Steve Losh # Date 1353369674 18000 # Node ID 0e78ce34b11d7d6edeef52a06ad87ee2087bbf2e # Parent efff67c5b7535d01087fb386f939cca56dca292a Proof 29-31. diff -r efff67c5b753 -r 0e78ce34b11d chapters/29.markdown --- a/chapters/29.markdown Mon Nov 19 18:40:21 2012 -0500 +++ b/chapters/29.markdown Mon Nov 19 19:01:14 2012 -0500 @@ -49,9 +49,9 @@ 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 @@ special character sequences like ``. 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 --------- diff -r efff67c5b753 -r 0e78ce34b11d chapters/30.markdown --- a/chapters/30.markdown Mon Nov 19 18:40:21 2012 -0500 +++ b/chapters/30.markdown Mon Nov 19 19:01:14 2012 -0500 @@ -2,7 +2,7 @@ =============== 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\dd" @@ -24,8 +24,8 @@ 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. diff -r efff67c5b753 -r 0e78ce34b11d chapters/31.markdown --- a/chapters/31.markdown Mon Nov 19 18:40:21 2012 -0500 +++ b/chapters/31.markdown Mon Nov 19 19:01:14 2012 -0500 @@ -7,7 +7,7 @@ Type the following text into a buffer: - :::python + :::text max = 10 print "Starting" @@ -17,11 +17,13 @@ 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 @@ 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.