Ecosyste.ms: Awesome

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

https://github.com/desdic/macrothis.nvim

Macrothis is a plugin for neovim to save and load macros
https://github.com/desdic/macrothis.nvim

Last synced: about 2 months ago
JSON representation

Macrothis is a plugin for neovim to save and load macros

Lists

README

        

# Macrothis.nvim

Macrothis.nvim was created since I had a basic need for storing and loading macros. A side effect is that it works on all registers. It does most operations on register.

Works with or without telescope.

[![Macrothis.nvim demo](https://img.youtube.com/vi/d2uj8uP80OE/0.jpg)](https://www.youtube.com/watch?v=d2uj8uP80OE "Macrothis.nvim demo")

## Requirements

[Neovim 0.9+](https://github.com/neovim/neovim)

[Telescope](https://github.com/nvim-telescope/telescope.nvim) (optional)

## Using lazy.nvim
```lua
{
"desdic/macrothis.nvim",
opts = {},
keys = {
{ "kkd", function() require('macrothis').delete() end, desc = "delete" },
{ "kke", function() require('macrothis').edit() end, desc = "edit" },
{ "kkl", function() require('macrothis').load() end, desc = "load" },
{ "kkn", function() require('macrothis').rename() end, desc = "rename" },
{ "kkq", function() require('macrothis').quickfix() end, desc = "run macro on all files in quickfix" },
{ "kkr", function() require('macrothis').run() end, desc = "run macro" },
{ "kks", function() require('macrothis').save() end, desc = "save" }
{ "kkx", function() require('macrothis').register() end, desc = "edit register" }
{ "kkp", function() require('macrothis').copy_register_printable() end, desc = "Copy register as printable" }
{ "kkm", function() require('macrothis').copy_macro_printable() end, desc = "Copy macro as printable" }
}
},
```

See [documentation](doc/macrothis.txt) for defaults

## Telescope

### Enable extension

```lua
require "telescope".load_extension("macrothis")
```

### Configuration

```lua
require("telescope").extensions = {
macrothis = {}
}
```

### Usage

```
:Telescope macrothis
```

### Default shortcuts

| Shortcut | Description |
| :--- | :--- |
| <CR> | Load selected entry into register |
| <C-c> | Copy macro as printable |
| <C-d> | Delete selected entry or delete all marked entries |
| <C-e> | Edit content of macro |
| <C-h> | Show key bindings |
| <C-n> | Rename selected entry |
| <C-q> | Run macro on files in quickfix list |
| <C-r> | Run macro |
| <C-s> | Save a macro/register |
| <C-x> | Edit register (<C-c> can be used to copy the register as printable) |

Shortcuts, sorters and more can be overridden via telescope options for this plugin.

## Uninstalling

Macrothis keeps a file in the default data directory called macrothis.json