https://github.com/roguh/vis-copypasta
A vis plugin that creates keybindings for copying and pasting to the system clipboard with Ctrl-V and Ctrl-C.
https://github.com/roguh/vis-copypasta
Last synced: 9 months ago
JSON representation
A vis plugin that creates keybindings for copying and pasting to the system clipboard with Ctrl-V and Ctrl-C.
- Host: GitHub
- URL: https://github.com/roguh/vis-copypasta
- Owner: roguh
- Created: 2023-04-13T09:16:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-13T16:50:21.000Z (about 3 years ago)
- Last Synced: 2025-08-29T07:13:41.488Z (10 months ago)
- Language: Lua
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vis-copypasta
A vis plugin that creates keybindings for copying and pasting to the system clipboard.
## Installing this vis plugin
Download the repository. One way is with the git CLI:
```
git clone https://github.com/roguh.vis-copypasta
```
Copy `copypasta.lua` next to `visrc.lua`.
```sh
$ ls
visrc.lua copypasta.lua
```
Add this line to your `visrc.lua`:
```lua
require('copypasta')
```
`visrc.lua` can be found at `XDG_CONFIG_HOME/vis` or `$HOME/.config/vis`.
If not set, use `:help` for instructions on how to initialize `vis`.
You may also install it in Lua's path.
See documentation about the [`require` function](https://www.lua.org/pil/8.1.html).
If the copypasta plugin is found in another directory, use the different path and no `.lua` suffix:
```lua
copypasta = require('plugins-directory/vis-copypasta/copypasta')
-- Call this if the copypasta directory doesn't exist
copypasta.set_directory(os.getenv('HOME') .. '/.cache/bak')
```
```sh
$ tree
.
├── vis-copypasta
│ ├── README.md
│ └── copypasta.lua
└── visrc.lua
```
This module requires no configuration.
See [Vis' plugins documentation](https://github.com/martanne/vis/wiki/Plugins).
### Alternative installation
It may be easier to simply copy and paste all of `copypasta.lua` into your `visrc.lua` ;)
## Usage
Type Ctrl-V in `NORMAL` or `INSERT` modes.
Type Ctrl-C in `NORMAL` or `VISUAL_LINE` modes.
Ctrl-C does not work with multiple selections. It only copies the last value.
All of these commands use `vis`' built-in tool `vis-clipboard`, which is cross-platform.