A lightweight Neovim plugin for quickly aligning code using multiple cursors
AlignEmDemo.mp4
AlignEm.nvim provides a simple way to place multiple cursors and align text across lines, inspired by the convenience of multiple-cursor selections and easy-align functionality.
Lazy
{ "superNGA/AlignEm.nvim" }
Setup
local AlignEm = require("AlignEm")
AlignEm.setup()
-- Recommended keymaps
vim.keymap.set("n", "<Esc>", AlignEm.RemoveAllCursors, { desc = "AlignEm: Remove all cursors" })
vim.keymap.set("n", "<C-0>", AlignEm.AddCursor, { desc = "AlignEm: Add cursor" })
vim.keymap.set("n", "<C-m>", AlignEm.AlignAllCursors, { desc = "AlignEm: Align all cursors" })
- Switch to Normal mode
- Place the cursor on the desired line and press to add an alignment cursor.
- Use normal Noevim motions to move all plugins at once.
- Press to align all marked cursors.
- Press to clear all alignment cursors when finished.