Closed iamdionysus closed 9 years ago
@iamdionysus, please help me understand how this relates to todo.txt-vim. I created a new vimrc with that configuration (no plugins) and all of the hasmapto calls returned 0. A minimal vimrc that reproduces the problem might help figuring out a solution.
After I tested as you said, I found how this relates to todo.txt-vim. hasmapto
checking itself should not be used for your intention.
:echo hasmapto(":<Leader>b") " => 0
:echo hasmapto(":CtrlPBuffer<cr>") " => 1
Please take a look at the help of hasmapto function :help hasmapto
. It is checking rhs
not the lhs
.
For you information, vim-fugitive is mapping keys when the user does not refuse it.
if !exists('g:fugitive_no_maps')
cnoremap <buffer> <expr> <C-R><C-G> fnameescape(<SID>recall())
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
endif
@iamdionysus, thanks for the explanation. Now I understood that I'm using the hasmapto
the wrong way. Originally those checkings before the mappings were introduced to avoid conflicts with other plugins. However, since
It sounds great. I'll probably map some keys for myself.
For example, I have this setting in my vimrc.
However, hasmapto function is not checking my setting correctly.
It leads to the whole mapping checking behaves in a strange way. Is there anyway I can globally disable the mapping instead of checking mapping respectively?