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
Pane jumping with ^+⌘+1-9
shortcut.
#1359
Conversation
^+⌘+1-9
shortcut. Fix #1295^+⌘+1-9
shortcut.
findChildSessions(termGroups, childUid) | ||
), []); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to lib/utils/term-groups.js
because now used in lib/selectors.js
too
getTermGroups, | ||
termGroups => getRootGroups_(termGroups).reduce((result, {uid}) => | ||
Object.assign(result, {[uid]: findChildSessions(termGroups, uid)}), {}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
digit shortcut for each term are not in the store because it is possible to derive them from the global state. It computes children list for each rootGroup (Tab)
@@ -84,6 +84,7 @@ export default class Terms extends Component { | |||
const props = getTermGroupProps(uid, this.props, { | |||
termGroup, | |||
terms: this.terms, | |||
sortedSessionGroups: this.props.sortedSessionGroups[uid], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract sorted children which concern this tab
const state = getState(); | ||
const rootGroupUid = state.termGroups.activeRootGroup; | ||
const sortedSessionGroups = findChildSessions(state.termGroups.termGroups, rootGroupUid); | ||
const uid = i > sortedSessionGroups.length ? null : (i === 9 ? sortedSessionGroups[sortedSessionGroups.length - 1] : sortedSessionGroups[i - 1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find right pane for digit shortcut pressed
Is it better to tranform this PR to a plugin ? |
What I'd like to have is a very simple way for plugins to configure new keymappings. This would be trivial to write, in that case. So, when we merge the keymap feature we need to keep in mind that it should be easy for @chabou to extend that config from his plugin to accomplish this. Thoughts? |
@chabou Can you point me to the pane numbering order? |
@ppot I made a selector: https://github.com/chabou/hyper/blob/pane_jumping/lib/selectors.js#L16-L20 I don't know yet if your work about Session Restoring (and state refactoring) will impact this. |
@chabou I was saying the docs about the order of the pane. |
Made with a plugin : https://github.com/chabou/hyper-pane |
@chabou I will supply pane numing. So you will be able to navigate with pane number! |
I will adapt my plugin to use your work ;) |
@rauchg my plugin use mousetrap for keybindings inspired by https://github.com/iamstarkov/hyper-panes-iterm2-hotkeys. I think it is a better way to achieve this than hacking hterm like this plugin: https://github.com/gyandeeps/hypernpm It would be really great if, in next keymap feature, handlers registered by a plugin for a key combination will receive |
This PR implements #1295
I've chosen to use
^+⌘+1-9
to jump to a pane because ``⌘+1-9` is used to jump to a tab.Shortcut appears on top left of each term (in margin) from 2 panes in tab.
Possible improvements:
^+⌘
keys are down