Comments (3)
Interesting idea that also crossed my mind. The current implementation looks at
every byte in order to determine if it's a delimiter or not. One possible
solution in order to support both the current -d' option and
-r' would be to
always use regular expressions internally. This might actually lead to a
reduction of #LOC which I find tempting.
Your `ps' example is a great use case. You can get quite creative with regular
expressions. Here's another idea: match file and line numbers from a compiler
output and open up your editor of choice with the erroneous file and line:
OPTS=$(make 2>&1
| yank -r '^[^:]+:[[:digit:]]+'
| awk -F : '{print "-t", $2, $1}')
$EDITOR $OPTS
I will definitely look into this!
On Fri, Oct 23, 2015 at 02:54:12AM -0700, Adrien Lavoillotte wrote:
With the seemingly canonical
ps
example, I'd like to be able to limit the selectable fields to PIDs, so maybe only numbers. Instead of specifying a selector, I'd give a regex (preferably PCRE):ps | yank -r '\b\d+\b' | xargs kill
yank
would then only go through number fields.What do you think?
Reply to this email directly or view it on GitHub:
#16
from yank.
Update: since the support for arrow key bindings is now in testing I'm going to start implementing support for regex.
from yank.
See the new regex branch[1].
[1] #20
from yank.
Related Issues (20)
- Add h,j,k,l bindings HOT 4
- vi-like keybindings HOT 6
- yanking without input HOT 6
- Fedora RPM's HOT 3
- Stripping debug info HOT 5
- support no-interaction mode HOT 5
- yank only sees the first page HOT 2
- How to use yank over ssh? HOT 6
- Crashes when using -g with -l or -d HOT 1
- How to yank to clipboard? HOT 1
- suggestion: delimiter command HOT 1
- Why doesn't `... -- <command>` work? HOT 1
- Skip fields using hotkey like ctrl-arrow or ctrl-end, ctrl-home keys? HOT 1
- Setting YANKCMD to "xsel --clipboard" HOT 2
- Copy all output? HOT 3
- Install failed on Ubuntu 20.04.2 HOT 2
- jump across filenames with specific extension HOT 2
- Yank not using xsel on Ubuntu 20/22? HOT 4
- `--select-1` option similar to fzf HOT 3
- Make yank not depend on `xsel` HOT 1
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 yank.