microsoft / inshellisense

IDE style command line auto complete
MIT License
8.38k stars 187 forks source link

ctrl a a strange choice for bind - breaks ability to move cursor to beginning of the line #55

Closed abulka closed 10 months ago

abulka commented 10 months ago

Is your feature request related to a problem? Please describe. I want to retain the ability to use the normal ctrl-a and ctrl-e features of zsh and bash etc. which move the cursor the beginning and end of the line respectively. By binding to ctrl-a by default, I can no longer move the cursor the the beginning of the line when not using inshellisense.

Describe the solution you'd like Bind to a key which is not used by zsh and bash etc. Or make it configurable.

Describe alternatives you've considered The file ~/.inshellisense/key-bindings.zsh contains

bindkey '^A' __inshellisense

so I edited this file and changed the A to O which fixed the problem, but then I lose whatever ^O used to do. Perhaps a CTRL plus SHIFT key combination would be better - how do I specify SHIFT in bindkey?

Additional context The ability to move to the beginning of the line and end of the line etc. are all broken inside inshellisense anyway, but I guess that's another issue....

cpendery commented 10 months ago

There is a todo to support emacs/vi navigation flows within inshellisense, so that should address the additional context. I'll look at making the binding customizable or at least providing a few options during the bind operation

suy commented 10 months ago

Implementation aside, I recommend that you also pick a good default that is not surprising or annoying for people who know and use the readline/emacs bindings. Those are common in many places, not only bash. Despite being a heavy nvim/vim user, I use many of those myself. Other projects have taken choices which clash annoyingly with them (e.g. tmux uses Ctrl-b for its prefix, and docker uses Ctrl-p, both fairly common).

Some that (IMHO) might be less likely to be used are:

I don't recommend giving Ctrl-o away, @abulka. This is extremely useful to repeat a sequence of commands.

abulka commented 10 months ago

@suy I've now changed my inshellisense shortcut to Ctrl-j and since learned the amazing usefulness of Ctrl-o as described e.g. here. To be honest, I think Ctrl-o is going to be of more value to me than inshellisense!

cpendery commented 10 months ago

Closing as the ctrl-a binding was removed in 0.0.1-rc.5