Do NOT Use Vim Pane Splitting (Use TMUX Instead) [20210422165907]

preview_player
Показать описание
Vim pane splitting limits you do using only Vim to manage your windows. That is not the Unix way. Multiplexers are designed for that specific purpose. Save yourself the hassle of learning Vim panes. You never need them, ever.
Рекомендации по теме
Комментарии
Автор

Not true. If you are working with multiple vim files, it is best to open them all in the same vim process. This gives the benefit of cross file completion, etc LSP features that is simply not possible if one were to open files in separate vim processes. And if someone has already opened multiple files in a vim process, there are times when they would want to visualize them side by side or on top of each other -- which they can if they use split in vim.

namesame
Автор

This is a bad advice, you end up loosing a lot of functionality and at the same time you have to resort to many hacks to have solutions for the problems you didn't even have.

Do what works for you, having a blanket statements like these just confuses people and serves no other purposes.

vinitkumar
Автор

It is pretty nice to split the view in vim to compare different part of your file. For me, it is a useful skill. To run a different program, yes, I would use a tmux pane or window. But splitting the window in vim is something I have found to be useful.

camilotorresf
Автор

Good advice for VI user. OK advice for VIM user. Bad advice for NeoVIM user.
You will lose ton of functionalities in NeoVIM.

It also depends on the type of work you are doing. Good advice for system admin. But a bad advice for a web developer.

BTW no idea how I can stop recommendations from this channel. I have tried them all. YouTube algo is crazy

ananthhh
Автор

Thank you for the video.
I tried it since many videos recommend it, but my experience is you cannot use VIM in pro mode developing code project if you split using tmux.
vim features that you lose
1. buffers
2. change history different per processes
3. yank registers
4. marks
and the worst. you always get this message if you open the same file from a different pane/window: the file is already opened

lajoskicsi
Автор

Respectfully, I really don’t by this argument. Using Vim’s internal screen management has lots of advantages like smooth integration with its internal functions that you don’t get if you use Tmax or screen for everything.

ChrisPatti
Автор

What about diffsplits? Besides, everything you did could be done with vim splits anyway. I use both.

heefbrz
Автор

I recently switched from IntelliJ to Neovim over a slow and long process of learning. Worth it. One thing that I still hem and haw over is vim vs tmux for splitting panes especially since neovim has a good terminal emulator build in but you may have convinced me.

ryanleemartin
Автор

You lose the ability to jump direct to a specific location in another pane

maninalift
Автор

What about the integrated terminal? You can have different splits and create a terminal to do whatever you need.

andresorrego
Автор

Thank you for sharing your opinion which I think is interesting but I believe might possibly be based on a lack of experience working with Vim's and Neovim's excellent split management capabilities: "Ctrl-w Ctrl_", and "Ctlr-w Ctrl |" for maximizing splits, "Ctrl-W =" to make all splits equal in size and ":q" to close a split. There are more commands but these are probably the most frequently ones used. Copying and pasting from one split to another is of course supported as is copying and pasting from the terminal though some terminal or shell configuration might be required for that. I'm not saying one method is better than the other but rather that Vim and Neovim have excellent split management built right in.

catwhisperer
Автор

When i do my editing i’d rather had a single state of all the registers because i need to shuffle various snippets of information between different documents, and it also would be great not to pollute the system clipboard with that.

How is this possible with tmux? Does tmux have its own clipboard with the ability to go through the history of states? What’s the point of using separate vim instances if i need to exchange data through a single stateless clipboard?

And all that cool story about being able to copy and paste without using mouse seems completely pointless to me. I mean, we paste with C-c C-v even without tmux. Who even uses mouse to paste?

damian_madmansnest
Автор

This is good if you're using tmux regularly but with a WM I think it's faster to just create a window for Neovim in full screen with splits and stuff and just spawn another terminal window for launching commands. Over SSH, however, this is the better choice

theblankuser
Автор

I used to do till I discovered vim splits. This is really bad advice.

And going through the comments, this guy is clearly has problems accepting other solutions and thinks his way is the best way just cause he's used to it.

Skill issues if you ask me...

Ohhimark
Автор

Personally, I like the ability to scroll-lock separate panes in Vim. I'm not sure how to replicate that with Tmux or Screen. (But being able to copy-paste, without a mouse, from different applications *is* a nice feature of Tmux / Screen.)

mmlvx
Автор

Hi Rob, I'm giving this idea a try as of recently.

I'm trying to slowly move back into Vim (which I know pretty well and have used on and off for 20 years) within a tmux (which I'm not very good with yet) workflow. Since my *current* workflow (past 2 years or so) is an Emacs one, I completely agree with your point - use the best tool for the job (tmux, in this case) for managing your panes. In my particular experience, Emacs has been *awful* for managing "panes" (they are called "windows" in Emacs) and tmux, for that purpose, has been far superior and more intuitive.

I also understand the complaints of many people here in the comment section, who seem to use Vim more like an IDE, and who then feel like they will simply lose a lot of functionality by embarking on the workflow you are proposing.

Maybe I'll come back to this video and post another comment once I have given this approach a try for a few months.

Thanks for the videos and for sharing your wisdom. I have literally been reflecting on and applying some of your ideas from this and other videos for more than a year now 😅

burntpopcorn
Автор

That's not a good idea today. But ideally should be

diegof
Автор

Copy/paste in tmux is a pain in the dick and DOES NOT work the way you or half a dozen other crappy websites claim.

Use !!xclip in one vim window, then !!xclip -o in the other.

Split panes are bullshit, for sure.

Tabs are far superior. eg.. :tab h

EDIT:...

So I've gotten mad about this on multiple occasions, just not mad enough.

This time I got mad enough to beat this things ass and figure out what the fuck.


export EDITOR="/usr/bin/vim"

weedeater