Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the auto-complete select key in Sublime Text 3?

I have used vim for a while, in vim auto-complete, I use 'tab' 'down' to select the next candidate, 'shift+tab' 'up' to select the previous candidate, 'enter' to confirm that completion.

But in Sublime Text 3, I found 'tab' and 'enter' are both to confirm completion, only 'up' 'down' is to select the previous/next candidate.

How can I set the key like vim auto-complete mode ?

like image 612
linrongbin Avatar asked Oct 16 '25 04:10

linrongbin


1 Answers

Just add this to your keymap:

{
    "keys": ["tab"],
    "command": "move",
    "args": {"by": "lines", "forward": true},
    "context": [{"key": "auto_complete_visible"}]
},
{
    "keys": ["shift+tab"],
    "command": "move",
    "args": {"by": "lines", "forward": false},
    "context": [{"key": "auto_complete_visible"}]
},

The context auto_complete_visible enables the keybinding only if the autocomplete popup is visible.

like image 130
r-stein Avatar answered Oct 17 '25 17:10

r-stein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!