Commits

Steve Losh committed 7ac975d

Proof 7-11

Comments (0)

Files changed (5)

chapters/07.markdown

 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
 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>
 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
 
 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?
 
 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
 ----------------
 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.

chapters/08.markdown

 
 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.
 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?
 
 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:
 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
 ---------

chapters/09.markdown

 =============
 
 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.
 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
 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
 * `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.
 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.

chapters/10.markdown

 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
 ----------------
 
 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:
 
 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

chapters/11.markdown

 =================================
 
 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
 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
 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.
 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
 ---------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.