Hacker News new | ask | show | jobs
by freedomben 1536 days ago
I currently use tmux and vim all day every day, including as my dev environment (if I'm not in a browser). Are there any advantages to this?

My initial thought is that having vim inside a terminal session is a better organization model than having a terminal session inside of a vim pane, but maybe that's just because it's how I've worked for 20 years so it's what I'm used to.

I know that some vim users prefer to run commands from inside vim. Is that the type of people this project is aimed at?

4 comments

I use a setup like yours, with one nvim pane and many terminal panes. But I prefer to stay in vim land rather than typing directly into the terminal. So I edit my commands in nvim and use vim-slime to send them to the appropriate pane. I don't really have a need for tmux.nvim.
> Are there any advantages to this? Is that the type of people this project is aimed at? Short answer: No, quite the opposite as of its current state.

Long answer: Even though I'm also using (neo)vim inside a tmux, there are a few caveats that I need from tmux.

The main one is while tmux is pretty much available everywhere, it's doesn't support Windows. My work machine (as provided by the company) are running on Windows and a lack of terminal multiplexer which prevented me to have the unified development environment across multiple setups from my MacBook to my Raspberry PI Zero.

Also, with one binary, you would hit 2 birds with one stone. Given that you're not doing anything fancy beside basic terminal multiplexing.

I sometimes try to edit a file in neovim only to be warned that I have the same file open already (in some other tmux window or pane).

I imagine having tmux in vim instead of vim in tmux might resolve that issue for me. I'm curious to try this for that reason.

One disadvantage of the Tmux approach is that if you have multiple nvim windows open, you can't copy from one to another.
You can, has you have multiple ways of copying things. Yanking to the "+" register in n/vim would put the content into your primary clipboard that you can paste with tmux (or ctrl-v).
You can set wshada|rshada to occur on FocusLost|FocusGained.

https://neovim.io/doc/user/starting.html#shada-read-write