# HG changeset patch # User Richard Russon (flatcap) # Date 1334971861 -3600 # Node ID 69162b499ec116543d0cc91d1859e2443469175f # Parent 718ebbd352a537d8d524ff0809669b21d39fad4d Correct text which is at odds to the examples. diff -r 718ebbd352a5 -r 69162b499ec1 chapters/11.markdown --- a/chapters/11.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/11.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -97,7 +97,7 @@ :nnoremap Q x :nnoremap Q dd -Now switch to file `foo` and type `Q`. What happens? +Staying in file `foo`, type `Q`. What happens? When you press `Q`, Vim will run the first mapping, not the second, because the first mapping is *more specific* than the second. diff -r 718ebbd352a5 -r 69162b499ec1 chapters/14.markdown --- a/chapters/14.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/14.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -107,8 +107,8 @@ Now try writing your file and checking `:messages`. This time Vim only echoed "Cats" when you wrote the file. -Using in Your Vimrc -------------------- +Using Autocommands in Your Vimrc +-------------------------------- Now that we know how to group autocommands and clear those groups, we can use this to add autocommands to `~/.vimrc` that don't add a duplicate every time we diff -r 718ebbd352a5 -r 69162b499ec1 chapters/17.markdown --- a/chapters/17.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/17.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -41,7 +41,7 @@ comments explaining each piece for other people reading the code (or ourselves several months later). -Run the following command: +Run the following commands: :::vim :set statusline=%l " Current line diff -r 718ebbd352a5 -r 69162b499ec1 chapters/19.markdown --- a/chapters/19.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/19.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -22,7 +22,7 @@ :let foo = 42 :echo foo -Vim will display "42", because we've reassigned `bar` to the integer "42". From +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. diff -r 718ebbd352a5 -r 69162b499ec1 chapters/21.markdown --- a/chapters/21.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/21.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -73,7 +73,7 @@ This time Vim *does* display the text! What's going on here? -To try to wrap our heads around what's going on, run the following two commands: +To try to wrap our heads around what's going on, run the following three commands: :::vim :echom "hello" + 10 diff -r 718ebbd352a5 -r 69162b499ec1 chapters/25.markdown --- a/chapters/25.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/25.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -62,8 +62,8 @@ :::vim :echo 15.45e-2 -Vim displays "0.1545". The `+` or `-` before the power of ten is optional, if -it's omitted the it's assumed to be positive. Run the following command: +Vim displays "0.1545". The `+` or `-` before the power of ten is optional. If +it's omitted then it's assumed to be positive. Run the following command: :::vim :echo 15.3e9 @@ -94,7 +94,7 @@ :::vim :echo 3 / 2 -Vim displays "1". If you want Vim to perform float point division one of the +Vim displays "1". If you want Vim to perform floating point division one of the numbers needs to be a Float, which will cause the other one to be coerced to a Float as well. Run this command: diff -r 718ebbd352a5 -r 69162b499ec1 chapters/28.markdown --- a/chapters/28.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/28.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -21,7 +21,7 @@ Vim will open the first file in a vertical split to the right of the second file. What happened here? -First, Vim sees builds the command string by concatenating "rightbelow vsplit +First, Vim builds the command string by concatenating "rightbelow vsplit " with the result of the `bufname("#")` call. We'll look at the function more later, but for now just trust that it returns diff -r 718ebbd352a5 -r 69162b499ec1 chapters/32.markdown --- a/chapters/32.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/32.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -2,7 +2,7 @@ =================================== In this chapter and the next we're going to walk through creating -a fairly-complicated piece of Vimscript. We'll talk about several things we +a fairly complicated piece of Vimscript. We'll talk about several things we haven't seen before, as well as how some of the things we've studied fit together in practice. @@ -69,7 +69,7 @@ command: :::vim - :nnoremap g :grep -R something . + :nnoremap g :grep -R something . If you've read `:help grep` this should be pretty easy to understand. We've looked at lots of mappings before, and there's nothing new here. diff -r 718ebbd352a5 -r 69162b499ec1 chapters/35.markdown --- a/chapters/35.markdown Sat Apr 21 02:29:35 2012 +0100 +++ b/chapters/35.markdown Sat Apr 21 02:31:01 2012 +0100 @@ -133,9 +133,9 @@ :echo join(foo, '---') :echo join([1, 2, 3], '') -Vim displays "a b" and "a---b". `join` will join the items in the given list -together into a string, separated by the given separator string (or a space if -none is given), coercing each item to a string if necessary/possible. +Vim displays "a b", "a---b" and "123". `join` will join the items in the given +list together into a string, separated by the given separator string (or a space +if none is given), coercing each item to a string if necessary/possible. Run the following commands: