Home

Awesome

<h1 align="center"> šŸŽ» NeoComposer.nvim </h1> <p align="center"> <a href="http://www.lua.org"> <img alt="Lua" src="https://img.shields.io/badge/Lua-blue.svg?style=for-the-badge&logo=lua" /> </a> <a href="https://neovim.io/"> <img alt="Neovim" src="https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white" /> </a> <a href="https://github.com/ecthelionvi/NeoComposer.nvim/contributors"> <img alt="Contributors" src="https://img.shields.io/github/contributors/ecthelionvi/NeoComposer.nvim?style=for-the-badge&logo=opensourceinitiative&color=abe9b3&logoColor=d9e0ee&labelColor=282a36" /> </a> </p> <p align="center"> <img src="https://raw.githubusercontent.com/ecthelionvi/Images/main/NeoComposer.png" alt="NeoComposer"> </p>

šŸŽµ Introduction

NeoComposer is a Neovim plugin that streamlines macro management and execution with a customizable Status Line Component and Telescope Extension.

šŸŽ¹ Features

šŸ” Dependencies

šŸ„š Optional Dependencies

šŸ”­ Telescope

Install the Telescope Extension:

require('telescope').load_extension('macros')

Launch the Telescope extension using the Telescope macros command:

:Telescope macros
KeymapAction
yqYank the currently selected macro, in human readable format (normal)
<cr>Queue the currently selected macro (insert, normal)
<c-d>Delete the currently selected macro (insert)
dDelete the currently selected macro

šŸš„ Status Line

NeoComposer provides an easy way to display the recording, playback, and delay status in your status line.

demo

require('NeoComposer.ui').status_recording()

Lualine Config:

lualine_c = {
	{ require('NeoComposer.ui').status_recording },
},

For event-driven statuslines such as heirline, Neocomposer emits User autocmd events to notify the user of status changes.

User EventTriggerData
NeoComposerRecordingSetWhen when starting or finishing recording a macro{ recording: boolean }
NeoComposerPlayingSetWhen when starting or finishing playing a macro{ playing: boolean }
NeoComposerDelaySetWhen when delay is set{ delay: boolean }
{
  provider = function(self)
    return self.status or ""
  end,
  update = {
    "User",
    pattern = { "NeoComposerRecordingSet", "NeoComposerPlayingSet", "NeoComposerDelaySet" },
    callback = function(self)
      self.status = require("neocomposer.ui").status_recording()
    end
  }
}

šŸ¢ Delay Timer

For complex macros over large counts, you can toggle a delay between macro playback using the ToggleDelay command:

:ToggleDelay

demo

šŸ’­ Popup Menu

Use the toggle_macro_menu keybind <m-q> to open the interactive popup macro menu.

demo

šŸ” Macro Preview

As you cycle your available macros with the cycle_next: <c-n> and cycle_prev: <c-p> keybinds the queued macro will be previewed in the buffer.

demo

šŸŖ„ Usage

NeoComposer designates macro number 1 as queued for quick access and execution.

FunctionKeymapAction
play_macroQPlays queued macro
stop_macrocqHalts macro playback
toggle_macro_menu<m-q>Toggles popup macro menu
cycle_next<c-n>Cycles available macros forward
cycle_prev<c-p>Cycles available macros backward
toggle_recordqStarts recording, press again to end recording
yank_macroyqYank the currently selected macro, in human readable format into the default register

Edit your macros in a more comprehensive way with the EditMacros command:

:EditMacros

Clear the list of macros with the ClearNeoComposer command:

:ClearNeoComposer

šŸ“¦ Installation

  1. Install via your favorite package manager.
{
  "ecthelionvi/NeoComposer.nvim",
  dependencies = { "kkharji/sqlite.lua" },
  opts = {}
},
use {
  "ecthelionvi/NeoComposer.nvim",
  requires = { "kkharji/sqlite.lua" }
}
  1. Setup the plugin in your init.lua. Skip this step if you are using lazy.nvim with opts set as above.
require("NeoComposer").setup()

šŸ”§ Configuration

You can pass your config table into the setup() function or opts if you use lazy.nvim.

The available options:

OptionKeymapAction
notifytrueEnable/Disable notifications
delay_timer"150"Time in ms between macro playback when Delay Enabled
status_bg"#16161e"Background color of status line component
preview_fg"#ff9e64"Foreground color of macro preview text
toggle_macro_menu<m-q>Toggles popup macro menu
play_macroQPlay queued macro
yank_macroyqYank the currently selected macro, in human readable format into the default register
stop_macrocqHalts macro playback
toggle_recordqStarts recording, press again to end recording
cycle_next<c-n>Cycles available macros forward
cycle_prev<c-p>Cycles available macros backward

Default Config

local config = {
  notify = true,
  delay_timer = 150,
  queue_most_recent = false,
  window = {
    width = 60,
    height = 10,
    border = "rounded",
    winhl = {
      Normal = "ComposerNormal",
    },
  },
  colors = {
    bg = "#16161e",
    fg = "#ff9e64",
    red = "#ec5f67",
    blue = "#5fb3b3",
    green = "#99c794",
  },
  keymaps = {
    play_macro = "Q",
    yank_macro = "yq",
    stop_macro = "cq",
    toggle_record = "q",
    cycle_next = "<c-n>",
    cycle_prev = "<c-p>",
    toggle_macro_menu = "<m-q>",
  },
}
<h3 align="center"> Made with ā¤ļø in Nebraska </h3>