News for hackers. Stuff that matters.
Re:Vim 8.0 released by thedz on Monday September 12, 2016 @09:07AM (#12479308)
Notable improvements:

- Async /Io

- Async Jobs

- "Packages", which allow easier built-in bundling of plugins

I'm pretty excited for this release! I've been using Neovim for several months now, but really great to see mainline Vim get these (IMO long overdue) enhancements.

Re:Vim 8.0 released by agumonkey on Monday September 12, 2016 @09:26AM (#12479450)
lambdas and closure .. and vim/neovim split .. almost Emacs ;)
Re:Vim 8.0 released by dleslie on Monday September 12, 2016 @01:19PM (#12481607)
Soon NeoVim will no longer update regularly because Vim has caught up and/or surpassed it with every feature that matters...

By that time Emacs will have replaced temacs with Guile and someone clever will have added VimScript as a hosted language.

Re:Vim 8.0 released by mden on Monday September 12, 2016 @01:43PM (#12481853)
It's close, but I think NeoVim's RPC model could be huge. Writing a new frontend for vim no longer seems that crazy of a goal which makes it easier for people to experiment with new editor ideas while relying on the very solid core of vim (well at least I find that exciting, idk if the general vimmer cares).
Re:Vim 8.0 released by wodenokoto on Monday September 12, 2016 @02:28PM (#12482322)
I dream of the day that when you tick off "vim binding" in the settings of any IDE it loads neovim for controlling the buffer.
Re:Vim 8.0 released by yazaddaruvala on Monday September 12, 2016 @04:45PM (#12483485)
Or rather, a day where its easier, more flexible, and more performant for IDEs to always(only) use an embedded neovim. Getting plugin support "for free".

The keybindings would then be the only thing that the IDE changes.

Re:Vim 8.0 released by flukus on Tuesday September 13, 2016 @12:32AM (#12485641)
I dream of the day when the IDE is in vim. There has been some great work around c# for this lately, where the compiler is running as a service and vim makes an async call for file completion, etc.
Re:Vim 8.0 released by super_mario on Tuesday September 13, 2016 @09:40AM (#12488091)
Why stop at the IDE? Why not tick a checkbox in system preferences and it lets you use vim to edit anywhere you can type text.

Now I would pay for that feature decent sum of money :D.

Re:Vim 8.0 released by LarryClapp on Friday September 16, 2016 @03:43PM (#12516726)
Are you familiar with Wasavi? Vi(m?) for browser text windows, at least.

http://appsweets.net/wasavi/

Re:Vim 8.0 released by romgrk on Tuesday September 13, 2016 @08:51PM (#12493492)
Re:Vim 8.0 released by agumonkey on Monday September 12, 2016 @01:21PM (#12481633)
The neovim project is still a massive undertaking about refactoring such old and non trivial piece of code in what appears to be a smooth way. I hope they can keep working on it, in symbiosis with vim.
Re:Vim 8.0 released by JoshTriplett on Monday September 12, 2016 @01:33PM (#12481762)
I'd love to see vim add an embedded terminal emulator in a window based on the async support. That feature alone motivated me to try neovim.
Re:Vim 8.0 released by allendoerfer on Monday September 12, 2016 @10:56PM (#12485339)
That is tmux's job. Do one thing well.
Re:Vim 8.0 released by deathanatos on Tuesday September 13, 2016 @12:26AM (#12485629)
I use ConqueTerm, inside vim, a plugin that supplies a terminal inside Vim. If you put the emulator inside the editor, you can take advantage of vim's extremely capable text manipulation. If I tmux then vim, I have to find some way to get the text out of tmux, and then back into vim.

Also, who says vim is running in a terminal?

Re:Vim 8.0 released by allendoerfer on Tuesday September 13, 2016 @01:19AM (#12485789)
Living inside the terminal, multiplexing is useful even when not using Vim and I think Tmux is a better multiplexer than Vim. I would need to use Tmux anyway for it's sessions.

I already use Tmux inside a tiling window manager and generally try to avoid manually managing panes inside Vim, mostly only tabs. There is a finite amount of hierarchical panes and tabs you can work with intuitively, before you wonder why they won't accept each others keyboard shortcuts, especially when you use the same color scheme in Vim, Tmux and Awesome.

> If I tmux then vim, I have to find some way to get the text out of tmux, and then back into vim.

That's actually a valid concern. I use piping for that, but it's not ideal at all. Maybe I will try it out.

Re:Vim 8.0 released by JoshTriplett on Tuesday September 13, 2016 @02:34AM (#12486023)
> There is a finite amount of hierarchical panes and tabs you can work with intuitively, before you wonder why they won't accept each others keyboard shortcuts

Exactly the reason I want to manage terminals in vim. I already heavily use splitting in vim, and find it much faster and simpler to use than screen or tmux. In addition, I typically want integration between those splits, such as displaying the quickfix list in one, or showing 2-3 files in vimdiff, or yanking and pasting between files. Given that, I'd like to just open one more split in vim and have a terminal in it.

The original motivating use case for me: a vertical split, editing a manpage on one side, and showing a continuously updated render of the manpage on the other (using watch).

Re:Vim 8.0 released by deathanatos on Tuesday September 13, 2016 @04:48PM (#12492086)
I was playing devils advocate a bit in the last post ;-) My workflow involves a mix of the two methods. If I know I'm going to be doing text manipulation, I'll use vim+ConqueTerm, but more normally I just let iTerm2's splitting handle it. (I actually prefer it over tmux/screen, but when you need multiple things on a remote, I can see why people prefer it.)
Re:Vim 8.0 released by joemi on Monday September 12, 2016 @06:13PM (#12484116)
That feels like the realm of a plugin, IMO. (I don't know enough to know whether or not that type of thing could be done via plugin, though.)
Re:Vim 8.0 released by flukus on Monday September 12, 2016 @07:49PM (#12484653)
With the new async support it should be relatively simple, weekend project simple for a basic implementation.
Re:Vim 8.0 released by JoshTriplett on Tuesday September 13, 2016 @02:29AM (#12486009)
Depends on how you implement it. neovim's implementation uses libvterm, which seems preferable to a from-scratch terminal implementation. Implementing a fully capable terminal emulator from scratch definitely isn't a weekend project.

neovim's approach links libvterm in via C. You could potentially do so via python and ctypes instead, but then you have to count on having a vim compiled with Python support.

Re:Vim 8.0 released by flukus on Tuesday September 13, 2016 @03:29AM (#12486207)
I was thinking I'd just start sh/cmd in a process and use stdin/stdout. The api even allows for automatically sending appended lines to stdin.
Re:Vim 8.0 released by vegabook on Monday September 12, 2016 @09:21AM (#12479406)
this async thing was Neovim's main selling point, right? I mean cruft-removal is all well and good but vim works fast and fine for me so not important. What does Neovim now offer that this doesn't?
Re:Vim 8.0 released by tux1968 on Monday September 12, 2016 @09:32AM (#12479481)
Vim was in a virtual lock down of maintenance mode before Neovim came along and offered some competition. I'm happy to see Vim woken up out of its slumber, but let us not dismiss what Neovim offers or has already accomplished.
Re:Vim 8.0 released by flukus on Monday September 12, 2016 @07:51PM (#12484674)
The release history: https://en.wikipedia.org/wiki/Vim_(text_editor) doesn't looks pretty active to me.
Re:Vim 8.0 released by flukus on Monday September 12, 2016 @11:41PM (#12485488)
Edit - I mean does look pretty active.
Re:Vim 8.0 released by jpambrun on Monday September 12, 2016 @09:27AM (#12479455)
I think neovim just offered us VIM 8.0.
Re:Vim 8.0 released by baldfat on Monday September 12, 2016 @11:46AM (#12480687)
To be fair VIM developers have said they were all in the mix and coming. We even had Vim plug ins that pulled this off. So I really am not surprised.
Re:Vim 8.0 released by dominotw on Monday September 12, 2016 @09:27AM (#12479456)
'transform Vim into an embeddable text editor engine'

I think that was the main objective of the project. Would be nice to real vim in IntelliJ idea.

Re:Vim 8.0 released by stephenboyd on Monday September 12, 2016 @01:07PM (#12481492)
As a naive IntelliJ user, I found myself editing files with Vim in IntelliJ's terminal console.
Re:Vim 8.0 released by weitzj on Tuesday September 13, 2016 @03:03AM (#12486124)
I was amazed when I discovered the console and everything works. I can launch vim, neovim and tig(nurses git front-end) from within IntelliJ and all shortcuts just work. Even fish shell in vi mode or tmux. So yeah, I have the shell running in IntelliJ with tmux enabled and launch tig inside of it.
Re:Vim 8.0 released by dominotw on Tuesday September 13, 2016 @06:09PM (#12492680)
whoa! had no idea this was thing .
Re:Vim 8.0 released by micku on Monday September 12, 2016 @09:33AM (#12479501)
This. And the scripting language I suppose?
Re:Vim 8.0 released by thomasahle on Monday September 12, 2016 @09:41AM (#12479577)
Neovim is still a lot faster for me. A simple example is always commenting out a block <C-v>10jI#, which takes 5 seconds or so in vim (including 8.0), but is instant in neovim.
Re:Vim 8.0 released by 6502nerdface on Monday September 12, 2016 @10:02AM (#12479712)
The input sequence would be <C-v>10jI#<ESC> (I've just added escape at the end).

I'm guessing the delay you are referring to is the delay imposed by your terminal emulator (not vim) to detect the Escape key at the end that terminates visual block mode. If I'm right, you can quickly press "j" just after you press ESC, which should cancel the ESC-detection delay and cause your comment characters to appear instantly.

Edit: there's actually a few things that could be at play, including your terminal emulator, your screen/tmux (which is like another terminal editor, really), and vim's timeoutlen and ttimeoutlen settings.

Re:Vim 8.0 released by randlet on Monday September 12, 2016 @12:26PM (#12481064)
This is interesting! For me using <ESC> does indeed take a few seconds to complete commenting out the block. However, I have jk mapped to <ESC> and the commenting happens instantly using jk which makes sense in the context of your explanation.
Re:Vim 8.0 released by hsitz on Monday September 12, 2016 @01:06PM (#12481488)
It is interesting, I just tried pressing 'j' immediately after <esc> and the block prefixing does happen right when I press 'j'. The usual lag is just a second or two for me, though, using Gnome Terminal on Ubuntu. Also, there is no lag at all for me in gvim, even without pressing <esc>j.
Re:Vim 8.0 released by philh on Monday September 12, 2016 @11:26AM (#12480501)
I wouldn't expect the terminal emulator or screen/tmux to cause a 5s delay in this situation; and if they did, I'd expect them to cause it in neovim as well as in vim.
Re:Vim 8.0 released by cyphar on Monday September 12, 2016 @06:41PM (#12484269)
This does happen with neovim too. In fact, I had this issue in neovim even though I hadn't had it in vim. It was a one-line config change in my tmux.conf to fix it though, so no skin off my nose.
Re:Vim 8.0 released by ramblenode on Monday September 12, 2016 @04:45PM (#12483486)
You can also add this to your .vimrc:

  set noesckeys
Re:Vim 8.0 released by thomasahle on Monday September 12, 2016 @06:45PM (#12484292)
This worked! Sweet! Maybe neovim just has this as default..
Re:Vim 8.0 released by rakhimov on Monday September 12, 2016 @11:06AM (#12480302)
I'd recommend https://github.com/tpope/vim-commentary for commenting out code. Anyway, it's not a good practice.
Re:Vim 8.0 released by hackmiester on Monday September 12, 2016 @11:30AM (#12480553)
What would you recommend for turning off a section of code temporarily?
Re:Vim 8.0 released by OMGWTF on Monday September 12, 2016 @11:46AM (#12480685)
For C:

    #if 0
    ...code...
    #endif
Re:Vim 8.0 released by jaymon on Tuesday September 13, 2016 @04:41PM (#12492032)
You could try a plugin I wrote to quickly comment/uncomment blocks of code:

https://github.com/Jaymon/vim-commentify

It's a no frills plugin that only does one thing, but it does it pretty well.

Re:Vim 8.0 released by RBerenguel on Monday September 12, 2016 @11:37AM (#12480610)
Kill region, save, run/compile/read, undo if needed. With undo tree (or if you add commit to the process above) there is no need to comment just one region to turn off something.

Optionally, convert the region into a separate function/method and just don't call it while checking.

Re:Vim 8.0 released by pablasso on Monday September 12, 2016 @01:41PM (#12481835)
You still didn't explained why it wasn't a good practice. This just sounds impractical.
Re:Vim 8.0 released by RBerenguel on Monday September 12, 2016 @04:43PM (#12483471)
Commented code (as in, working code commented out, not comments in code) eventually rots/becomes cruft that at some point in time is going to bite you (or someone else in your team, or some maintainer in the future)
Re:Vim 8.0 released by ssalazar on Monday September 12, 2016 @02:29PM (#12482332)
Yeah, "not a good practice" (i.e. "the user is wrong" or "why would you want to do that?") is the lazy way of justifying software deficiencies.
Re:Vim 8.0 released by RBerenguel on Monday September 12, 2016 @04:45PM (#12483492)
I use emacs, so deficiencies on how vim handles anything do not mean much to me, actually.
Re:Vim 8.0 released by cschmidt on Monday September 12, 2016 @09:49AM (#12479636)
I believe it has a complete embedded terminal
Re:Vim 8.0 released by placeybordeaux on Monday September 12, 2016 @11:33AM (#12480585)
I've actually started using neovim as a default terminal paired with my standard shell. I personally never got that used to the commands for tmux or screen, and with neovim I get the exact commands I am expected as well as -send line to REPL- with https://github.com/kassio/neoterm
Re:Vim 8.0 released by zem on Monday September 12, 2016 @03:12PM (#12482737)
having lua as the native scripting language is pretty big too
Re:Vim 8.0 released by vegabook on Monday September 12, 2016 @03:39PM (#12482970)
Lula would be proud ;-)
Re:Vim 8.0 released by desireco42 on Monday September 12, 2016 @09:19AM (#12479387)
How is Neovim working out for you? I remember using it at one point and it was really smooth experience.
Re:Vim 8.0 released by micku on Monday September 12, 2016 @09:39AM (#12479558)
I'm using it every day for a couple of months now, never crashed and loads faster than Vim 7.

Anyway, the things I appreciate more are the fast evolution and the community, no more than one year ago I tried it but was too lazy to compile, wait, configure...

This time I ran homebrew, linked my .vimrc in ~/.config/nvim/init.vim, and forgot I was using Neovim instead of Vim, except for the async compiling/linting.

Re:Vim 8.0 released by fatbird on Monday September 12, 2016 @06:47PM (#12484301)
I switched more than a year ago and have never had stability problems; it's been only performance and feature enhancements for me. The most obvious was that saving my files no longer locked up the interface for a couple seconds while linters ran (thank you async). More subtly, I had to go on a plugin diet initially that slimmed my features down to what I actually used regularly; since then, I judge the quality of plugins to be improved because they're either new plugins by authors excited to code for neovim, or they're current plugins that got a decent overhaul to work with both.

From what I understand, the plugin community is generally pretty happy with neovim and find it preferable.

Re:Vim 8.0 released by shazow on Monday September 12, 2016 @11:13AM (#12480375)
Not the parent but FWIW I've been using neovim for +6 months now and it's fantastic. I'm super impressed at the pace of progress and responsiveness of the team.

I've since switched all my plugins to use async versions and it's sooo fast, didn't think vim could be faster but here we are.

Re:Vim 8.0 released by colordrops on Monday September 12, 2016 @01:04PM (#12481471)
Could you mention which plugins you switched to? Is there a list somewhere that details the alternatives that work better in neovim?
Re:Vim 8.0 released by shazow on Monday September 12, 2016 @01:49PM (#12481915)
Off the top of my head:

- vim-plug for a plugin manager (very good regardless of concurrency)

- neomake for building

- vim-go added async job support using neovim a while ago for most of its functionality, which I use for writing Go

My full inventory is here: https://github.com/shazow/dotfiles/blob/master/.vim/plugins....

Re:Vim 8.0 released by kzrdude on Monday September 12, 2016 @03:06PM (#12482677)
Do most vim plugins work without changes in neovim? I'm mostly using vim-airline and tagbar to be honest, wouldn't be sad if the other ones stopped working.
Re:Vim 8.0 released by hsitz on Monday September 12, 2016 @03:50PM (#12483054)
VimScript is not deprecated in NeoVim, and maintaining backward compatibility is major focus. So must Vim plugins will work in Neovim. vim-airline is listed among the plugins that has some special neovim-specific features added: https://github.com/neovim/neovim/wiki/Related-projects
Re:Vim 8.0 released by kzrdude on Tuesday September 13, 2016 @05:31PM (#12492442)
Cool, thanks.
Re:Vim 8.0 released by cyphar on Monday September 12, 2016 @06:44PM (#12484283)
I've been using neovim for almost a year now, and have contributed some (small) code fixes and also donate to the project. It works great for me, and I completely forget that I'm using neovim (until I use :terminal). Also, from what I hear, contributing to Vim is much harder than NeoVim so I'm more inclined to contribute to a project which has a healthy community of contributors.
Re:Vim 8.0 released by nobleach on Monday September 12, 2016 @09:56AM (#12479675)
I am stuck at 0.1.3 as I am unable to brew install any of the newer versions. (It craps out on some LuaJIT stuff and I haven't really had time to fight with it) Aside from having to mess with it to get CTRL-h working, it's been pretty smooth. I LOVED vimplug (the package manager) with its async installs. I have high hopes for NeoVim's future... even if that future turns out to be just giving Vim a kick in the pants to move forward.
Re:Vim 8.0 released by Spiritus on Monday September 12, 2016 @10:22AM (#12479881)
Try cleaning your Homebrew cache for neovim.

    rm -rf /Library/Caches/Homebrew/neovim--git
    brew reinstall --HEAD neovim
Re:Vim 8.0 released by nobleach on Monday September 12, 2016 @11:09AM (#12480327)
nope, sadly:

    ==> make VERBOSE=1
    Last 15 lines from /Users/jimwharton/Library/Logs/Homebrew/neovim/02.make:
  "__Unwind_GetCFA", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_RaiseException", referenced from:
      _lj_err_throw in libluajit.a(lj_err.o)
  "__Unwind_SetGR", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_SetIP", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[4]: *** [luajit] Error 1
    make[3]: *** [src/luajit] Error 2
    make[2]: *** [build/src/luajit-stamp/luajit-install] Error 2
    make[1]: *** [CMakeFiles/luajit.dir/all] Error 2
    make: *** [all] Error 2
I know I just need to jump into figuring out how to get the ONE version of LuaJIT that works (as I've read, there is only one) and pop that in there.
Re:Vim 8.0 released by m0shen on Monday September 12, 2016 @02:21PM (#12482253)
Try:

    unset LUA_CPATH LUA_PATH
    brew reinstall --HEAD neovim
Re:Vim 8.0 released by thedz on Monday September 12, 2016 @10:58AM (#12480222)
Really great! It was honestly a relatively painless transition for me.