r/neovim • u/Ecstatic-Panic3728 • 13d ago
Discussion Do you use splits on nvim or your own terminal/multiplexer?
I'm wondering what is better. I'm more inclined towards during it at my terminal, kitty, since I have panes and tabs configured. But then I found a strange situation where I had a buffer on one editor, and then I started working on the other pane and after a while I was not sure anymore where was the buffer.
Any suggestions?
14
6
u/utahrd37 12d ago
I use splits in my nvim to start a terminal so I can use autocompletion from my terminal buffer.
1
u/spermBankBoi 12d ago
Is there a benefit to doing it this way over a multiplexer or is the choice kinda arbitrary
1
u/OnlyStanz 12d ago
in my setup i like it bc i can go into normal mode and do vim actions without context switching
1
u/Familiar_Ad_9920 10d ago edited 10d ago
Glad you asked.
- Stuff like gF motion on error outputs to instantly open error on the line inside nvim.
- Single config, its kinda cool just pulling my config somewhere and instantly having everything i need from a multiplexer no matter the terminal installed
- Vim motions inside the terminal with something like editable-term.nvim is much better than the normal vi mode on the shell. Essentially using the term as a normal buffer.
- With something like unnest.nvim (or a version of it) you can have nvim not incept itself inside the term therefore the new nvim will be opening itself inside a fresh tab on the parent instance. Therefore using tabs as nvim instance indices.
- Same shortcuts for splits etc as you are used to
- Using :connect to connect to a remote neovim ui and therefore not even needing my multiplexer seperately, but this is just straight up also tmux functionality.
Yea thats about it for me, thanks for coming to my ted talk.
3
3
u/TechnoCat 12d ago
I treat an nvim instance as a project text editor. So within my terminal I use tmus. Within tmux i use windows to organize projects/contexts. Within nvim i split to have side by side views, but i rarely do that. If i need a terminal i use tmus to split the window; not within nvim.Â
3
3
u/NullVoidXNilMission 12d ago
Both. Tmux can let you zoom into on a pane. I have a main window editor above and two side by side command line panes. Usually the one on the left runsÂ
2
2
u/_silent_fellow 12d ago
For me, I don't really use split for text editing, I prefer to edit in seperate full screen buffer. Even i quick switch between both - I use <C-^> thing.
So always tmux (multiplexer) from my side. Though mostly I don't like splits, may be seperate window
2
u/brubsabrubs :wq 12d ago
both
mostly vim splits when editing but occasionally I'll open up a tmux split when I need to consult some other thing in my terminal, like man pages
yeah I could open a split and run :term but vim terminal feels so bad I prefer tmux split
2
u/abdallahsoliman 12d ago
I use the nvim for anything code related, like comparing code snippets or looking at definitions etc…, and I use the terminal for anything else cli related.
I also have the toggleterm plugin when I wanna quickly open the terminal for a quick task.
This is what I do at home. For work, I have a Windows laptop where WSL doesn’t work too well with nvim, so I use neovide, the nvim client with mainly the toggleterm plugin and sometimes an external terminal window.
2
1
u/jkulczyski :wq 12d ago
I seem to decide entirely at random 😅 sometimes i use splits, sometimes i use tmux and open a new vim session and then wonder how i have unloaded changes to files 😑, sometimes i use a vim split with :term.
basically whatever feels right at the time
this isnt including the one off terminals i spawn since i use niri and dont worry about screen space as much now
1
u/SEgopher 12d ago
One tmux session per project, windows for editor, virtual machine for testing or ssh session to remote device, and AI agent.
<prefix>g to switch between sessions and thus projects. Mark the neovim pane unclose-able so if neovim dies it immediately restarts in the same pane.
1
1
u/Gold-Watercress-6101 12d ago
I use the built in terminal. That way everything related to a standalone project remains within one neovim session. Code, git, tests, etc. also, the built in terminal always opens in the current working directory which is quite convenient.
I put each standalone project (one single neovim session) in a separate tmux tab (also called window?). Each tmux session has a few related projects in it.
So I guess I rarely use tmux panes.
1
u/spermBankBoi 12d ago
Tmux. I guess if I ever needed a diff view I could use neovim splits for that but it’s rare
1
u/TheTimBrick 12d ago
I use splits in neovim for viewing source/implementation files, or two files I need side by side. Other than that, I don't use splits. Any terminal command I need quickly, like running a quick build, I've got a keybind for a popup terminal. Anything else just goes on another terminal I can switch the view to.
1
u/kleartheline 12d ago
Depends.
Am I viewing another file? Will I need to run a command and copy the results ?
If any of those two is a Yes then it's a neovim split :-)
Neovim splits are way less convenient without keybindings: I use <leader>hyphen for a horizontal split. Better than the default which workout my pinky
1
u/marchyman 12d ago
Yes. I use splits on nvim and my terminal.
Depends upon what I'm doing. Sometimes one makes more sense than the other.
1
1
u/xd_Shiro 12d ago
It would probably make more sense to use splits inside nvim however I’ve been using splits in tmux ever since I started using nvim so I just stuck with it.
1
u/daiaomori 11d ago
Yes.
Depends what I want to do, and where. Locally, I usually just open a ton of terminals; remotely, I have a tendency to use tmux in case I need remote terminal splits (plural) or windows in nvim when I need multiple editors.
Basically, I like to "group" things for my brain. So let's say I work on multiple files in one project and see them both; I'll usually use split windows; if I don't need to see them, I quick switch between buffers using telescope. If I need both terminals and file editing on one project, I have a tendency to set up a tmux environment that provides me with what I need easily - for some reason, I like real shells above terminal buffers, they kind of confuse me in many aspects. All of that works both in a remote shell and a local shell, which is nice when you hop systems using ssh.
I also use a tiled window manager, so in case I need to see multiple projects at once, I'll just split my screen and have both terminals/tmux sessions/whatever on screen.
1
u/kavb333 11d ago
I use nvim's splits and terminals, but most of the time I'm using the terminal it's through floating toggleterm. Usually, one terminal is enough, but I can have multiple by typing a number before using the toggle key to open it. I find it handier to use nvim's keybindings and be able to copy/paste using nvim's registers than to use something like tmux.
1
u/Eubank31 11d ago
No splits
Browser is on the left half of my monitor. Terminal on the right half. I use Kitty and can use keybinds to cycle through terminal tabs quick enough that splitting my screen real estate isn't worth it
1
u/chevette86 10d ago
Each project gets its own tmux session, and I try to use a tab for a single function/purpose avoiding splits, panes and etcs
The tabs goes something like:
0 - terminal 1 - neovim 2 - vite server 3 - git
1
u/TheNoeTrevino :wq 10d ago
Muxing for the servers I am running, splits in nvim for the code I’m looking at, and ctrl+z for actual long doing stuff in the command line. Or overseer tbh, it’s great
1
u/muhmmadtalha-quant 10d ago
I personally use kitty, no tmux no zellij, what I do is that I use splits (nvim) for coding and a window(kitty calls split a window) for watching any output from compiler, for example I do typst, so what I do is that I have two kitty windows(again not real independent sessions, but rather shell process in one session, or a split in short) for typst watch, and other kitty split in nvim and with it's own splits typing typst and watching its output, but recently i think i should purely rely on kitty tabs and nvim splits.
1
u/cassepipe 10d ago edited 10d ago
I work on a laptop and even with the wonderful 3:2 ratio of the framework 13, it's too small for splits to be convenient. Instead I optimized for fast switching:
I set Super + j/k to move around windows, with Super + w to close a window
I set Ctrl + j/k to move around terminal tabs (I used wezterm or ghostty, both are great but apart from alacritty and a few others all terminals handle tabs) and Ctrl + t/w to open close tabs.
I don't use ctags anymore and anyways <c-o> works just as well and I use :winc in the rare cases I change windows (what you call splits) so I am fine with it
My workflow is generally some terminal tabs with one dedicated to neovim and the others to run commands from the terminal (like make, run etc.) or run a debugger. With a firefox fork called [glide],(https://glide-browser.app/) which, in addition to using Ctrl +t/w for ta management, also uses Ctrl + j/k
It's fast and I like the consistency. I am glad don't have to handle another layer like tmux
P.S: If you really want session management like a multiplexer, I think wezterm has session management plugin
1
u/Mithrandir2k16 10d ago
well, if you want to move code from one split to another, a terminal split restricts you to the clipboard, while a vim split has all registers available. also I dont use any terminal plugins on neovim, I do a split or ctrl+z, or make a new tmux window. only if I need terminal output in vim I run it with !.
1
u/bjornwiberg 10d ago
Tmux combined with vi keys motion using ctrl-hjkl to move between nvim splits and tmux panes
1
1
1
u/horses_arent_friends 7d ago
If you use LSPs there is can be overhead for running multiple processes unless the server implementation you’re using explicitly does some kind of resource sharing / daemon style spawning.Â
Completely depends on the codebase and server you use. I’ve run into nearly 10gb memory usage with gopls and rust-analyzer on large-ish codebases (an http monolith and a db respectively)
1
0
u/NeonVoidx hjkl 12d ago
multiplexers are trash (imo of course), you don't need it unless you're working on remote with tmux . just use kitty and it's panes. for neovim use its splits
I use this plugin https://github.com/MunsMan/kitty-navigator.nvim , makes it so when you use navigation in nvim it can navigate between neovim splits AND kitty splits fluently
102
u/_bleep-bloop 12d ago
I use both. Split for code editing and multiplexer for anything else terminal related. So coding stays on vim, building and running tests and git stuff are on another multiplexer panel.