diff options
| author | Teddy Wing | 2015-07-19 11:31:45 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-07-19 11:31:45 -0400 |
| commit | 073fad07c8f9a7b2d59aa9a71061425c095d270e (patch) | |
| tree | 6a469378757d0968bfb0d0e69e670b0d74b95961 | |
| parent | a5e9b6c85c15ad9b8ce011171412fa5766d39e02 (diff) | |
| download | auditory.vim-073fad07c8f9a7b2d59aa9a71061425c095d270e.tar.bz2 | |
autoload/auditory.vim: Unsilence search commands
The search commands, as I has specified previously in the verbose
mappings from before, should not be silenced, otherwise you can't see
the useful output that they provide in the command line area.
Add a way to make a mapping silent or not using a new field in the
mappings dictionary.
| -rw-r--r-- | autoload/auditory.vim | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 79ac524..31718dc 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -304,22 +304,27 @@ let s:mappings['P'] = { let s:mappings['/'] = { \ 'audio': '/Resources/Normal_Mode/Search.wav', + \ 'silent': 0, \ 'map_to': "/", \ } let s:mappings['n'] = { \ 'audio': '/Resources/Normal_Mode/Search.wav', + \ 'silent': 0, \ 'map_to': "n", \ } let s:mappings['N'] = { \ 'audio': '/Resources/Normal_Mode/Search.wav', + \ 'silent': 0, \ 'map_to': "N", \ } let s:mappings['#'] = { \ 'audio': '/Resources/Normal_Mode/Search.wav', + \ 'silent': 0, \ 'map_to': "#", \ } let s:mappings['*'] = { \ 'audio': '/Resources/Normal_Mode/Search.wav', + \ 'silent': 0, \ 'map_to': "*", \ } @@ -447,7 +452,13 @@ function! auditory#AssignNormalModeMappings() " If `map_from` is specified, we can't rely on `key` to provide it let l:map_from = has_key(value, 'map_from') ? value.map_from : key - execute l:cmd . ' <silent>' . l:map_from . + " Default to <silent> unless the mapping explicitly calls for a value + let l:silence = '<silent>' + if has_key(value, 'silent') + let l:silence = value.silent ? l:silence : '' + endif + + execute l:cmd . ' ' . l:silence . ' ' . l:map_from . \ ' :<c-u>call auditory#Play("' . value.audio . '")' . \ l:pipe . value.map_to endfor |
