f28776bb4531

Holy shit.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 04 Apr 2013 01:35:49 -0400
parents 4d881a6b4d15
children 56683eb09ecc
branches/tags (none)
files chapters/32.markdown chapters/51.markdown chapters/54.markdown introduction.markdown

Changes

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