滚动在vim自动完成框JK移动键 [英] Scrolling in vim autocomplete box with jk movement keys

查看:153
本文介绍了滚动在vim自动完成框JK移动键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VIM就可以开始输入一个字,按Ctrl-N,和一个对话框,并建议完成弹出。我不喜欢不必移开我的手箭头键通过这个列表中滚动。有没有一些方法,我可以用JK键向下/而不是滚动?


解决方案

  inoremap<&expr的GT; Ĵ((pumvisible())(\\ c为C-N>中?):(J))
inoremap<&expr的GT; K((pumvisible())(\\< C-P>中?):(K))

In vim you can start typing a word, hit ctrl-n, and a box will popup with suggested completions. I don't like having to move my hands away to the arrow keys to scroll through this list. Is there some way I can use the jk keys to scroll down/up instead?

解决方案

inoremap <expr> j ((pumvisible())?("\<C-n>"):("j"))
inoremap <expr> k ((pumvisible())?("\<C-p>"):("k"))

这篇关于滚动在vim自动完成框JK移动键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆