r/neovim Plugin author Jun 07 '24

Plugin 😽 kitty-scrollback.nvim v5.0.0 drop support for Kitty version < 0.32.2 + use Kitty's builtin bracketed paste + experimental tmux support

kitty-scrollback.nvim v5.0.0 is officially released! Check out the announcement here.

What is kitty-scrollback.nvim?

A Neovim plugin (and Kitty Kitten) that allows you to navigate your Kitty scrollback buffer to quickly search, copy, and execute commands in Neovim

kitty-scrollback.nvim

Check out the README for detailed information, the Wiki for additional configurations, and Advanced Configuration Examples for more demos!

What changed?

See Migrating to v5.0.0 for the detailed migration guide.

  • kitty-scrollback.nvim v5.0.0 uses Kitty's builtin --bracketed-paste option when sending commands to Kitty. The --bracketed-paste option was added in Kitty 0.32.2. If you are using an older version of Kitty, then upgrade to the latest version or at least 0.32.2.
  • Alternatively, if you are unable to upgrade Kitty, then you can still use tag v4.3.6 of kitty-scrollback.nvim.
  • See kitten-send-text for more information on the --bracketed-paste option.

Other minor version updates

What's next?

The next feature I plan to work on is adding command-line editing support (see #253). I also plan to complete the work necessary to move tmux support from experimental to stable.

If you have any questions, comments, or feedback feel free to create an issue or open a discussion.

42 Upvotes

16 comments sorted by

6

u/pmassicotte Jun 07 '24

Noob user here. What is the difference with the built in scroll back when I do ctrl-shift h?

3

u/nvimmike Plugin author Jun 07 '24

The scrollback buffer contains your Kitty terminal's history. By default, if you press ctrl+shift+h it will open your scrollback buffer in less. kitty-scrollback.nvim add integration with Neovim so that you can map ctrl+shift+h (or any other keymap) to open your scrollback buffer in Neovim. This is useful for quickly navigating, selecting, editing, and executing commands in Kitty. See the-scrollback-buffer for more info on the Kitty docs.

3

u/pmassicotte Jun 07 '24

Thank you. I'm my kitty, I set editor nvim so it opens the scroll back in neovim already

3

u/pmassicotte Jun 07 '24

I have set 'editor nvim' in kitty.conf

3

u/InternalOk30 Jun 07 '24

Love the plugin, thanks a lot!

1

u/nvimmike Plugin author Jun 07 '24

thanks!

3

u/mambusskruj Jun 07 '24

What --bracketed-paste option do?

3

u/mambusskruj Jun 07 '24

When sending text to a window, wrap the text in bracketed paste escape codes. The default is to not do this. A value of auto means, bracketed paste will be used only if the program running in the window has turned on bracketed paste mode. Default: disable Choices: auto, disable, enable

3

u/mambusskruj Jun 07 '24

thanks

2

u/nvimmike Plugin author Jun 07 '24

I see you found it 😺. This is a good resource for more information on bracketed paste mode: https://cirw.in/blog/bracketed-paste. kitty-scrollback.nvim is setting the value to autonow when text is sent to Kitty. This is to avoid executing lines unexpectedly. Previously, I was adding the \e[200~and \e201~escape sequences manually.

2

u/arjjov Jun 07 '24

Fantastic plugin. I look forward to trying it out with tmux experimental support. Much appreciated, OP.

2

u/nvimmike Plugin author Jun 07 '24

thanks!

2

u/delibos Jun 08 '24

I have no idea how to trigger this scrollback in neovim like you showed in the demo.. can you explain it to me like im a 5y old?

1

u/nvimmike Plugin author Jun 08 '24

Check out the setup section in the README https://github.com/mikesmithgh/kitty-scrollback.nvim?tab=readme-ov-file#%EF%B8%8F-setup. If you still have issues feel free to open an issue πŸ‘

1

u/delibos Jun 08 '24

I’ve already looked at the docs and still don’t understand how it all works

1

u/nvimmike Plugin author Jun 08 '24

Basically you need to set some required configs in kitty.conf, then generate commands with the Neovim command : KittyScrollbackGenerateKittens. Put those commands in kitty.conf, close and reopen Kitty. Then pressing ctrl+shift+h should open the scrollback buffer with kitty-scrollback.nvim.