Skip to content

Commit 7eb62d2

Browse files
committed
Don't clobber an existing key maps, fixes vim-pandoc#15
1 parent bb8fd2b commit 7eb62d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: ftplugin/markdown/markdownfootnotes.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ if !exists("g:vimfootnotelinebreak")
105105
endif
106106

107107
" Mappings
108-
if !hasmapto('<Plug>AddVimFootnote', 'i')
108+
if !hasmapto('<Plug>AddVimFootnote', 'i') && mapcheck('<Leader>f', 'i') is# ''
109109
imap <buffer> <Leader>f <Plug>AddVimFootnote
110110
endif
111-
if !hasmapto('<Plug>AddVimFootnote', 'n')
111+
if !hasmapto('<Plug>AddVimFootnote', 'n') && mapcheck('<Leader>f', 'n') is# ""
112112
nmap <buffer> <Leader>f <Plug>AddVimFootnote
113113
endif
114114

115-
if !hasmapto('<Plug>ReturnFromFootnote', 'i')
115+
if !hasmapto('<Plug>ReturnFromFootnote', 'i') && mapcheck('<Leader>r', 'i') is# ''
116116
imap <buffer> <Leader>r <Plug>ReturnFromFootnote
117117
endif
118-
if !hasmapto('<Plug>ReturnFromFootnote', 'n')
118+
if !hasmapto('<Plug>ReturnFromFootnote', 'n') && mapcheck('<Leader>r', 'n') is# ''
119119
nmap <buffer> <Leader>r <Plug>ReturnFromFootnote
120120
endif
121121

0 commit comments

Comments
 (0)