micro plugin to do some acme-like things
  • Lua 98.8%
  • Shell 1.2%
Find a file
2026-11-14 13:00:27 -08:00
install.sh add .. to directory listing, fix line:col addresses, rename extension 2026-10-12 15:13:25 -06:00
main.lua fix typo opening system cheader 2026-11-14 13:00:27 -08:00
README.md fix Loc constructor in is_addressablefile; open addressabile files and directory listings in existing buffers if possible 2026-10-16 09:36:57 -06:00
repo.json rename in repo.json 2026-10-12 15:25:28 -06:00

ukuro

micro plugin

This implementation of kuro is a micro plugin that aims to give some of the dynamic text capabilities from acme.

installation

Just clone this repo and run the install.sh script from within it.

IMPORTANT

micro v2.0.15 (the latest release) has a bug which will make this plugin misbehave when run from files in the current directory. This is fixed in bleeding edge (master branch) but there is not a release yet so you have to build micro from source (it's easy, only requires go, make, and git. Just make and you'll have a bleeding edge micro binary.)

Because of this bug, repo.json doesn't have any releases listed (yet).

usage

The plugin operates on selected text. F5, middle click, and right click will select the word under the cursor if there is no selection.

Press F5 or middle click to run that text in your shell. The output will be dumped to a spool buffer, with the path <CWD>/+OUT where <CWD> is the directory containing the file you ran the text from. If a spool is already open, it will be appended to. The output is streamed to the spool, so output of long-running commands will be printed as it's available.

Or press F6 or right click to plumb the text. The naive plumber behaves as follows:

  1. If the text resolves to an absolute or relative directory, it lists the contents in a buffer with the path of that directory (if it already exists, its contents will be replaced).
  2. If the text resolves to a supported media file, it opens it in a default application.
  3. If the text resolves to another local file (with or without an address), it opens it in a new buffer. If there is an address, it will open it at that location.
  4. If the text is an HTTP or HTTPS URL, it opens in a web browser.
  5. Otherwise, it assumes the text is literal text to search in the current buffer. (Regex search should be done with the search command; if something equivalent to an acme tag is implemented, this might change. The reason for this is that composing a regex to search with this feature requires you to alter the file and come back to delete it after you're done using it.)

F6 is special in that it doesn't automatically select the word under the cursor if there is no selection. This can be used to spawn a directory listing quickly.

Media file support and default applications

Media files are detected by a naive pattern match on their file extension. Supported types can be found in the code (variables of name EXT_<TYPE>).

The classes of media and the environment variable which denotes the application to open them with (and defaults) are:

  • PDF -> DOCVIEW:-mupdf
  • IMG -> IMGVIEW:-nsxiv
  • A/V -> MPLAYER:-mpv
  • XCF -> GIMP:-gimp

And the web browser used is the BROWSER environment variable, or vivaldi if unset.