Skip to content
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

Easier navigation in zero based windowing #45

Closed

Conversation

mattpolito
Copy link

In the tmux windowing env we can select windows using prefix-NUM. However with zero being the first window but on the opposite side of the keyboard, it can be counter-intuitive.

I propose that the backtick '`' be used for window in the zero position.

prefix-` -> window 0
prefix-1 -> window 1
prefix-2 -> window 2
etc

@bruno-
Copy link
Member

bruno- commented Mar 7, 2018

Tmux has an option to change first window number to say 1. If a user did that, there's no point we add a binding for window 0.

If tmux show-option -g base-index is 0 then we can make this binding. If it's something else then we can pass.

I like this idea, but the only thing I'm unsure is how much "universal" or generally useful for the users is? I for example don't have problems typing 0. In fact, due to the position on the keyboard I find 0 easier to press than backtick. Let's leave this PR open for a while and wait for some 👍 or other feedback

@mattpolito
Copy link
Author

@bruno- Sounds good. Thanks for the feedback.

@mattpolito
Copy link
Author

@bruno- with your input I updated the commit to be conditional on base-index still being 0.

sensible.tmux Outdated
@@ -151,6 +151,13 @@ main() {
tmux bind-key C-n next-window
fi

# Easier navigation in zero based windowing
if key_binding_not_set "`"; then
if option_value_not_changed "base-index" "0"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have these two conditions on a single line? There's the example on line 97.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@mattpolito mattpolito force-pushed the backtick_as_first_position branch 2 times, most recently from 9cc4eb6 to 5a99de6 Compare March 7, 2018 15:31
@sorsasampo
Copy link

I would much rather see base-index and pane-base-index to be set to 1 (issue #33 which seems to have 8 votes for, 1 against currently). @bruno- have you considered accepting that issue?

@mattpolito I'm assuming backtick on your keyboard layout is left from "1". On finnish keyboard layout backtick is on the left side of backspace, which makes this binding quite useless. Considering differences in keyboard layout, I don't see this as a universal proposal.

@bruno-
Copy link
Member

bruno- commented May 1, 2018

@sorsasampo just left a response in #33.

I also agree on the backtick position argument: I also use keyboard layout where backtick is not left of key 1.

@mattpolito
Copy link
Author

Thanks @sorsasampo & @bruno- for the feedback... it appears this is not universally appealing so I will close the PR.

@mattpolito mattpolito closed this Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants