From 073fad07c8f9a7b2d59aa9a71061425c095d270e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 19 Jul 2015 11:31:45 -0400 Subject: 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. --- autoload/auditory.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 . ' ' . l:map_from . + " Default to unless the mapping explicitly calls for a value + let l:silence = '' + if has_key(value, 'silent') + let l:silence = value.silent ? l:silence : '' + endif + + execute l:cmd . ' ' . l:silence . ' ' . l:map_from . \ ' :call auditory#Play("' . value.audio . '")' . \ l:pipe . value.map_to endfor -- cgit v1.2.3