Comments (4)
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.
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.
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.
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)
- tmux-yank stops working after one yank when tmux-copycat is present. HOT 13
- [PROPOSAL] Migration to ripgrep HOT 3
- Git status - Long file names are not detected properly HOT 1
- search not working HOT 4
- Is it possible to highlight all matches HOT 2
- Git status file search does not work with multiple panes HOT 1
- tmux-copycat slow on my machine HOT 24
- n/N bindings on window 6, pane 1 HOT 1
- Ignore $PROMPT text in backward searches HOT 2
- how to search across multiple lines ?
- Add the possibility of jumping forward or backwards from matches using vim syntax
- Anyone made it work with byobu?
- Fails to run without `en_US@UTF-8` locale
- Prefix C-g doesn't match paths starting with ../ HOT 3
- Tmux-copycat stops working after tmux commit f8ad72b2eeafc1146c116f73194a3950aa0c2143
- File search doesnt find files HOT 2
- Use native regex searches in tmux 3.2 HOT 6
- Way to disable a predefined searches. HOT 3
- FR: tmux-copycat (C-a C-u) for url search is not consistent with tmux-urlview
- Git status - issues with fish as default shell while using Allacrity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux-copycat.