News for hackers. Stuff that matters.
Re:Neovim v0.5 by luke2m on Friday July 02, 2021 @01:55PM (#27714621)
Could someone sell me on why I should switch to this from regular Vim?
Re:Neovim v0.5 by ratorx on Friday July 02, 2021 @02:04PM (#27714722)
Integrated LSP is quite nice (and the ecosystem around it is just getting started), but it’s not the thing I’m most excited about.

My favourite new thing is actually tree-sitter. Currently it’s being hyped for better syntax highlighting (which is nice), but I’m most excited about defining text objects on language constructs. I really don’t like trying to shoehorn words, sentences and paragraphs to deal with parameters, scopes, functions etc. Having language-aware text objects for these is really neat.

I don’t think it’s anything that would be impossible to get working in Vim, but being built-in is pretty nice.

Re:Neovim v0.5 by jay-aye-see-key on Friday July 02, 2021 @11:39PM (#27719176)
Tree-sitter based text-objects are one of my favourite parts of neovim 0.5 too. Now I can have class, function, parameter, and comment text-objects that can be manipulated as easily as words or paragraphs.

This plugin sets it all up and has some examples: https://github.com/nvim-treesitter/nvim-treesitter-textobjec...

Re:Neovim v0.5 by jamal-kumar on Friday July 02, 2021 @02:09PM (#27714774)
There's a few really cool things. The built in LSP is pretty clean compared to clunky nodejs or python plugins which I've found to clog down on huge codebases. The syntax engine has been improved by a tree-sitter algo, so it's way more robust with the syntax hilighting. And while I haven't messed with this yet you can do the whole config file in Lua now, which sounds pretty powerful.

The improved tree-sitter code parsing also allows for stuff like this which you won't find fully implementable in mainline Vim yet:

https://github.com/nvim-telescope/telescope.nvim

Re:Neovim v0.5 by cturtle on Friday July 02, 2021 @02:04PM (#27714718)
I've been using the nightly builds for a while now, and the language server support works very well, but for me the most exciting part of Neovim is Lua. Lua isn't the headlining feature of v0.5, but the API has still grown a lot since the last release.

As an example of why I love Lua support, I wrote a small file finding plugin for myself because I wasn't satified with the many alternatives (not a huge fan of fuzzy-matching). It took only a couple days to have a working plugin, and it has been fun to extend it with new features over the last month. The Lua API is relatively straightforward, and it really lowers the bar for writing plugins and small helper functions to add to your config.

Switching from Vim is not necessary, but Lua support alone was enough to convince me to give it a try, and is the main reason I have stayed with Neovim.

Re:Neovim v0.5 by vlunkr on Friday July 02, 2021 @02:17PM (#27714871)
Originally the big selling points (IMO) were that it supported async plugins and an embedded terminal. Vim added both of those in version 8. For whatever reason this issue bugs me enough to keep me from switching https://github.com/neovim/neovim/issues/1496. I tend to open things like :!tig and neovim can't do it.
Re:Neovim v0.5 by gooseyard on Friday July 02, 2021 @05:00PM (#27716792)
I did it a while back to see if I would notice anything different. I moved to vim a few years ago on a whim after using emacs for decades, so I am far from a vim power user, but with the modest configuration I use, I couldn't tell any difference, so I figured I would keep using it until I ran into a situation where neovim failed in some way that vim didn't. So far (maybe 6 months?) I haven't run into any issues, and I don't think I've added any plugins to my setup that would only work with neovim. This is all to say, it's probably a fairly easy experiment to switch with a fairly low risk of issues if you switch back.

I'm probably a bad neovim reviewer though since I'm not really keen to try the LSP stuff. I wind up working in a lot of different languages and inevitably I feel like getting accustomed to completion working well in language A only to have it fail with B is more annoying than having no completion at all. I'm curious whether I'll wind up using anything which is only possible in neovim.

Re:Neovim v0.5 by humility on Friday July 02, 2021 @02:07PM (#27714749)
lots of stuff. but mainly:

* ease of getting started. nvim is just vim, you can bring over your vim config and it'll just work.

* integrated lsp. you could have vscode like auto completion natively

* tree-sitter. google it to believe it

and much, much more

Re:Neovim v0.5 by thiht on Friday July 02, 2021 @03:00PM (#27715406)
> tree-sitter. google it to believe it

After Googling I have no idea what it is, it's a parser but for what? Syntax highlighting? That doesn't seem so impressive

Re:Neovim v0.5 by e12e on Friday July 02, 2021 @06:59PM (#27717904)
https://tree-sitter.github.io/tree-sitter/

Yes, but it enables many tools to cooperate on highlighting/"understanding" synntax.

Re:Neovim v0.5 by arp242 on Saturday July 03, 2021 @03:28AM (#27719968)
> you can bring over your vim config and it'll just work.

Except when it doesn't:

  $ nvim init.vim
  Error detected while processing /home/martin/.config/nvim/init.vim:
  line   44:
  E474: Invalid argument: completeopt=menuone,popuphidden,noselect
  line   50:
  E518: Unknown option: completepopup=highlight:Pmenu,border:off
  E824: Incompatible undo file: /home/martin/.cache/vim/undo/%home%martin%.config%nvim%init.vim
Or when opening a Go file:

  $ nvim a.go
  Error detected while processing function edc#init[34]..<SNR>66_apply[40]..<SNR>66_save:
  line    8:
  E121: Undefined variable: v:none
  E116: Invalid arguments for function get
  E15: Invalid expression: get(b:edc_save, a:setting, v:none) isnot v:none
  Error detected while processing function edc#init[34]..<SNR>66_apply[32]..<SNR>66_save:
  line    8:
  E121: Undefined variable: v:none
  E116: Invalid arguments for function get
  E15: Invalid expression: get(b:edc_save, a:setting, v:none) isnot v:none
  Error detected while processing function edc#init[34]..<SNR>66_apply[2]..<SNR>66_save:
  line    8:
  E121: Undefined variable: v:none
  E116: Invalid arguments for function get
  E15: Invalid expression: get(b:edc_save, a:setting, v:none) isnot v:none
  Error detected while processing function edc#init[34]..<SNR>66_apply[14]..<SNR>66_save:
  line    8:
  E121: Undefined variable: v:none
  E116: Invalid arguments for function get
  E15: Invalid expression: get(b:edc_save, a:setting, v:none) isnot v:none
  Error detected while processing function gopher#go#set_build_package[11]..gopher#go#module:
  line   12:
  E117: Unknown function: chdir
And they don't even always show properly on startup (just "press ENTER", need to use :messages).

There's loads of incompatibilities; some behaviour is different as well. I can't get it to stop clearing the terminal on exit for example; my 'nnoremap <Leader>p "*p' mapping just inserts '"', my Control+space mapping doesn't work for whatever reason, for some reason a lot of stuff looks different even though it has the same colour scheme, quite a number of my custom functions/commands/mappings error out for various reasons, etc. etc. And not all of these are very complex either: <C-Space> is a simple expression map: inoremap <expr> <C-@> pumvisible() ? "\<C-n>" : "\<C-x>\<C-u>" – Pressing <C-x><C-u> works, but this doesn't(?)

"You can bring over your vim config and it'll just work" might be true is you have a simple vimrc with a few basic ":set"s, but it breaks down very fast.

Re:Neovim v0.5 by humility on Saturday July 03, 2021 @09:00AM (#27721334)
I stand corrected. Is your experience based on nvim v0.5?
Re:Neovim v0.5 by arp242 on Saturday July 03, 2021 @09:34AM (#27721526)
Yeah, that's Neovim 0.5. But it's been like this for years: when I tried Neovim 0.2 (or something? I don't recall the exact version, years ago anyway) I also got many errors and incompatibilities.

At this point, I think it's probably better to see Neovim as its own editor rather than "an improved Vim". Obviously based on Vim and still with close ties (many Vim patches are still backported), but the "it's just like Vim but with async + true colours"-days are long gone, and the differences will only increase in the future.

Personally, I even stopped making my plugins compatible with Neovim. For example methods ('foo bar'->split(' ')) aren't supported, but were added to Vim close to two years ago (Aug 2019). It's not that the Neovim people are against it: just no one bothered to port it as they prefer to work on the Lua stuff. I find it very convenient so I use it, and Neovim users... well... Sorry :-(

Re:Neovim v0.5 by humility on Wednesday July 07, 2021 @09:54AM (#27761139)
Well, don't know how to respond.

As an inveterate vim user, I jumped to neovim in hopes of a leaner, meaner and faster editor with an easier configuration process ( i don't like vimscript as compared to emacs lisp). After 5 years, neovim has hit a lot of milestones and I see it going places, yet the only thing that still attracts me to it is the energy and enthusiasm of the community.

I still don't fancy learning an entirely new language to configure my editor, but that's the fun part! ymmv I guess.

Re:Neovim v0.5 by njharman on Friday July 02, 2021 @04:36PM (#27716551)
My vim config includes bunch of customization for bunch of plugins written in vimscript. Will that just work?
Re:Neovim v0.5 by kellyjprice on Friday July 02, 2021 @04:40PM (#27716601)
Probably. I have not had any problems switching between the two. It's meant to be a drop in replacement, but I'm not sure how perfect that is.
Re:Neovim v0.5 by arp242 on Saturday July 03, 2021 @03:30AM (#27719973)
Compatibility was a goal at the start, but now it seems to be on a "best effort" basis at best. It's very much non-perfect because opening anything in neovim with my Vim config gives me a forest of errors and loads of things don't work, including some pretty basic stuff like expression mappings. See my other comment in this thread as well.
Re:Neovim v0.5 by ufo on Friday July 02, 2021 @07:04PM (#27717943)
One small thing I prefer about neovim is that the default settings are better. For example, syntax highlighting is enabled.

https://neovim.io/doc/user/vim_diff.html#vim-differences

Re:Neovim v0.5 by akkartik on Friday July 02, 2021 @07:44PM (#27718171)
That's actually a negative for an existing user like me. Every time I upgraded to Neovim I ran into breakage with my configuration. Eventually I burned out and returned to Vim.

Neovim may well be taking the right approach. Capture by existing users has its own costs. But we should be clear-eyed about its intended audience.

Re:Neovim v0.5 by daliusd on Friday July 02, 2021 @02:56PM (#27715365)
One friend tried to switch from neovim to vim and found that vim is slower even if everything works. Otherwise no reason to switch.
Re:Neovim v0.5 by Snelius on Saturday July 03, 2021 @12:59AM (#27719467)
No, you should not. Original vim is unbeatable.
Re:Neovim v0.5 by gorjusborg on Friday July 02, 2021 @03:02PM (#27715439)
To me, there are two big things:

1. Development model (vim=Bram, neovim=communitiy of people) 2. Movement to a more accessible language for writing plugins

Re:Neovim v0.5 by arp242 on Saturday July 03, 2021 @03:35AM (#27719987)
It's true that "all patches go through Bram", but Vim has other maintainers as well and there's loads of people working on it. I had several patches merged with feedback from several non-Bram maintainers, with faster than average turnaround times I might add (i.e. several days or less before it ended up merged in Vim).
Re:Neovim v0.5 by pasabagi on Friday July 02, 2021 @03:54PM (#27716027)
Well, a lot of people have come up with good reasons, but for me, it really comes down to the old repairman's adage: there are two kinds of people, those that piss in lifts, and those that do not.

Now, pretty much any programmer can read a lua program, and it takes about an hour to learn, whereas I think the most flattering honest word anybody has ever used to describe vimcsript as is 'pathological'.

For the second kind of person, vimscript is like some combination between russian roulette and vogon poetry, bomb defusal and surreal nightmare. For the first kind of people - I don't know, there are probably some upsides, but honestly, who does that? Do you? That's what you have to ask yourself.

And more, if you're not that kind of person today, do you want to become that person?