-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convention for default key bindings #257
Comments
I like the idea of having a convention for the default keybindings. At the same time, we have to be very careful to not completely remap everything. This I like:
Questionable:
That being said, I actually have a couple of things in mind myself regarding keybindings for which I would like some feedback. The idea is to move certain keys to use prompt-like bindings, which are more flexible in certain cases. The first one is to potentially retire the special
This could involve improving the search code to say I'm also currently working on a patch that moves all toggle actions to use Ideally, such a change will not have to break any exiting bindings and will give users more power to add custom bindings that manipulate options. Also, we are starting to have lot of Here's how the
|
On the positive side, now that tig supports a 'safe' mode, I am more comfortable adding new view specific keybindings. The question is if we can come up with a good convention, e.g.:
|
I'll get back soon on your comments. In the meantime, I just wanted to add another question. Do we need to keep the e.g.:
would become:
Bonus question: would the following implementation make the code simpler? Would it be a good idea?
|
The |
Just a thought: might it be simpler if we support this?
You define the action as you would have typed it within Tig. Then It would be sent as is. |
I'm not sure I understand what the 'c' binding is supposed to exemplify. Regarding using 'r' for the branch view. I think it makes sense. It is |
BTW |
This
I would imagine that the code might be simplified if what you enter as the binding action can be exactly what you would have typed within Tig. But I'm not the expert here ;) 🐕 I'm 200% happy with dropping the branch view in favor of a generic "refs" view! |
You mean for a command which is already prefixed with a bang?
|
Yes. In the last release I decided to allow external commands to start with any of the flags: |
This implements the non-controversial parts of #257: view-branch H -> r view-grep G -> g view-status S -> s screen-redraw no longer bound to r scroll-page-down s -> ScrollFwd scroll-page-up w -> ScrollBack :toggle show-rev-graph g -> G
In addition to using upper case for things that modify git state, if #67 moves forward I propose we group all destructive bindings under the exclamation mark
All of those bindings should also ask for confirmation with |
This implements part of issue #257 to ensure that Tig has a more consistent default set of keybindings. - Lower-case keys are used primarily for view switching; and should always be non-destructive. - Upper-case keys are used for view-specific actions including user-defined commands.
This implements part of issue #257 to ensure that Tig has a more consistent default set of keybindings. - Lower-case keys are used primarily for view switching; and should always be non-destructive. - Upper-case keys are used for view-specific actions including user-defined commands.
I recommend:
instead of capital |
As the tigrc configuration will change for 2.0 (complete tigrc file, no more default keybindings), it may be a good time to make the default one more intuitive for the user and use kind of a convention. For instance:
The idea is to avoid confusion for the default configuration. You should have a clue about what impact will have
r
,R
orctrl-R
.Some bindings I would propose:
m
,F1
: view-maind
,F2
: view-diffl
,F3
: view-logt
,F4
: view-treeb
,F5
: view-blameh
,F6
: view-branchs
,F7
: view-statusy
,F8
: view-stashp
,F9
: view-pager?
,F10
: view-helpj
: move-downk
: move-up1
to0
: the most usedtoggle-
actions?Status specific:
U
orS
: status-updateR
or!
: status-revertAnd also:
^L
: screen-redraw^F
: move-page-down^E
: edit^S
: stop-loadingWe may sacrifice some actions in favor of a simple configuration if there's not enough keys. As the actions are well named, it will be easy to fill this need with the upcoming readline support, e.g.
:toggle-<Tab>
.The text was updated successfully, but these errors were encountered: