nvim-mini / nvim-mini/mini.nvim

Add support for "surround copy (yank)" and "surround paste"

Open
#1,325 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request mini.surround
Dominant language
Lua
Stars
9.5k
Forks
310
Avg merge
4h 16m
Merged PRs (30d)
1

Description

Contributing guidelines
Module(s)

mini.surround

Description

I was playing with my mini.surround config the other day, and I realized that occasionally I want to "copy" a surround, particularly complex ones like "f", and "paste" the same text in another piece of code.

Thinking about it conceptually, executing a command such as "syf" over a function call like vim.print(my_variable), so it would internally store { left = "vim.print(", right = ")" }. Then it should be possible to execute spiw over my_other_variable to get vim.print(my_other_variable).

I it a go in implement this feature, and it was easier to implement than I anticipated. If there's interest, I can format it and open a proper pull request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mini.surround module and the implementation shown in the linked comparison branch. Check how the reported syf and spiw examples should behave, then determine the module’s expected completion criteria from that proposal. Done means the surround can be copied from one text region and pasted onto another, including complex surrounds such as f.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.