wincent/terminus

Support Neovim

wincent opened this issue · 13 comments

Test on Neovim and make any adjustments necessary to get things to work. I am not certain of how well things work, or if any bug reports will need to be sent upstream.

(Split off from #1)

Here's been my experience so far:

Working

  • Click to set the cursor position
  • Scroll up/down in a pane

Not Working

  • Pick up changes to a file when editing it in another editor. Still have to use :e to refresh it
  • Change cursor shape in Insert mode

Not Sure

  • Bracketed paste... how can you tell?

Bracketed paste... how can you tell?

In a source code file, in normal mode, try pasting a bunch of source code from the system clipboard using Command-V. The pasted text should remain correctly formatted (ie. the indenting should not get messed up), even though you didn't do :set paste and go into insert mode.

That was something that sometimes worked for me before installing Terminus and sometimes didn't, so I think you'd need someone else to verify this behavior. However, it does seem to be working now.

ntnn commented

Neovim has its own way to enable the cursor beam in insert mode: let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 (or set it as an environment variable).

I can confirm that Bracketed paste is not working in neovim (v0.1.5). Would love to get that working 😄.

If you do get it working, please send a PR @josemarluedke. I'm not using Neovim myself (and with Vim 8, there is even less incentive to do so), so I am dependent on Neovim users to implement this one.

Pasting indented code appears to work in neovim (v0.1.6).
This works with nvim -u NONE test.vim, (which has autoindent set by default) then +v
I am on macOS Sierra using the Terminal app

You wouldn't need this plugin when using neovim:

Cursor shape
Set $NVIM_TUI_ENABLE_CURSOR_SHAPE to 1.

Mouse support
Neovim has removed the 'ttymouse' option and it uses sgr by default.

Focus reporting
Neovim supports this by default, so you would only need to run :checktime on FocusGained.

Bracketed paste mode
This also works in neovim by default, if your terminal supports it.

@adriaanzon bracketed paste seems to work in insert mode, but it's not really working in normal mode for me (I use iTerm2 with tmux). Do you know if that's expected?

Ah, your right. Didn't know you could paste from any mode with Terminus. In neovim it only works in insert mode, indeed.

However, for pasting from the clipboard, I have set up some mappings to use the + register. See :h clipboard.

In neovim it only works in insert mode, indeed.

Ah, good to know that there's still a use case for using the plug-in there. Still, as I am not using Neovim myself, I'm going to have to rely on a Neovim user who cares enough to put together a PR containing the necessary tweaks to get everything tuned for Neovim out of the box:

  • Setting up bracketed paste mode for all modes except insert mode.
  • Setting $NVIM_TUI_ENABLE_CURSOR_SHAPE.
  • Bypassing the unnecessary mouse stuff.
  • Simplifying the focus-reporting stuff.

The $NVIM_TUI_ENABLE_CURSOR_SHAPE variable is now enabled by default, see neovim/neovim#5977 (unreleased).

There are also plans to add a 'guicursor' option in favor of the environment variable: neovim/neovim#6044