Comments (18)
Often people have the pwd on their bash prompt like so (fish truncates all but the last paths to one letter):
endrebak@havpryd ~/c/c/workflows>
I'd like some way of avoiding those in the file search, but dunno if that is possible.
from tmux-copycat.
Get commit hash in git log
set -g @copycat_search_WHATEVER '^commit[[:space:]]*'
from tmux-copycat.
Amazon jobflow ID
set -g @copycat_search_C-j 'j-[[:alnum:]]*'
from tmux-copycat.
I have a stored search for quoted text:
set -g @copycat_search_C-q '\"[^\"]*\"'
Frequently filenames, error messages and other important info are quoted in a program's output.
However, I'm unable to match single quotes, even escaping doesn't work. Is this a bug or am I doing it wrong?
from tmux-copycat.
@AnAppAMonth, interesting idea. Thanks for the submission.
I think a single quote searches could have a bug! I also just tried it and got an error.
Please open an issue with the description of what you tried. A pull request for this is also very welcome.
from tmux-copycat.
@ctjhoa improved the regex to match SHA1 hashes in every output format. See #73
from tmux-copycat.
Pull request for email address search over at #78
from tmux-copycat.
Get the last entry of a line if it is standard filename.
set -g @copycat_search_C-l '[a-zA-Z0-9_-./]+$'
This works for filenames without any path (basename - as for example for ls -l) and for git status if you are not in the root of the repo.
from tmux-copycat.
Can we have these searches in a way similar to vim-text-objects
? That would make it much easier to remember and increase the key-combination
space available to reduce clashes.
from tmux-copycat.
Match kubernetes objects
e.g. "asdf-gk8nr" or "asdf-foo-7bdcf85cf5-97x64"
set -g @copycat_search_C-k '[A-Za-z0-9-]+-[a-f0-9]{10}-[a-z0-9]{5}|[A-Za-z0-9-]+-[a-z0-9]{5}'
from tmux-copycat.
Match 32 bit or 64 bit addresses
e.g. "0xffffd53a", "0xffffd53affffd53a", "ffffd53a" or "ffffd53affffd53a"
set -g @copycat_search_a '0x[A-Fa-f0-9]{8}|0x[A-Fa-f0-9]{16}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{16}' # 32 or 64 bit adresses
from tmux-copycat.
The example here
set -g @copycat_search_G '\b[0-9a-f]{5,40}\b'
should be
set -g @copycat_search_G '\b[0-9a-f]{5}|[0-9a-f]{40}\b'
from tmux-copycat.
The search goes from bottom to top. Is there any way to search only the last command output (preferably from top to bottom)?
from tmux-copycat.
based on a quick search no. you would need to re-write or duplicate and change https://github.com/tmux-plugins/tmux-copycat/blob/master/scripts/copycat_generate_results.sh#L20
--
I guess you could use this somehow https://github.com/tmux-plugins/tmux-copycat/blob/master/scripts/copycat_jump.sh#L231
Use get_number_of_results to set initial jump position.
from tmux-copycat.
The "last entry" file search didn't work for me. The order of the regex was causing an issue:
set -g @copycat_search_C-f '[a-zA-Z0-9_./-]+$'
For the future reader, here's the issue reporting the single quote breakage.
I was not able to get the quoting snippet to work:
set -g @copycat_search_C-q "\"[^\"]*\""
It always selected the quotes incorrectly for me (if anyone knows why, I'd love to hear it):
from tmux-copycat.
@iloveitaly looks like you are on a mac.
Maybe you are not using GNU grep?
$ grep --version
grep (GNU grep) 3.11
Packaged by Homebrew
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others; see
<https://git.savannah.gnu.org/cgit/grep.git/tree/AUTHORS>.
grep -P uses PCRE2 10.42 2022-12-11
from tmux-copycat.
@iloveitaly I am on a mac, but changing the default grep
installation would be a large-ish change since many other applications rely on the terrible grep
version installed by default.
from tmux-copycat.
if you are on an M1 chip just do
export PATH=/opt/homebrew/opt/grep/libexec/gnubin/grep:$PATH"
on an x86-64 bit machine do
export PATH=/usr/local/opt/grep/libexec/gnubin:$PATH"
you can check what to export at
$ brew info grep
==> grep: stable 3.11 (bottled), HEAD
GNU grep, egrep and fgrep
https://www.gnu.org/software/grep/
/opt/homebrew/Cellar/grep/3.11 (19 files, 1MB) *
Poured from bottle using the formulae.brew.sh API on 2023-07-04 at 11:37:53
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/grep.rb
License: GPL-3.0-or-later
==> Dependencies
Build: pkg-config (installed)
Required: pcre2 (installed)
==> Options
--HEAD
Install HEAD version
==> Caveats
All commands have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"
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.