--- a/chapters/32.markdown Wed Apr 03 23:09:31 2013 -0400
+++ b/chapters/32.markdown Thu Apr 04 01:35:49 2013 -0400
@@ -180,7 +180,7 @@
command:
:::vim
- :nnoremap <leader>g :execute "grep -R " . shellescape(expand("<cWORD>")) . " ."<cr>
+ :nnoremap <leader>g :exe "grep -R " . shellescape(expand("<cWORD>")) . " ."<cr>
Try it out. This mapping won't break if the word we're searching for happens to
contain strange characters.
--- a/chapters/51.markdown Wed Apr 03 23:09:31 2013 -0400
+++ b/chapters/51.markdown Thu Apr 04 01:35:49 2013 -0400
@@ -96,11 +96,22 @@
function! s:NextSection(type, backwards)
endfunction
- noremap <script> <buffer> <silent> ]] :call <SID>NextSection(1, 0)<cr>
- noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1, 1)<cr>
+ noremap <script> <buffer> <silent> ]]
+ \ :call <SID>NextSection(1, 0)<cr>
+
+ noremap <script> <buffer> <silent> [[
+ \ :call <SID>NextSection(1, 1)<cr>
- noremap <script> <buffer> <silent> ][ :call <SID>NextSection(2, 0)<cr>
- noremap <script> <buffer> <silent> [] :call <SID>NextSection(2, 1)<cr>
+ noremap <script> <buffer> <silent> ][
+ \ :call <SID>NextSection(2, 0)<cr>
+
+ noremap <script> <buffer> <silent> []
+ \ :call <SID>NextSection(2, 1)<cr>
+
+I used Vimscript's long line continuation feature here because the lines were
+getting a bit long for my taste. Notice how the backslash to escape long lines
+comes at the *beginning* of the second line. Read `:help line-continuation` for
+more information.
Notice that we're using `<SID>` and a script-local function to avoid polluting