# HG changeset patch # User Steve Losh # Date 1351722520 14400 # Node ID efe4cc9cbd7e797cc8654bfb000582971d8d1563 # Parent 52cc06ab5af88db17b2f2c67fa72636f08d3cf92 Don't map things to keys that terminals might eat. Thanks to Sven Hergenhahn for reporting this. diff -r 52cc06ab5af8 -r efe4cc9cbd7e chapters/38.markdown --- a/chapters/38.markdown Tue Oct 16 19:55:18 2012 -0400 +++ b/chapters/38.markdown Wed Oct 31 18:28:40 2012 -0400 @@ -26,13 +26,13 @@ a separate file in `~/.vim/plugin/` if you prefer): :::vim - nnoremap :call FoldColumnToggle() + nnoremap f :call FoldColumnToggle() function! FoldColumnToggle() echom &foldcolumn endfunction -Write and source the file, then try it out by pressing ``. Vim will +Write and source the file, then try it out by pressing `f` Vim will display the current value of the `foldcolumn` option. Go ahead and read `:help foldcolumn` if you're unfamiliar with this option. @@ -40,7 +40,7 @@ this: :::vim - nnoremap :call FoldColumnToggle() + nnoremap f :call FoldColumnToggle() function! FoldColumnToggle() if &foldcolumn @@ -68,7 +68,7 @@ skeleton as before. Add the following code to your file: :::vim - nnoremap :call QuickfixToggle() + nnoremap q :call QuickfixToggle() function! QuickfixToggle() return @@ -79,7 +79,7 @@ look like this: :::vim - nnoremap :call QuickfixToggle() + nnoremap q :call QuickfixToggle() function! QuickfixToggle() copen @@ -92,7 +92,7 @@ solution: a global variable. Change the code to look like this: :::vim - nnoremap :call QuickfixToggle() + nnoremap q :call QuickfixToggle() function! QuickfixToggle() if g:quickfix_is_open @@ -112,7 +112,7 @@ the variable is not defined yet! Let's fix that by initializing it once: :::vim - nnoremap :call QuickfixToggle() + nnoremap q :call QuickfixToggle() let g:quickfix_is_open = 0 @@ -160,7 +160,7 @@ Vim plugins. Edit your code to look like this: :::vim - nnoremap :call QuickfixToggle() + nnoremap q :call QuickfixToggle() let g:quickfix_is_open = 0 @@ -202,7 +202,4 @@ Read `:help wincmd`. -Read `:help ctrl-q` and `:help ctrl-f` to see what you overwrote with these -mappings. - Namespace the functions by adding `s:` and `` where necessary.