Hacker News new | past | comments | ask | show | jobs | submit login

I love Neovim. It's been my main editor for years now. The way it handles terminal sessions is so much better than vanilla Vim. Also LSP rocks.



Same here! It was the first project I helped funding, and been funding it for as long as they have allowed donations. The biggest feature for me is being able to use lua instead of vimscript for basically everything now. I never learned vimscript properly, and now I don't have to anymore either! Win-win.


What do you mean by "terminal sessions"? I use vim inside regular xterms or tmux. Am I using such terminal sessions already? What would be different in nvim?


Both vim and neovim have the ability to open a terminal in a window split. It's not my preferred workflow but some people really like it rather than tmux or ctel-z to drop onto a shell... the implementation of this feature in neovim is a lot nicer than the one in vim.

One thing i do use it for: In neovim there's options to open the terminal as a sort of overlay on top of the existing splits, they call it floating term. Its really nice for opening tools ( e.g. lazygit or a test runner) because find it a bit less disruptive than having to bounce in and out of the editor by other means.


It's really useful to be able to use visual mode on your terminal window, to copy things. That's something you don't get via ctrl-z or tmux.


Tmux has support visual mode (at least character and line), I use it all the times.

I don't remember if it's enabled by default, but I have this in my ~/.tmuxrc (where pbcopy is the excellent https://github.com/skaji/remote-pbcopy-iterm2/blob/master/pb...)

  # Enable vi mode
  setw -g mode-keys vi

  # Copy to host
  bind-key -T copy-mode-vi v send-keys -X begin-selection
  bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy"
  unbind -T copy-mode-vi Enter
  bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "pbcopy"
It mostly work as expected, ctrl+B ] enter copy mode, then you can use / and ? to search, v to enter character visual mode, V to enter line visual mode and y/enter to copy the selection.


Why wouldn't you set the makeprg and have it populate the quickfix list instead?


Because lazygit doesn't really work that way?

Because running tests doesn't necessarily play nice with quickfix?

I do set the make program to build and get errors via the quickfix when there isn't a good lsp server for the language. When there is an lsp server for the language, why bother with a special make command? - the same info is just populated inline for you.


What do you mean by "play nice"?

I tend to use quickfix lists because I can edit/filter/persist them; so for example I'll have some tests/warnings but won't care about them for the moment but then rerun the command and get the diff and navigate to that.

It's fairly complicated to script the same using the LSP api.


It might not be what they want to do.


I mean the buffer with a shell that opens when you type:

    :term
I remember vanilla vim doing some weird stuff, like leaving the buffer open even though I've exited the shell, requiring me to close it manually. I don't know if it's been fixed since.


Better than :term in Vim 8? How so?


Copying from the other comment:

I remember vanilla vim doing some weird stuff, like leaving the buffer open even though I've exited the shell, requiring me to close it manually. I don't know if it's been fixed since.


There is an option to close the terminal buffer when the terminal process exits, e.g.,

`:term ++close <cmd>`


Another poor default option choice in Vim compared to NeoVim.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: