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