An open API service indexing awesome lists of open source software.

https://github.com/givensuman/fish-copyutils

some fish plugins for copying stuff
https://github.com/givensuman/fish-copyutils

fish-plugin shell

Last synced: about 2 months ago
JSON representation

some fish plugins for copying stuff

Awesome Lists containing this project

README

          


fish-copyutils

# fish-copyutils

A port of the [Oh-My-Zsh](https://github.com/ohmyzsh/ohmyzsh) plugins [copybuffer](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copybuffer), [copyfile](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copyfile), and [copypath](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copypath) for the Fish shell, plus some extras.

### Installation

Install with [fisher](https://github.com/jorgebucaran/fisher):

```shell
fisher install givensuman/fish-copyutils
```

### Usage

#### `copybuffer`

Copy text in command line to clipboard

```shell
echo "A command still being typed" # -> Copy with `ctrl+o`
```

`ctrl+o` keybinding can be rebound with `copybuffer_keybind` variable; just reinstall after doing so

#### `copyfile`

Copy file contents to clipboard

```shell
copyfile hello_world.txt # -> Hello, world!
```

#### `pastefile`

Paste clipboard contents to file

```shell
pastefile hello_world.txt # -> hello_world.txt created
```

#### `copypath`

Copy path to clipboard

```shell
# both of these have the same result
copypath /foo/bar # -> /foo/bar
cd /foo/bar
copypath # -> /foo/bar
```

#### `copy`, `paste`

Aliases for `fish_clipboard_copy` and `fish_clipboard_paste`.

### Requirements

As you might expect, currently heavily leverages the `fish_clipboard_copy` and `fish_clipboard_paste` functions built into the shell, which only support the following system clipboards:

- `pbcopy`
- `wl-copy` using Wayland
- `xsel` and `xclip` for X11
- `clip.exe` on Windows

See the [docs](https://fishshell.com/docs/current/cmds/fish_clipboard_copy.html) for more details.

### License

[MIT](./LICENSE)