News for hackers. Stuff that matters.
Re:Neovim v0.4.0 by spraak on Monday September 16, 2019 @01:45AM (#20981411)
> nvim_open_win: create floating windows (and external, for supporting UIs)

I've been running 0.4.0 since it came out for this feature.

Also I recommend you check out coc.vim for the best completer. It uses the same language server protocol that VS Code uses (and many of the plugins for coc.vim are forked fr VS Code plugins)

Re:Neovim v0.4.0 by norcalli on Monday September 16, 2019 @03:51AM (#20981922)
All completers will be able to utilize floating windows immediately, so it's not a special feature of coc.nvim. Using LSP is also not unique to coc.nvim. Deoplete, for instance, supports both as well. I personally have no interest in using coc since it's a javascript based project.
Re:Neovim v0.4.0 by spraak on Monday September 16, 2019 @06:54AM (#20982811)
Yes, I wasn't trying to say it's only possible to use with coc.vim, and neither was I trying to say that LSP is unique to coc.vim. But I would not recommend Deoplete.
Re:Neovim v0.4.0 by shazow on Monday September 16, 2019 @09:58AM (#20984038)
Why would you not recommend Deoplete? It works well for me.
Re:Neovim v0.4.0 by shmerl on Monday September 16, 2019 @01:50AM (#20981433)
Are there any screenshots? What exactly is a "floating window"?
Re:Neovim v0.4.0 by justinmk on Monday September 16, 2019 @01:57AM (#20981454)
Floating windows:

- Are real windows showing real buffers. No shortcuts, hacks, or compromises.

- Can be (re)positioned, anchored, or "external" (if supported by the UI).

- Support all features and API of normal windows, plus more.

Screenshot showing floating window with 'winblend':

https://twitter.com/Neovim/status/1145446583573594112

Yes, that screenshot shows Nvim in a terminal. The 'winblend' feature works in all UIs, including the TUI (all terminals that support RGB colors).

Re:Neovim v0.4.0 by Sean1708 on Monday September 16, 2019 @03:20AM (#20981766)
Just to make sure I understand correctly, that floating window is entirely within neovim (i.e. it isn't a separate window as far as your window manager is concerned)? And if that's correct, does this mean that it would work if you SSHed into a server?
Re:Neovim v0.4.0 by maccam94 on Monday September 16, 2019 @03:39AM (#20981868)
Yes, neovim is compositing the windows inside the text UI in a terminal.
Re:Neovim v0.4.0 by justinmk on Monday September 16, 2019 @04:01AM (#20981979)
Replying to PeCaN:

> slightly concerned that neovim started to cut bloat in vim and ended up implementing a compositing window manager with fake transparency.

"Window manager" existed since vim got split-windows (1990s). Redesigning it as a compositor:

- isolates windows logically, so that UIs can do their own layout instead of being stuck with the TUI grid

- useful for implementing floating windows

- allows reasoning about layers instead of one grid driven by special-cases throughout the project

- helps with features such as "click through", z-index, etc.

The blending (fake transparency) was a small (~200 LoC) amount of code, added only for fun (and to ruffle feathers).

Re:Neovim v0.4.0 by badosu on Monday September 16, 2019 @06:13AM (#20982593)
Also, if I am not mistaken, the code that handles the multiplexing (multigrid) was not made only for this feature, but a generalization that improves a lot of capabilities for GUIs.

Thanks for all the work Neovim team!

Re:Neovim v0.4.0 by PeCaN on Monday September 16, 2019 @07:28PM (#20989570)
This is reasonable enough, but personally I'm not really convinced a text editor should be handling windows at all, especially since neovim allegedly is designed to be embedded by a ‘real’ UI (and presumably could be embedded by a terminal-based UI that handles windows—or just uses tmux).

I do recognize that I prefer software to be simpler than most people (for the record, much of the time I use ed(1)).

Re:Neovim v0.4.0 by PeCaN on Monday September 16, 2019 @03:46AM (#20981900)
That's an extremely cool party trick but I'm also slightly concerned that neovim started to cut bloat in vim and ended up implementing a compositing window manager with fake transparency.

Though the idea is just pretty damn cool in general so I can't get too grumpy about it.

Re:Neovim v0.4.0 by maccam94 on Monday September 16, 2019 @04:14AM (#20982034)
On the bright side, this is actually a demonstration of the extensive work the neovim team has done cleaning up the UI layers. justinmk's comment above goes into more detail, but basically vim has gone from having a single array of characters that gets manipulated by every type of display item to windows with their own positioning and dimensions. In addition, these windows will be exposed via APIs that external GUIs can use.
Re:Neovim v0.4.0 by oblio on Monday September 16, 2019 @04:04AM (#20981989)
Vim already had floating windows, why not make them cool/useful if they're there, anyway? :)
Re:Neovim v0.4.0 by justinmk on Monday September 16, 2019 @03:36AM (#20981857)
yes and yes.
Re:Neovim v0.4.0 by shmerl on Monday September 16, 2019 @02:00AM (#20981466)
I see, thanks!
Re:Neovim v0.4.0 by jez on Monday September 16, 2019 @01:57AM (#20981455)
Here’s an example of it used for populating some completion menus (like docs) on LSP completion in coc.vim:

https://mobile.twitter.com/neovim/status/1101893773561348096...

Re:Neovim v0.4.0 by shmerl on Monday September 16, 2019 @01:59AM (#20981464)
I see, thanks!
Re:Neovim v0.4.0 by howtofly on Monday September 16, 2019 @02:43AM (#20981612)
Now coc+ccls is the best vim plugin for C/C++. Though compared to Eclipse/CDT, several features still missed, e.g. step-by-step macro expansion.
Re:Neovim v0.4.0 by blux on Monday September 16, 2019 @03:55AM (#20981944)
Are there any good alternatives for coc.vim? I do not like the NodeJS dependency.
Re:Neovim v0.4.0 by L0stLink on Monday September 16, 2019 @09:05AM (#20983594)
I have been using LanguageClient-neovim[0]. It is great, the main difference I have observed between LanguageClient-neovim and coc.vim is that LanguageClient-neovim provides a more vim centered UX (e.g. it automatically populates location/quickfix list with errors, warnings and hints which enables quickly jumping between error locations) while coc.vim provides a great out-of-the box experience but feels like VSCode strapped to nvim (It has its own extension ecosystem based on VSCode extensions) - I greatly appreciate the effort by coc.vim's developer, he has done great work and coc.vim defiantly has its advantages[1] over LanguageClient-neovim. LanguageClient-neovim requires a lot of customization in order to fit it to your work flow but once it is done, the experience feels a lot more native. On the topic of which, LanguageClient-neovim feels lighter and faster to me and has the added advantage of being usable without any external dependencies (because it is a compiled binary). I highly recommend checking it out.

tl;dr:

coc.vim is for those looking for a VSCode like experience out of nvim (stuff works out of the box requiring minimal customization, installing plugins to get the required functionality) where LanguageClient-neovim is for those who prefer a vim centric approach (extremely minimal, manually customizing everything to get it to fit you workflow).

If you are interested in LanguageClient-neovim you can checkout my config[2][3] you might find it helpful .

[0] https://github.com/autozimu/LanguageClient-neovim

[1] It shows documentation for completion list items in a floating window similar to VSCode.

[2] https://github.com/L0stLink/anvil

[3] https://github.com/L0stLink/anvil/blob/master/settings/Langu...

Re:Neovim v0.4.0 by blux on Monday September 16, 2019 @03:26PM (#20987678)
Thank you for the elaborate answer, seems like LanguageClient-neovim will be a perfect fit!
Re:Neovim v0.4.0 by L0stLink on Monday September 16, 2019 @04:37PM (#20988323)
No problem, LanguageClient-neovim can be a bit overwhelming at first and if you are like me, you might need to rely on the included docs and GitHub issues, but it is well worth it. I am in my spare time working on getting floating window documentation working for completion items once that is done, I will have no need to keep coc.vim installed as backup.
Re:Neovim v0.4.0 by sjustinas on Monday September 16, 2019 @06:47AM (#20982771)
Re:Neovim v0.4.0 by maccam94 on Monday September 16, 2019 @04:30AM (#20982107)
deoplete is the other major completion engine, and it's written in python.