How to configure in IdeaVIM Ctrl + N and Ctrl + P completion from Vim?

前端 未结 6 1622
栀梦
栀梦 2021-01-31 08:42

In Vim we can use Ctrl + N or Ctrl + P to finish code completion. How to configure it in IdeaVim for IntelliJ?

6条回答
  •  不要未来只要你来
    2021-01-31 08:47

    As of IntelliJ IDEA Community Edition v2020.1.1 with IdeaVim v0.57 plugin, what enables me to auto-complete code as well as cycling through suggestions with with Ctrl+N is the following:

    • File -> Settings -> Keymap
    • On the search bar type: hippie
    • Add Keyboard Shortcut to "Cyclic Expand Word" Ctrl+N (If prompted, remove other assignments)
    • Add Keyboard Shortcut to "Cyclic Expand Word (Backward)" Ctrl+P (If prompted, remove other assignments)

    If like me, you had added the following to your .ideavimrc:

     imap  :action HippieCompletiona
     imap  :action HippieBackwardCompletiona
    

    Comment those two lines out by prepending them with ", or delete them.

提交回复
热议问题