-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c2faed7
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [1.0.0] - 2022-08-13 | ||
|
||
Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ISC License | ||
|
||
Copyright ⓒ 2022-present Aral Balkan, Small Technology Foundation. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Send Output To Editor (sote) | ||
|
||
_Pronounced sauté, get it? (Sorry.)_ | ||
|
||
Sends the output of the last command to your default editor. | ||
|
||
If that’s something like [Helix Editor](https://helix-editor.com), you can use multiple cursors, etc., to manipulate it and copy it into the system clipboard (<kbd>space</kbd><kbd>y</kbd> in Helix) to use in future commands. | ||
|
||
## Install | ||
|
||
Install using [Fisher](https://github.com/jorgebucaran/fisher): | ||
|
||
```shell | ||
fisher install small-tech/sote | ||
``` | ||
|
||
## Use | ||
|
||
You can use the `sote` command or, even better, bind it to a keyboard shortcut. For example, to bind it to <kbd>ctrl</kbd><kbd>s</kbd>, add the following to your fish configuration (likely _~/.config/fish/config.fish_): | ||
|
||
```fish | ||
bind \cs sote | ||
``` | ||
|
||
## How it works | ||
|
||
Technically, like basically everything else in Fish shell, [it’s just a function](https://zerokspot.com/weblog/2016/01/16/fishy-functions/). | ||
|
||
It gets your last history item (`$history[1]`), re-runs it using `eval()` (__so don’t use it on anything that has side-effects__), then splits the output into multiple lines and sends it to your `$EDITOR`. | ||
|
||
## Like this? Fund us! | ||
|
||
[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit. | ||
|
||
We exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist. | ||
|
||
## Copyright | ||
|
||
Copyright © 2022-present [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org). | ||
|
||
## License | ||
|
||
Sote is released under [ISC](./LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Send Output to Editor (sote) | ||
function sote | ||
set -l lastCommand (eval $history[1]) | ||
printf '%s\n' (string split0 (eval $history[1])) | "$EDITOR" | ||
end |