diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-12 13:16:01 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-12 13:16:01 +1200 |
commit | 309d2dad744e557b6f3370c400b37760b9631811 (patch) | |
tree | fa1dc2f2d47d8b6512467a9ac5e1b69beab2ba2c | |
parent | Escape target if supported (diff) | |
download | vim-make-target-309d2dad744e557b6f3370c400b37760b9631811.tar.gz vim-make-target-309d2dad744e557b6f3370c400b37760b9631811.zip |
Parenthesize map target
-rw-r--r-- | after/ftplugin/make/target.vim | 2 | ||||
-rw-r--r-- | 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 <buffer> <silent> <unique> - \ <Plug>MakeTarget + \ <Plug>(MakeTarget) \ :<C-U>call make#target#Make()<CR> let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap <buffer> <Plug>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 `<Plug>MakeTarget` to +function `make#target#Make()` and buffer-local mapping `<Plug>(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* - *<Plug>MakeTarget* -The |map-local| mapping `<Plug>MakeTarget` attempts to identify the target or + *<Plug>(MakeTarget)* +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. @@ -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 <buffer> _m <Plug>MakeTarget + \ 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: @@ -34,13 +34,13 @@ reload and the mapping on filetype switch might be: autocmd FileType * \ silent! nmapclear <buffer> <LocalLeader>m autocmd FileType make - \ nmap <buffer> <LocalLeader>m <Plug>MakeTarget + \ nmap <buffer> <LocalLeader>m <Plug>(MakeTarget) augroup END < FUNCTIONS *make_target-functions* *make#target#Make()* -The |autoload| function used by |<Plug>MakeTarget| is accessible as +The |autoload| function used by |<Plug>(MakeTarget)| is accessible as `make#target#Make()` if wanted. It's hardcoded to look for the target under the cursor. |