Well, whether I find this useful or not, I’ll at least say I appreciate you sharing this. This may be useful for people to see, to help them realise that there isn’t so much magic in the terminal, and they can piece together their own workflows in a similar fashion.
This ends up being less useful than just opening a file with
$PAGER
.If I want to “peek” at files, I would use the preview feature of fzf.
The idea is you can still see your buffer while peeking. fzf is also much more complex than what I’ve shown.
Right, but I’m not sure why that’s useful. I don’t expect the filesystem to change while I’m looking at it.
Let’s say you have run some command line programs that give some output. Now you need to compare this output with some content in a file.
This lets you still view this output while viewing a file.
You can use any program to view…The purpose of the repository is to show you can have simple “peek” functionality with a very small command.
Well, whether I find this useful or not, I’ll at least say I appreciate you sharing this. This may be useful for people to see, to help them realise that there isn’t so much magic in the terminal, and they can piece together their own workflows in a similar fashion.
I don’t get it. Why not use less or head?
The idea is you can still see your buffer while peeking.
what file is so important you’re just dying to look at it, but not important enough that you can run
less file
and get back to your buffer laterThe idea is you can still see your buffer while peeking.
What if the
$EDITOR
path has spaces in it? Shouldn’t it betmux split-window -p 33 "$EDITOR" $@
?Yes it should be that. Keep in mind I also expect people to modify this as they need :)
So what does it do? I guess, looking at the syntax, it splits your terminal with a new file to look at in your editor?
Splits if run in tmux. I’d use this to run
less
instead, as only reading is more of a peek and$EDITOR
can be invoked if needed by hittingv
.How in the world did I not know this until now?!