tmux-plugins / tmux-copycat

A plugin that enhances tmux search
MIT License
1.1k stars 63 forks source link

Adds C-h predefined SHA1 hash search. #73

Closed jbnicolai closed 9 years ago

jbnicolai commented 9 years ago

Adds matching for full or abbreviated SHA-1 hashes, as used by git.

match-sha-1

jbnicolai commented 9 years ago

@bruno- I was unable to make the test work, could you have a quick look why it's failing?

bruno- commented 9 years ago

Hey @jbnicolai, the new tests are failing. That's okay, I can probably look what's wrong before merging.

I see this search uses prefix + C-h.. the same as tmux-pain-control. In fact all of h, shift + h and C-h are "taken". Do we have any other option that does not clash with built-in or plugin key bindings? alt + h maybe?

jbnicolai commented 9 years ago

@bruno- alt + h sounds good, let me update quickly.

jbnicolai commented 9 years ago

@bruno- although, is there a reason tmux-pain-control uses both prefix + [hjll] and prefix + C-[hjkl]? The first seems sufficient, and if end-users want to change it they can. This would allow copycat to use prefix + C-h for hashes, which would be consistent with the other bindings.

bruno- commented 9 years ago

Hey @jbnicolai, I'll look into the tests and merge this.

Yea, there's a reason for additional/duplicate keybindings, but it's subtle. In short, it enables the user to constantly hold the ctrl key pressed while navigating across panes which is faster and less straining for the pinky finger.

Example: you're using C-a as a prefix and you have 5 vertical splits open. You wanna go from the leftmost one all the way to the right. With these additional keybindings you can:

This would be more cumbersome if the additional keybindings weren't defined.

bruno- commented 9 years ago

This was merged via 279db60 and tests are fixed in 52567df.

Thanks @jbnicolai!

alphaCTzo7G commented 6 years ago

Instead of having distinct key combinations for each thing.. perhaps the key combinations should be like vim-chords.

The advantage of that is you are essentially typing additional characters in a very systematic way. Its easy to remember. Further, each additional alphabetic key typed increases the parameter space available for mapping commands. So these kinds of clashes wont happen between multiple plugins