7ac975d8e717

Proof 7-11
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 10 Nov 2012 17:09:56 -0500
parents 41e61b3dce7a
children 495eedad2b77
branches/tags (none)
files chapters/07.markdown chapters/08.markdown chapters/09.markdown chapters/10.markdown chapters/11.markdown

Changes

--- a/chapters/07.markdown	Sat Nov 10 14:50:42 2012 -0500
+++ b/chapters/07.markdown	Sat Nov 10 17:09:56 2012 -0500
@@ -1,7 +1,7 @@
 Editing Your Vimrc
 ==================
 
-Before we move on to learning more Vimscript let's find a way to make it easier
+Before we move on to learning more Vimscript, let's find a way to make it easier
 to add new mappings to our `~/.vimrc` file.
 
 When you're coding away furiously at a problem and realize a new mapping would
@@ -19,8 +19,8 @@
 Editing Mapping
 ---------------
 
-Let's add a mapping that will open our `~/.vimrc` file in a split so we can edit
-it and get back to coding.  Run this command:
+Let's add a mapping that will open your `~/.vimrc` file in a split so you can
+quickly edit it and get back to coding.  Run this command:
 
     :::vim
     :nnoremap <leader>ev :vsplit $MYVIMRC<cr>
@@ -31,8 +31,7 @@
 worry about that for right now, just trust me that that variable works.
 
 `:vsplit` opens a new vertical split.  If you'd prefer a horizontal split you
-can replace it with `:split`, but in this age of widescreen monitors I don't
-know why you would.
+can replace it with `:split`.
 
 Take a minute and think through that command in your mind.  The goal is: "open
 my `~/.vimrc` file in a new split".  Why does it work?  Why is every single
@@ -61,9 +60,9 @@
 
 That process probably takes a minute.  What if you could improve that?
 
-Let's say you invest $50 and buy an [Eye-Fi](http://www.eye.fi/) memory card.
-The Eye-Fi is a memory card for your camera that has a built-in wifi card, so as
-soon as you snap a photo it gets transferred to your computer.
+Let's say you invest $50 and buy an [Eye-Fi](http://www.eye.fi/).  The Eye-Fi is
+a memory card for your camera that has a built-in wifi card, so as soon as you
+snap a photo it gets transferred to your computer.
 
 I know, we're definitely living in the future.  Isn't it awesome?
 
@@ -78,12 +77,11 @@
 50 seconds per photo, you need to take about 109 photos for project to pay for
 itself.
 
-109 photos is *nothing*.  It's a drop in the ocean.  A blip that doesn't even
-register on the radar.  You'd blow past that number in a day's practice without
-even noticing.  Hell, you'd take more photos than that in two hours!
+109 photos is *nothing*.  You'd blow past that number in a day's practice
+without even noticing!
 
 The same goes for our new mapping.  It saves us only a few seconds each time we
-use it, but it takes far, *far* less than an hour and a half to set up.
+use it, but it pays for itself if we use it often enough.
 
 Sourcing Mapping
 ----------------
@@ -103,7 +101,7 @@
 The `source` command tells Vim to take the contents of the given file and
 execute it as Vimscript.
 
-Now we can easily add new mappings during the heat of coding.  We:
+Now you can easily add new mappings during the heat of coding:
 
 * Use `<leader>ev` to open the file.
 * Add the mapping.
--- a/chapters/08.markdown	Sat Nov 10 14:50:42 2012 -0500
+++ b/chapters/08.markdown	Sat Nov 10 17:09:56 2012 -0500
@@ -57,7 +57,7 @@
 
 If you want to read the *full* description of this option's format you can check
 out `:help isfname`, but I'll warn you that you'd better have a beer at the
-ready if you don't want to start sobbing while reading.
+ready if you don't want to start crying while reading.
 
 For our purposes you can simply remember that abbreviations will be expanded
 when you type anything that's not a letter, number, or underscore.
@@ -76,7 +76,7 @@
 mode and try them out.
 
 These abbreviations take large chunks of text that you type often and compress
-them down to a few characters.  Over time, this can save you a lot of time, as
+them down to a few characters.  Over time, this can save you a lot of typing, as
 well as wear and tear on your fingers.
 
 Why Not Use Mappings?
@@ -102,7 +102,7 @@
 
 You'll notice that Vim has expanded the `ssig` in Larry's name!  Mappings don't
 take into account what characters come before or after the map -- they only look
-at the specific sequence that you map.
+at the specific sequence that you mapped to.
 
 Remove the mapping and replace it with an abbreviation by running the following
 commands:
@@ -114,7 +114,7 @@
 Now try out the abbreviation again.
 
 This time Vim will pay attention to the characters before and after `ssig` and
-only expand it when we want it to.
+only expand it when we want.
 
 Exercises
 ---------
--- a/chapters/09.markdown	Sat Nov 10 14:50:42 2012 -0500
+++ b/chapters/09.markdown	Sat Nov 10 17:09:56 2012 -0500
@@ -2,8 +2,8 @@
 =============
 
 I know we've talked a lot about mappings so far, but we're going to practice
-them again now.  Mappings are one of the easiest, fastest ways to make your Vim
-editing more productive, so it's good to focus on them quite a bit.
+them again now.  Mappings are one of the easiest and fastest ways to make your
+Vim editing more productive, so it's good to focus on them quite a bit.
 
 One concept that has showed up in several examples but that we haven't
 explicitly talked about is mapping a sequence of multiple keys.
@@ -20,8 +20,8 @@
 after the `j`, Vim decides that you don't want to activate the mapping and
 instead runs the normal `j` functionality (moving down a line).
 
-This mapping will make it painful to move around our file, so let's remove it.
-Run the following command:
+This mapping will make it painful to move around, so let's remove it.  Run the
+following command:
 
     :::vim
     :nunmap jk
@@ -44,7 +44,7 @@
 How does this work?  Let's split it apart into pieces and think of what each one
 does:
 
-    :::vim
+    :::text
     viw<esc>a"<esc>hbi"<esc>lel
 
 * `viw`: visually select the current word
@@ -63,8 +63,8 @@
 * `l`: move right, which puts our cursor over the ending quote
 
 Remember: because we used `nnoremap` instead of `nmap` it doesn't matter if
-we've mapped any of the keys in this sequence to something else.  Vim will use
-the default functionality for everything in the sequence.
+you've mapped any of the keys in this sequence to something else.  Vim will use
+the default functionality for all of them.
 
 Hopefully you can see how much potential Vim's mappings have, as well as how
 unreadable they can become.
@@ -86,7 +86,7 @@
 moves right you can think of `L` as a "stronger" `l`.
 
 Find out what commands you just overwrote by reading `:help H` and `:help L`.
-Decide whether you care about them (you probably won't).
+Decide whether you care about them.
 
 Add all of these mappings to your `~/.vimrc` file, making sure to use your "edit
-`~/.vimrc`" and "source `~/.vimrc`" mappings to do so.
+my `~/.vimrc`" and "source my `~/.vimrc`" mappings to do so.
--- a/chapters/10.markdown	Sat Nov 10 14:50:42 2012 -0500
+++ b/chapters/10.markdown	Sat Nov 10 17:09:56 2012 -0500
@@ -13,14 +13,14 @@
 Now enter insert mode and type `jk`.  Vim will act as if you pressed the escape
 key and return you to normal mode.
 
-There are a number of ways to exit insert mode in Vim:
+There are a number of ways to exit insert mode in Vim by default:
 
-* The escape key
+* `<esc>`
 * `<c-c>`
 * `<c-[>`
 
 Each of those requires you to stretch your fingers uncomfortably.  Using `jk` is
-great, because the keys are right under two of your strongest fingers and you
+great because the keys are right under two of your strongest fingers and you
 don't have to perform a chord.
 
 Some people prefer using `jj` instead of `jk`, but I prefer `jk` for two
@@ -39,8 +39,8 @@
 ----------------
 
 Now that you've got a great new mapping, how can you learn to use it?  Chances
-are you've already got the escape key in your muscle memory, so in the heat of
-coding you'll hit it without even thinking.
+are you've already got the escape key in your muscle memory, so when you're
+editing you'll hit it without even thinking.
 
 The trick to relearning a mapping is to *force* yourself to use it by
 *disabling* the old key(s).  Run the following command:
@@ -53,11 +53,10 @@
 
 Now you *have* to use your `jk` mapping to exit insert mode.  At first you'll
 forget, type escape and start trying to do something in normal mode and you'll
-wind up with stray characters in your text.
-
-It will be frustrating, but if you stick with it you'll be surprised at how fast
-your mind and fingers absorb the new mapping.  Within an hour or two you won't
-be accidentally hitting escape any more.
+wind up with stray characters in your text.  It will be frustrating, but if you
+stick with it you'll be surprised at how fast your mind and fingers absorb the
+new mapping.  Within an hour or two you won't be accidentally hitting escape any
+more.
 
 This idea applies to any new mapping you create to replace an old one, and even
 to life in general.  When you want to change a habit, make it harder or
--- a/chapters/11.markdown	Sat Nov 10 14:50:42 2012 -0500
+++ b/chapters/11.markdown	Sat Nov 10 17:09:56 2012 -0500
@@ -2,14 +2,14 @@
 =================================
 
 Now we're going to take a few minutes to revisit three things we've already
-talked about: mappings, abbreviations and options, but with a twist: we're going
-to set each of them in a single buffer at a time.
+talked about: mappings, abbreviations, and options, but with a twist: we're
+going to set each of them in a single buffer at a time.
 
 The true power of this idea will become apparent in the next chapter, but we
 need to lay the groundwork for it now.
 
 For this chapter you'll need to open two files in Vim, each in its own split.
-We'll call them `foo` and `bar`, but you can name them whatever you like.  Put
+I'll call them `foo` and `bar`, but you can name them whatever you like.  Put
 some text into each of them.
 
 Mappings
@@ -36,7 +36,7 @@
 What happened?
 
 The `<buffer>` in the second `nnoremap` command told Vim to only consider that
-mapping when we're in the same buffer as where we defined it.
+mapping when we're in the buffer where we defined it.
 
 When you typed `<leader>x` in file `bar` Vim couldn't find a mapping that
 matched it, so it treated it as two commands: `<leader>` (which does nothing on
@@ -49,7 +49,7 @@
 form.  In general, when you create a mapping that only applies to specific
 buffers you should use `<localleader>` instead of `<leader>`.
 
-Using two separate "leader" keys provides a sort of "namespacing" that will help
+Using two separate leader keys provides a sort of "namespacing" that will help
 you keep all your various mappings straight in your head.
 
 It's even more important when you're writing a plugin for other people to use.
@@ -92,8 +92,8 @@
 Not all options can be used with `setlocal`.  To see if you can set a particular
 option locally, read its `:help`.
 
-We've glossed over a bit of detail about how local options *actually* work.  In
-the exercises you'll learn more about the gory details.
+I've glossed over a bit of detail about how local options *actually* work for
+now.  In the exercises you'll learn more about the gory details.
 
 Shadowing
 ---------