vim-abolish icon indicating copy to clipboard operation
vim-abolish copied to clipboard

Add `inccommand` preview for Neovim

Open b0o opened this issue 3 years ago • 7 comments

A Neovim PR was just merged which makes it possible to add inccommand previews to user commands. This has been the biggest thing I’ve been missing from this plugin, the ability to preview my changes before running the command.

https://github.com/neovim/neovim/pull/18194

b0o avatar May 31 '22 19:05 b0o

Until official support is added , i think this plugin should add what you're looking for. https://github.com/markonm/traces.vim

LamprosPitsillos avatar May 31 '22 23:05 LamprosPitsillos

I've gotten live preview for abolish in neovim using the live-preview plugin:

  use {'smjonas/live-command.nvim', config=function()
    require("live-command").setup {
      commands = {
        S = { cmd = "Subvert"}, -- must be defined before we import vim-abolish
      },
    }
  end}

That must be defined before adding abolish, so that live-command can take over the S from abolish.

emmanueltouzery avatar Oct 29 '22 10:10 emmanueltouzery

@emmanueltouzery Sadly, that doesn't work for me. It causes Neovim to crash with: extmark.c:255: extmark_clear: Assertion 'mark.ns > 0 && mark.id > 0' failed. But the Norm example from the live-preview plugin works as expected.

b0o avatar Oct 29 '22 22:10 b0o

@b0o probably report a bug on that plugin or neovim. I did hit an issue which may not be fixable in live-command: since they must compute a diff to display and have no idea what was changed (while abolish would know and could make a smart diff), the display can be suboptimal: https://github.com/smjonas/live-command.nvim/issues/23

emmanueltouzery avatar Oct 30 '22 07:10 emmanueltouzery

@b0o, @emmanueltouzery The crash might be the result of a Neovim bug that is triggered when runnning the :substitute command from a preview callback and at the same time running an LSP server. Not 100% confirmed though, so it would be nice if you could help confirm this. For more infos see https://github.com/smjonas/live-command.nvim/issues/24#issuecomment-1356812136.

smjonas avatar Dec 18 '22 14:12 smjonas

This has been the biggest thing I’ve been missing from this plugin

Same here. Noticed this issue from 2018 https://github.com/tpope/vim-abolish/issues/63

marcoSven avatar Oct 23 '23 19:10 marcoSven

+1!

Related to https://github.com/tpope/vim-abolish/issues/103.

mcp292 avatar Aug 02 '24 09:08 mcp292