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

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.




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

Search: