From 309d2dad744e557b6f3370c400b37760b9631811 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 12 Jul 2018 13:16:01 +1200 Subject: Parenthesize map target --- after/ftplugin/make/target.vim | 2 +- doc/make_target.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/after/ftplugin/make/target.vim b/after/ftplugin/make/target.vim index dc1663a..daab321 100644 --- a/after/ftplugin/make/target.vim +++ b/after/ftplugin/make/target.vim @@ -23,7 +23,7 @@ let b:undo_ftplugin = b:undo_ftplugin " Define normal mode mapping target nnoremap - \ MakeTarget + \ (MakeTarget) \ :call make#target#Make() let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap MakeTarget' diff --git a/doc/make_target.txt b/doc/make_target.txt index 65078ea..bc8157e 100644 --- a/doc/make_target.txt +++ b/doc/make_target.txt @@ -3,7 +3,7 @@ DESCRIPTION *make_target* This filetype plugin for Makefiles ("make" filetype) provides an autoload -function `make#target#Make()` and buffer-local mapping `MakeTarget` to +function `make#target#Make()` and buffer-local mapping `(MakeTarget)` to `make!` the target for the recipe under the cursor, if it can be identified. REQUIREMENTS *make_target-requirements* @@ -14,8 +14,8 @@ or newer. It won't load at all if you have `g:no_plugin_maps` or MAPPINGS *make_target-mappings* - *MakeTarget* -The |map-local| mapping `MakeTarget` attempts to identify the target or + *(MakeTarget)* +The |map-local| mapping `(MakeTarget)` attempts to identify the target or targets for the recipe under the cursor, and runs `make!` in sequence on each of those targets. @@ -23,7 +23,7 @@ There is no default key binding; you could do this in your `.vimrc` to bind `_m`, for example: > autocmd FileType make - \ nmap _m MakeTarget + \ nmap _m (MakeTarget) < A cleaner and more complete implementation that correctly clears the group on reload and the mapping on filetype switch might be: @@ -34,13 +34,13 @@ reload and the mapping on filetype switch might be: autocmd FileType * \ silent! nmapclear m autocmd FileType make - \ nmap m MakeTarget + \ nmap m (MakeTarget) augroup END < FUNCTIONS *make_target-functions* *make#target#Make()* -The |autoload| function used by |MakeTarget| is accessible as +The |autoload| function used by |(MakeTarget)| is accessible as `make#target#Make()` if wanted. It's hardcoded to look for the target under the cursor. -- cgit v1.2.3