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: 14 days ago
JSON representation
Macrothis is a plugin for neovim to save and load macros
- Host: GitHub
- URL: https://github.com/desdic/macrothis.nvim
- Owner: desdic
- License: mit
- Created: 2023-08-27T17:52:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-20T11:42:32.000Z (4 months ago)
- Last Synced: 2024-07-31T20:44:30.584Z (3 months ago)
- Language: Lua
- Size: 65.4 KB
- Stars: 24
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - desdic/macrothis.nvim - Save and load macros/registers. (Register / PHP)
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.10+](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