aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-28 08:53:04 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-28 08:53:04 +1300
commit10e3f19400177b094da0a79adb4bb324d8032936 (patch)
treebfbc5de59edc1ec0778aeb483e9b4b8d3b5c5a20 /doc
parentMerge branch 'hotfix/v1.0.2' into develop (diff)
downloadvim-make-target-10e3f19400177b094da0a79adb4bb324d8032936.tar.gz
vim-make-target-10e3f19400177b094da0a79adb4bb324d8032936.zip
Refine key binding example
Diffstat (limited to 'doc')
-rw-r--r--doc/make_target.txt20
1 files changed, 4 insertions, 16 deletions
diff --git a/doc/make_target.txt b/doc/make_target.txt
index bc8157e..b57b836 100644
--- a/doc/make_target.txt
+++ b/doc/make_target.txt
@@ -19,23 +19,11 @@ The |map-local| mapping `<Plug>(MakeTarget)` attempts to identify the target or
targets for the recipe under the cursor, and runs `make!` in sequence on each
of those targets.
-There is no default key binding; you could do this in your `.vimrc` to bind
-`_m`, for example:
+There is no default key binding; to bind `<LocalLeader>m`, you could add this
+to `after/ftplugin/make.vim`:
>
- autocmd FileType make
- \ nmap <buffer> _m <Plug>(MakeTarget)
-<
-A cleaner and more complete implementation that correctly clears the group on
-reload and the mapping on filetype switch might be:
->
- let g:maplocalleader = '_'
- augroup vimrc_filemap
- autocmd!
- autocmd FileType *
- \ silent! nmapclear <buffer> <LocalLeader>m
- autocmd FileType make
- \ nmap <buffer> <LocalLeader>m <Plug>(MakeTarget)
- augroup END
+ nmap <buffer> <LocalLeader>m <Plug>(MakeTarget)
+ let b:undo_ftplugin .= '|nunmap <buffer> _m'
<
FUNCTIONS *make_target-functions*