I would like to jump from method to method in Python. With Vim you can use the ]m
combination to jump to the next method and the [m
to the previous.
Since the ]
is quite awkward to type on a Belgium keyboard. So I would like to use the repmo plugin to repeat the motion.
I successfully configured repmo to repeat the jump to the next cpp
scope:
map <expr> ; repmo#LastKey(';')|sunmap ;
map <expr> , repmo#LastRevKey(',')|sunmap ,
" Still repeat fFtT (now with counts):
noremap <expr> f repmo#ZapKey('f')|sunmap f
noremap <expr> F repmo#ZapKey('F')|sunmap F
noremap <expr> t repmo#ZapKey('t')|sunmap t
noremap <expr> T repmo#ZapKey('T')|sunmap T
" Now following can also be repeated with `;` and `,`:
for keys in [ ['[[', ']]'], ['[]', ']['], ['[m', ']m'], ['[M', ']M'], ['[c', ']c'] ]
execute 'noremap <expr> '.keys[0]." repmo#SelfKey('".keys[0]."', '".keys[1]."')|sunmap ".keys[0]
execute 'noremap <expr> '.keys[1]." repmo#SelfKey('".keys[1]."', '".keys[0]."')|sunmap ".keys[1]
endfor
But it doesn't work for the python
filetype
.
I believe it has to do that there is a custom mapping for ]m
in the python
filetype
.
Does someone knows how to achieve that?
after/ftplugin/<filetype>.vim
.