tmux-plugins / tmux-copycat

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

Custom keytable #91

Closed bosr closed 2 years ago

bosr commented 8 years ago

Hi,

Here is a new @copycat_keytable_option option that, if set, uses a custom keytable for all searches except / (this one is too useful to be altered). If this option is not set, the default prefix keytable is used.

With this, my shortcuts are less crowded and I find them easier to remember.

I have added instructions in the README.md and customisations.md

Regards

bosr commented 8 years ago

Hi Bruno have you had some time to give a look at this PR?

Regards

bosr commented 8 years ago

Rebased on latest master

bruno- commented 8 years ago

Hey, sorry for the wait. I like the idea.

What do you say we make t the default key-table? This plugin introduces a lot of key-bindings so that would make sense. How do we handle support for older tmux versions, 1.9 and up?

bosr commented 8 years ago

No problem, thanks for the feedback.

Regarding versions <2.1, I had not noticed they do not support key-table argument for bind-key, thank you.

As I don't know tmux enough to find a workaround for these versions, I have decided to completely disable the mechanism and keep the bindings in the prefix key-table. Hence I could not change the default key-table to t.

Here is an update that I tested on Debian Jessie (tmux 1.9, bash 4.3) and on OS X 10.11 (tmux 2.1, bash 3.2). The tmux -V version checking happens only once: if 2.1+ then a global variable is set, otherwise not set. By the way, I was not very efficient at obtaining a syntax that works with those two major versions of bash, so comments are welcome.

Cheers

bosr commented 8 years ago

rebased on master

bruno- commented 8 years ago

Progress looks good, I left a couple code-related suggestions.

What do you think about adding a test that checks key table works good? This might be hard-ish, let me know how you feel about it.

Also, what do you say we make t the default key-table for tmux version 2.1 and above ?

bosr commented 8 years ago

Thanks Bruno, I'll have a look at it this evening. Edit: shortly

bosr commented 8 years ago

@bruno-,

Thank you for the very constructive feedback! The code is much cleaner now.

Tell me how you feel about it.

bosr commented 8 years ago

I still have to add the tests, but I have not looked into it yet.

bosr commented 7 years ago

Oh, I was not aware it had been merged! Great, thanks.

bosr commented 7 years ago

My bad, I got confused with an old PR from tmux-yank

hupfdule commented 5 years ago

How about this PR? There was no activity for about two years now.

bosr commented 5 years ago

Hi, I have been using the code from this PR for the last 2 years without a problem, but I never rebased on master, so if the functionality still makes sense then the conflicts need to be solved. On my side I have no time now for this.

bosr commented 2 years ago

cleanup!