17 ms·
Neovim v0.4.0
- spraak 7y ago> 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)
- shmerl 7y agoAre there any screenshots? What exactly is a "floating window"?
- justinmk 7y agoFloating 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 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).
- shmerl 7y agoI see, thanks!
- Sean1708 7y agoJust 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?
- justinmk 7y agoyes and yes.
- maccam94 7y agoYes, neovim is compositing the windows inside the text UI in a terminal.
- PeCaN 7y agoThat'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.
- oblio 7y agoVim already had floating windows, why not make them cool/useful if they're there, anyway? :)
- maccam94 7y agoOn 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.
- justinmk 7y agoReplying 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).
- jez 7y agoHere’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?lang=en https://mobile.twitter.com/neovim/status/1101893773561348096...
- shmerl 7y agoI see, thanks!
- iKnowWhyIamHere 7y agoCan coc.vim be used for vim?
- howtofly 7y agoNow 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.
- norcalli 7y agoAll 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.
- blux 7y agoAre there any good alternatives for coc.vim? I do not like the NodeJS dependency.
- maccam94 7y agodeoplete is the other major completion engine, and it's written in python.
- sjustinas 7y agoSee https://langserver.org/#implementations-client https://langserver.org/#implementations-client
- L0stLink 7y agoI 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 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 https://github.com/L0stLink/anvil [3] https://github.com/L0stLink/anvil/blob/master/settings/LanguageClient-neovim.vim https://github.com/L0stLink/anvil/blob/master/settings/Langu...
- vhakulinen 7y agoI'll just leave a shameless plug for my neovim GUI project here: https://github.com/vhakulinen/gnvim https://github.com/vhakulinen/gnvim. It has a WIP PR[1] for implementing multigrid support, which would allow features such as scrollbars. There are many other GUIs too, such as oni/oni2, gonvim, neovim-gtk and neovim-qt. Extensive list can be found here: https://github.com/neovim/neovim/wiki/Related-projects#gui https://github.com/neovim/neovim/wiki/Related-projects#gui 1: https://github.com/vhakulinen/gnvim/pull/95 https://github.com/vhakulinen/gnvim/pull/95
- justinmk 7y ago> multigrid support, which would allow features such as scrollbars also per-window font-size, dimensions, line-spacing--so Nvim UIs can add unlimited decorations to windows while the editor navigation remains exactly the same (driven by Nvim).
- cetra3 7y agoBoth neovim-gtk & gnvim are great but don't integrate nicely with standard ctrl + c, ctrl + v actions which is super frustrating. VSCode with vim plugin handles this well with the Use Ctrl Keys option set. If you're in insert mode, ctrl + v will paste, otherwise ctrl + v will start visual mode. If you are selecting text, ctrl + c will copy.
- justinmk 7y agoYou can create mappings for that. Adding a bazillion one-off options like "Use Ctrl Keys" to avoid creating mappings, defeats the purpose of using vim, since creating mappings is the bare minimum way to configure it. (But Vim did so anyways for Windows, in the form of the "mswin.vim" plugin, which is enabled by default, causing confusion for users expecting vim to behave like vim.)
- cetra3 7y agoI wouldn't even know where to begin to approach these mappings as they are highly context dependent. If it is possible with just normal vim mappings then that'd be excellent.
- posedge 7y agoWhat are the most notable improvements over vim that the authors of neovim speak of? https://neovim.io https://neovim.io
- climb_stealth 7y agoI have been running it for quite a few months and there are two improvements that I can think of: 1) In visual mode you have a block cursor and in insert mode it is a |. 2) With ':set inccommand=nosplit' you get live previews for substitution calls. For example :%s/foo/bar/ will update your foos on screen whilst you type the command. Otherwise it is pretty much a drop-in replacement without issues.
- mths 7y ago> Otherwise it is pretty much a drop-in replacement without issues. Except for the crashes. The crashes are an issue. Don't get me wrong though, I like nvim. I use it occasionally. But the crashes are an issue.
- tadzik_ 7y agoInteresting. Are you using some sophisticated plugins, some unusual platform? I've aliased vim to neovim a few years ago and it has not crashed once for me.
- mths 7y agoOSX. Plugins: ale, bufexplorer, nerdtree, rust.vim, vim-airline, vim-airline-themes, vim-colors-solarized I generally start vim in my src folder on Monday and exit it on Friday. Occasionally, just on a whim, I run nvim instead. Mostly its fine. But the times I've experienced crashes or other hickups like rendering bugs forcing me to :qa!, it's been on nvim. Edit: Oh and I run it in the terminal, iTerm2 to be precise.
- afarrell 7y ago
- demee 7y agoWhy do we need such things in 2019?
- YawningAngel 7y agoCommand line vim is one of the most productive editing environments on the planet, why wouldn't we?
- bori5 7y agoLove vim but would hate to use it for Java where I found an IDE such as Eclipse much easier to work with. Back in the day when I used to do that sort of thing.
- maccam94 7y agoLanguage Server Protocol plugins are adding functionality for completion/docs/refactoring these days, and vim-jdb looks pretty decent.
- bori5 7y agoI feel like I need a PhD in configuring vim to do that stuff. The fact vim has been around forever and still hasn’t caught up with an IDE for ease of use doesn’t convince me at this point to use it for coding Java. Eclipse/IntelliJ is simple download and everything ready to go, git integration, all kinds of auto complete , debugger, etc... you hit the ground running pretty much. Can’t say the same about vim for Java, but think it’s fantastic that progress is being made to close the gap. Now where’s the simple one line config command to get me started ;) ....
- h1d 7y agoI don't see there's a reason to use vim locally as other editors are far advanced when vim isn't changing at all. But there's a use on the server side because you only have vim or emacs there.
- narimiran 7y agoIt seems that there is already Neovim 0.4.2: https://github.com/neovim/neovim/releases/tag/v0.4.2 https://github.com/neovim/neovim/releases/tag/v0.4.2
- odiroot 7y agoOn this topic, can anyone share their Python setup for Neovim? I used ALE and Deoplete + a bit of Jedi and got frustrated with it breaking / working much worse than ST3 and just removed all the plugins.
- 0xADEADBEE 7y agoI use CoC.vim [0] with whatever Python plugin they recommend and it's easily been the most painless autocompletion I've ever used in over a decade of Vim. I wrote some (admittedly pretty basic) Python with it last week with no complaints! [0] - https://github.com/neoclide/coc.nvim https://github.com/neoclide/coc.nvim
- L0stLink 7y agoI use LanguageClient-neovim[0] with pyls[1], tests are run using `:make` which populates the quickfix list with errors. I also heavily use the location list which gets populated with errors and warnings etc. automatically by LanguageClient-neovim. All of this is accessible through convenient keybindings. Full python setup here: https://github.com/L0stLink/anvil https://github.com/L0stLink/anvil Status bar is lightline[2] with a custom theme, which I haven't gotten around to pushing yet. I can share it if you are interested. Other than the colors on the bar everything should work. [0] https://github.com/autozimu/LanguageClient-neovim https://github.com/autozimu/LanguageClient-neovim [1] https://github.com/palantir/python-language-server https://github.com/palantir/python-language-server [2] https://github.com/itchyny/lightline.vim https://github.com/itchyny/lightline.vim
- Aissen 7y agoI want to take a moment to thank the Neovim authors, as a VIM user. Thanks to you, VIM has felt the pressure and greatly improved, including the vim 8 async plugin feature (which has now trickled-down in all distros). I can now use coc.nvim and ccls to have an IDE-like experience inside vim, which really helps reducing further the write-compile-test-fix loop.
- NilsIRL 7y agoWhy are you still using VIM if you like Neovim's features? (this is not a rhetorical question)
- Aissen 7y agoNever attempted to make the move (friction, sizeable vimrc). I've mostly been using the distro builds, which for neovim often meant an outdated version. I can also admit that I've benefited from the project, even if I've never used it. Like everyone using Firefox is currently benefiting from WebRender, despite never moving to Servo. We often find criticisms of forks in OSS (waste of resource, we should work together through a common goal), but the truth is that this flawed mechanism allows for innovation and experimentation. Which is also why the BigCos that ship different competing products (say, messaging apps), are often the most innovative because it prevents (some kind of) in-fighting and cookie licking.
- xvzwq 7y agoI have a reasonably large .vimrc, but I only had to change one line to switch to Neovim. All the plugins (~10) worked too.
- linsomniac 7y agoAgreeing with another response: I have a vimrc that I've accumulated over something like 20 years, I kept putting off switching to Neovim because I anticipated it would be a headache, and in the end it only required something like half an hour to make the switch, probably less. I would classify it as "easy peasy".
- 7y ago
- wruza 7y agoLast time I checked neovim-qt on mswin, it couldn't make an explorer association due to non-standard command-line treatment, rendering it useless from gui pov. Reporting an issue got some friction, but now it seems that they fixed that. But from double-clicking .txt to editing it spends 2 seconds. Vim just opens instantly. Also, neovim doesn't respect scroll amount setting, scrolling three fixed lines per scroll step instead. But I have set it to 6. set guifont=* -- simply doesn't work set guifont=Consolas:h10 -- "font reports bad fixed pitch metrics". What? set linespace=3 -- it changes, but doesn't care to redraw contents (except the cursor) or resize a window so it could fit in a screen. If you're going from 0 to 3-4, it is not even obvious why everything froze and you can't : into command mode (it is simply hidden under the bottom of the screen). I know that they're after fixing some internals that are hard parts in Vim, but if you're replacing a horse with a car, make sure it is more comfortable than a bicycle. I also know that neovim-qt is NOT neovim core, but...?
- Asooka 7y agoI really hope at some point we get one official blessed GUI implementation per platform a-la gVim and we don't have to pick and choose which particular one has the least shortcomings.
- nurettin 7y agoThe vim tricks I got used to in the past 15 years are neat for a quick remote edit, however, nowadays I enjoy RAM eating smart editors like vs code and intellij which makes me satisfyingly efficient without remembering to use my shortcuts. What I do is mostly refactoring, finding files by name or contents and moving cursor to places I've been in which provides seamless navigation between files as well.
- WorldMaker 7y agoIt's possible to get a best of both worlds setup if you try. Have you tried the Vim plugin for VS Code? The VS Code plugin is interesting in context of this Neovim update because it will actually use parts of Neovim as a "native library" to speed some operations (mostly ex commands), if Neovim is installed. https://github.com/VSCodeVim/Vim https://github.com/VSCodeVim/Vim
- Koshkin 7y ago> a best of both worlds Or the worst.
- cygned 7y agoThe most interesting fact about this release - from my personal point of view - is that I don’t care. I am usually very interested in updates to software I use often. nvim/vim is a program I use every day but I never had the feeling that it was lacking anything. I never ran into bugs. I don’t even have the feeling that I will grasp all of its features anyway not to mention the countless plugins. And I expect this upgrade to be stable and frictionless as in recent years. A tremendous achievement compared to all the other programs I have the pleasure to work with.
- noxToken 7y agoSomewhat off-topic, but that's how I feel about Sublime Text 3. It's fast. It's snappy. It handles MB-sized files with ease. I use it for text editing, small scripting (shell scripting, JS), repetitive text transformations that can be reduced to a macro, and things of that sort. Anything heavier goes into an IDE.
- asdkhadsj 7y agoHere's a random question for Vim users who might know Kakoune... What can be done to make Vim behave like Kakoune? Odd question, I know. As a former Vim user, I switched to Kakoune about a year ago and absolutely love it. The multi cursor behavior, and selection before action combined to make a really excellent and visual experience. With that said, after 15 years in the Terminal, I tire of it. I want a GUI. Neovim has made some great advancements to getting users out of the Terminal (should they want that), and I envy Neovim users! Yet, I can't get away from Kakoune. Is there any hope? Appreciate any replies, thank you.
- htfu 7y agoI don't think the amount of people using any of the various (afaik all rather alpha-stage) GUI frontends is very high at all, at this point. People use nvim in their terminal, and that will likely be the case for a long time. In any case, there are many multiple cursor plugs for vim, now also supporting operator pending. And :substitute includes built-in real-time preview.
- diehunde 7y agoCan you elaborate a bit further on why you prefer Kakoune over Vim ? Thanks.
- asdkhadsj 7y agoSo, I used Vim for years - but frankly I only used what I needed. I never played vim-golf extensively, so please don't take what I say as the reasons I enjoy Kakoune as evidence of shortcomings in Vim. With that said: Kakoune's multi-cursor support sort of blew my mind when I first started using it. Combined with the always selection first model of Kakoune, it means you can plop down 10 cursors, navigate around, select, reduce and etc all of them separately will actively viewing what they have selected. Finally when you get all the selections you want, you can act on them. That's really my main workflow that I just have to have. Plugins may perhaps solve my issue. We'll see. I also am not sure how realistic living entirely in visual mode in Vim is. I'm not too well versed in visual mode, so I can't speak on it too much. Kakoune has really been a joy for me. I just want more advanced features that Terminals can't provide (multi fonts, more UI elements, etc)
- ponyous 7y agoAnyone has any idea how to get started with VIM window api? Lets say I want to create a "floating" window on the side and populate it with some text. Where do I start?
- L0stLink 7y ago> Where do I start? best place would be the docs :h nvim_open_win() here is a function that takes a buffer id and creates a floating window based on it anchored to current cursor position: let s:buff = 0 let s:buff_max_heigth = 12 function! CreateTempBuffer(buffer) abort let text = nvim_buf_get_lines(a:buffer, 0, -1, v:true) if s:buff == 0 let s:buff = nvim_create_buf(v:false, v:true) endif call nvim_buf_set_lines(s:buff, 0, -1, v:true, text) let height = len(text) if height > s:buff_max_heigth let height = s:buff_max_heigth endif let width = 0 for index in range(len(text)) let line = text[index] let lwd = strdisplaywidth(line) if lwd > width let width = lwd endif let text[index] = line endfor let width = width + 1 let opts = {'relative': 'cursor', 'width': width, 'height': height, 'col': 0, \ 'row': 0, 'anchor': 'SW', 'style': 'minimal'} let win = nvim_open_win(s:buff, v:false, opts) return win endfunction
- Sir_Cmpwn 7y agoAnd this release is the first one which is being continuously tested on OpenBSD with builds.sr.ht :) https://github.com/neovim/neovim/tree/master/.builds https://github.com/neovim/neovim/tree/master/.builds Welcome to the platform!
- oblio 7y agoAwesome!
- revscat 7y ago> nvim_paste: paste text at cursor Is there no corresponding `nvim_copy`?
- justinmchase 7y agono modes
- MisterTea 7y ago[Ahem] Ed is the standard text editor. https://www.gnu.org/fun/jokes/ed-msg.txt https://www.gnu.org/fun/jokes/ed-msg.txt