Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you consider yourself a neovim terminal power user?

I tried a while back to invert my workflow (from tmux driving neovim to neovim driving terminals) because I thought it might be easier to only ever have one buffer open for a given file, instead of attempting to open a file in a given pane only to realize that it's already open in a different neovim instance in a different pane.

When I was testing that stuff out I don't think I noticed particular issues with text reflow that would benefit from being solved by swapping to libghostty, rather my pain points were just about how to adjust to the different paradigm. I'd be curious to hear more about someone who is all in on Neovim embedded terminals (and possibly how libghostty might make it better).



I'm all in on Neovim terminals, having a remote development setup means it keeps my terminal with my neovim window (I use nvim-qt).

Also not sure how ghostty would help, haven't noticed text reflowing issues.

It's not bad, a little awkward getting used to:

- you might want a plugin to give you a "persistent" terminal across all tabs

- I still haven't found a way to clear scroll back while a command is running

- I had to set up mappings for easier exiting terminal mode (c-\ c-n really sucks)

- I had to set up events so whenever a terminal buffer is focused it immediately enters insert mode. While I love vim, I've never wanted modal editing in a terminal


I do indeed live in the terminal (all day due to work), but tmux adds too much value for me to do all terminal management in Neovim (tmux session-management being what I use most). I've just encountered too many visual "glitches" in the Neovim terminal to rely on it for everything. That's not to say, however, that I never use the built-in Neovim :terminal.

> I thought it might be easier to only ever have one buffer open for a given file, instead of attempting to open a file in a given pane only to realize that it's already open in a different neovim instance

This is not a problem in my config:

    vim.api.nvim_create_autocmd({ 'FocusGained', 'BufEnter', 'CursorHold' }, {
      pattern = '\*',
      command = 'silent! checktime',
    })
Since `'autoread'` is by default `on` in Neovim, this seamlessly reloads the buffer if the underlying file has been updated on disk.


I'd be curious to hear more about how tmux helps you — I tried it and besides keeping a permanent session open on a remote server to me I didn't find much use for it compared to regular terminal tabs


I use it daily locally, and find it amusing how many only think of it as being useful on remote servers (not to invalidate your use-case -- I'm just contrasting my own use). As a precursor, I view UNIX as my IDE, of which tmux is a part: this IDE runs on Windows (WSL2), macOS, Linux, and Android (Termux). That aside, here are a few reasons I find tmux to be useful in this concoction of tools:

- Session management. I've written custom scripts for myself around this (zoxide + fzf). If you want to see how this can be used, look at ThePrimagen's workflow. I don't use his scripts but he has a good demo of how he harnesses sessions.

- Unified scrollback management - easily search the scrollback, yank it, etc. My favorite thing to do is to yank part of the scrollback, then `Prefix+B,=` to list everything I've yanked (think of this like a "clipboard manager" specific to tmux), select an entry, and press `e` to edit it in `$EDITOR`.

- This one might be a stretch, but I tend to try and use only terminal tools (without being utterly insane) because then tmux can be my "tiling window manager" no matter what OS I'm on. Oh, I have to use Windows for work? Not to worry, tmux runs in WSL2, as do most of my preferred tools, so I feel mostly at home even though I normally really dislike Windows.

- It's scriptable. Read `man tmux` and use your imagination!

Notwithstanding any of that, there are cons, the most apparent one being that I am limited to text-based tools this way. An example of this: getting images to work in tmux, though many modern terminal emulators support them, is a huge pane, so I haven't bothered.


For the curious (like me), here’s more info on bullet 1 (session management):

https://www.reddit.com/r/tmux/comments/1ch9tqp/primeagen_tmu...


That's very helpful – thanks for taking the time.


I think my problem is when I realize that I had unsaved changes open in a different neovim instance. If the file was not dirty in any other open neovim instances then I don't have the same problem.




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

Search: