Giter VIP home page Giter VIP logo

Comments (5)

unphased avatar unphased commented on August 16, 2024 1

(I am trying this now that i this breakage has finally gotten on my nerves to a sufficient degree. You see, I use the Ctrl+HJKL keys to do tmux pane directional navigation, and i am a heavy Vim user.)

Now I have one question -- it's not clear to me what the vi-copy key binding has to do with affecting the regular -n C-J binding. You say that the fix is to put the line that unbinds C-j for the vi-copy mode into my tmux config, but surely this will fail if I insert the line before the place where my tmux plugins are specified and presumably initialized?

Of course I am physically capable of inserting this line at the bottom, then it no longer is the case (as tpm's instructions are clear to state) that tpm's initialization remains at the bottom of my tmux configuration.

Then again I am just being overly pedantic to the point of being a joke, and I'll be sure to close this once I verify that it solves my problem. Thanks.

from tmux-copycat.

bruno- avatar bruno- commented on August 16, 2024

Hey, we've had this issue reported in #53.
I also propose steps how to fix this in that issue:

unbind C-j so that it no longer exits copy mode. This is the line to put in tmux.conf: unbind -t vi-copy C-j

Can you please confirm this fixed the issue for you?

from tmux-copycat.

unphased avatar unphased commented on August 16, 2024

Yup I tested and it works. However I did also test the case where I paste unbind -t vi-copy C-j into my .tmux.conf but only at the top and it still works to suppress the C-J bind. This has me confused, but not enough to actually dig into it to figure out why it still works.

from tmux-copycat.

bruno- avatar bruno- commented on August 16, 2024

Thank you for confirming this works.
I should probably put some effort into fixing this properly so other users don't have to deal with this.

Now I have one question -- it's not clear to me what the vi-copy key binding has to do with affecting the regular -n C-J binding

tmux-copycat defines a set of -n bindings to create "copycat mode". Examples are n and N keys to jump to next/previous match.
This couldn't be done with "vi-copy" or "emacs-copy" key bindings. There's no way for those key bindings to execute shell scripts (I asked tmux creator).

The -n key bindings are undefined and reset to default when a users exits "copycat mode".
We need to know which keys can exit tmux's copy mode and override them to detect this and reset -n bindings to defaults.

Some of the keys that can exit copy mode by default are ctrl-c, enter, q and ctrl-j. We're "dynamically" fetching a list of those keys (see this function) and overriding it with -n mappings.

If that function does not return C-j as the key that exits copy mode, it is never overridden with -n mapping.

I paste unbind -t vi-copy C-j` into my .tmux.conf but only at the top and it still works to suppress the C-J bind

It doesn't matter where you undefine C-j (top or bottom of tmux.conf). Previously linked function runs at the moment a user invokes "copycat mode" (for example with a stored search). It is at that moment that the ctrl-c, enter, q and ctrl-j keys are dynamically overridden.

This is pretty complex. Let me know if you want more details about any of this.

from tmux-copycat.

mMontu avatar mMontu commented on August 16, 2024

I had the exactly same problem, while using C-j for pane navigation.

The command unbind -t vi-copy C-j indeed solved the problem. Maybe it could be included as part of the plugin, saving time for other users ( avoiding understanding when/why the key is unbinded and searching for this fix).

from tmux-copycat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.