Git Product home page Git Product logo

Comments (4)

bruno- avatar bruno- commented on September 7, 2024

After looking into this, I have no idea how could this be improved..

Currently users can define "stored searches" by having something like this in .tmux.conf:

set -g "@copycat" "C-x|my_regex_search"

The above will create a binding prefix + C-x that will perform a search. The same mechanism is used for builtin searches eg prefix + C-f, prefix + C-u etc...

The idea was to improve it by leveraging tmux variable appending, but that is broken in tmux:

tmux set -g "@var" "foo"
tmux set -ag "@var" "bar"       # appending "bar" to the variable
tmux show -g "@var"             # => "bar", but should be "foobar"

from tmux-copycat.

soli avatar soli commented on September 7, 2024

Ok, now that I understand how it works, it is not that bad.

Indeed set -a does not work for user-options, so there might not be any necessity to improve anything. Worst case scenario, it remains possible to tmux set -ag @copycat "$(tmux show -gvq @copycat) foo" to append to an existing (or not) var.

What is needed is the documentation for the various tmux options that copycat uses. I'll try to add this and create a PR tonight.

from tmux-copycat.

bruno- avatar bruno- commented on September 7, 2024

This is a good idea:

tmux set -g @copycat "$(tmux show -gvq @copycat) foo"

Another option for handling user defined searches would be to introduce a new variable eg @copycat_searches. @copycat variable can stay the same for "plugin defined" searches.

The thing that gives me pause about both approaches is that user defined regex could quickly become messy. Example:

# users `tmux.conf
set -g @copycat "C-x|my_stored_search_regex_that_is_long_and_messy C-z|another_stored_search_that_makes_the_line_too_long"

Anyway, if you get any idea for this, I'd be glad to hear it.
On the other hand, there's no need to rush with implementation...

from tmux-copycat.

soli avatar soli commented on September 7, 2024

Well it is always possible to write:

set -g @copycat " \
C-x|my_stored_search_regex_that_is_long_and_messy \
C-z|another_stored_search_that_makes_the_line_too_long \
etc."

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.