Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、一時的に fxsj にマップしたいとします。つまり、q を押すと、VIM は fxsqj を実行します。k を押すと、VIM は fxskj を実行します。等々。
getchar()たとえば、次のように使用できます。
getchar()
nnoremap <F2> :call Fun()<CR> function! Fun() let c = nr2char(getchar()) if c=='q' || c=='k' exec 'normal fxs'.c.'j' endif endfunction