aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autoload/auditory.vim12
1 files changed, 3 insertions, 9 deletions
diff --git a/autoload/auditory.vim b/autoload/auditory.vim
index 22a7cd1..596fefe 100644
--- a/autoload/auditory.vim
+++ b/autoload/auditory.vim
@@ -435,16 +435,10 @@ let s:mappings['<c-r>'] = {
function! auditory#AssignNormalModeMappings()
for [key, value] in items(s:mappings)
- let l:pipe = ''
- let l:silence = ''
+ " If this an `execute` mapping, add a pipe
+ let l:pipe = match(value.map_to, 'exec') !=# -1 ? ' \| ' : ''
- " If this an `execute` mapping
- if match(value.map_to, 'exec') !=# -1
- let l:pipe = ' \| '
- let l:silence = '<silent>'
- endif
-
- execute 'nmap ' . l:silence . ' ' . key .
+ execute 'nmap <silent>' . key .
\ ' :<c-u>call auditory#Play("' . value.audio . '")' .
\ l:pipe . value.map_to
endfor