I am trying to do a small plugin for vim to let me browse the clear case history of a file, but I am having trouble getting started. I need help with setting up the mapping exposed to the user.
Here is the bare minimum version of what I've done
function! s:DefineLeftKeyMaps()
echom 'in defineLeft'
nnoremap <leader>k <Plug>MinimalDoSomething
endfunction
noremap <script> <Plug>MinimalDoSomething <SID>DoSomething
noremap <SID>DoSomething :call <SID>DoSomething()<CR>
function! s:DoSomething()
echom 'In DoSomething'
endfunction
command! InitCCTTSample call s:DefineLeftKeyMaps()
I need to set the final map exposed to the user in a function cause it will be used in a split where I open up different files (eventually using said mapping). Since it is a buffer local map i assume i need to reset it every time.
Edit: The problem with the above solution was that even thou the mapping was it didn't do anything.
:map reported:
....
....
\k * <Plug>MinimalDoSomething
....
....
The reason was that I used noremap instead of map, so the subsequent mapping to the function call was ignored
Cheers