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

  Рет қаралды 11,775

rwxrob

rwxrob

3 жыл бұрын

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.

Пікірлер: 45
@namesame
@namesame 3 жыл бұрын
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.
@cherryramatis2508
@cherryramatis2508 2 жыл бұрын
the lsp reason is quite valid, but you can visualize content by side with tmux, it's the whole purpose of it
@jamieg2427
@jamieg2427 Жыл бұрын
i just began using tmux a few days ago and already, it feels much better than vim's panes and tabs, though the disadvantages you mention are big ones. i believe they can be solved with tmux + vim plugins, which i'm going to look into soon. for example, i think there are some tmux/vim plugins that allow vim to autocomplete from text in a tmux split. why is tmux's organizational model better? it isn't necessarily---that depends on the person---but it is for me: vim: panes allow us to view multiple things (or the same thing in different places) at the same time. tmux: also has panes. vim: tabs allow us to group panes together. i have a tab for to do lists and related files. another tab for configuration (i'm learning tmux). another is for scripts, another is for advent of code, and so on. tmux: sessions are the same concept. but what if i'm working on a particular project in vim and i need to do a related task that requires a completely different arrangement of panes, files, and references? in vim, tabs also serve this propose. but in tmux, these would be windows. it feels much more organized. what i'd like, though, is to have a single vim session across all tmux windows. 🤔 but i'm looking at kakoune, which was designed for that approach. in vim/, i use panesto view relevant things in vim, i use tabs like tm sessions (separate workspaces), but tabs also (annoyingly) like tmux windows (alternate views of the same workspace).
@vinitkumar2923
@vinitkumar2923 2 жыл бұрын
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.
@cherryramatis2508
@cherryramatis2508 2 жыл бұрын
Besides LSP(a thing you shouldn't be relying on too much at the first place), what are the features you lost by using only tmux ?
@vinitkumar2923
@vinitkumar2923 2 жыл бұрын
@@cherryramatis2508 Why shouldn't I rely on LS? And Vim panes have nothing to do with LSP.
@cherryramatis2508
@cherryramatis2508 2 жыл бұрын
@@vinitkumar2923 lsp and completion create a lot of bloat into your vimrc (Not good to port through different containers and servers) Also, the whole point of using vim panes is to maintain the lsp server running and not lose context with this
@ryanleemartin7758
@ryanleemartin7758 2 жыл бұрын
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.
@jamieg2427
@jamieg2427 Жыл бұрын
did you ever try tmux?
@camilotorresf1
@camilotorresf1 10 ай бұрын
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.
@lajoskicsi6910
@lajoskicsi6910 3 жыл бұрын
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
@rwxrob
@rwxrob 3 жыл бұрын
Yeah, almost none of that is true and can easily be overcome.Marks perhaps but no pro dev I know uses them, searching is far more important. And opening the same file. Opening the same file and creating a view to another location in the same file is the most compelling, but also might be a sign you are putting too much code into a single file.
@namesame
@namesame 3 жыл бұрын
I agree with Lajos Kicsi, even while using LSP with vim the text completion suggestions can rely on other open buffers. @rwxrob does not seem to be a power user of vim.
@user-he4ef9br7z
@user-he4ef9br7z 2 жыл бұрын
What about diffsplits? Besides, everything you did could be done with vim splits anyway. I use both.
@ananthhh1
@ananthhh1 2 жыл бұрын
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. KZbin algo is crazy
@burntpopcorn7299
@burntpopcorn7299 Жыл бұрын
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 😅
@catwhisperer911
@catwhisperer911 7 ай бұрын
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.
@mmlvx
@mmlvx 2 жыл бұрын
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.)
@theblankuser
@theblankuser Жыл бұрын
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
@maninalift
@maninalift Жыл бұрын
You lose the ability to jump direct to a specific location in another pane
@andresorrego6778
@andresorrego6778 3 жыл бұрын
What about the integrated terminal? You can have different splits and create a terminal to do whatever you need.
@namesame
@namesame 3 жыл бұрын
Vim is single threaded application. Try running command >yes test in a vim terminal split, and editing a file in another vim split. Everything you do at that point will be slow in vim.
@damian_madmansnest
@damian_madmansnest 6 ай бұрын
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?
@Daknightfury
@Daknightfury Жыл бұрын
No
@softwareskills.jinqiang
@softwareskills.jinqiang 2 жыл бұрын
Good point, thank u
@rwxrob
@rwxrob 2 жыл бұрын
You're welcome
@user-xl3hu5st2b
@user-xl3hu5st2b 5 ай бұрын
boy you drunk
@diegof4083
@diegof4083 2 жыл бұрын
That's not a good idea today. But ideally should be
@ThisDaveAndThatJohn
@ThisDaveAndThatJohn 4 ай бұрын
yeah. For instance coc.nvim has completely ruined this. Every time you open a new instance of vim, the coc.nvim plugin will start the LSP (e.g java eclipse) and eat 5-7 GB of RAM, so you're forced to stay in one instance and open new files as buffers. Probably need to ditch to LSPs and go full manual mode like Jonathan Blow.
@WaldirBorbaJunior
@WaldirBorbaJunior 2 жыл бұрын
Amazing.
@ChrisPatti
@ChrisPatti Жыл бұрын
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.
@rwxrob
@rwxrob Жыл бұрын
The great thing is that you can continue to be inefficient and that is your choice. TMUX copy and paste buffer is also directly tied to the desktop buffer as well, vim doesn't do that.
@ChrisPatti
@ChrisPatti Жыл бұрын
@@rwxrob I don't know if your intent is to be disrespectful but I would posit that you can't know what my needs are, so you can't discern whether a particular choice of tool is efficient or not. I'm low vision and partially blind. I don't need paned windows everywhere. I have exactly one full screen window at all times. In fact, I would argue it's the exact opposite of what you say. Given that I will *always* have Neovim in one full screen window, I assert that tmux has exactly zero advantages for my workflow and to embrace it would be "inefficient".
@user-ns7zx7hi3p
@user-ns7zx7hi3p 7 ай бұрын
@@rwxrob what are you talking about? Any application in your desktop can copy and paste. And there is a bunch of other stuff that tmux does not handle that vim does (searching, completion, history, diffs...). And in case you cant google: - install gvim - set clipboard^=unnamedplus,unnamed
@damian_madmansnest
@damian_madmansnest 6 ай бұрын
@@rwxrob Yes but why exactly do you choose to be inefficient with tmux instead of having a single vim instance with all the benefits? Vim has * and + registers that are tied to the system clipboards if that’s what you call a ‘desktop buffer’, maybe you didn’t know that. But vim also has 26 other registers, and cross-file completion. What’s the point of ditching that? What exactly do i get in return?
@Ohhimark100
@Ohhimark100 2 ай бұрын
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...
@rwxrob
@rwxrob 2 ай бұрын
How do you cut and paste between different terminal window panes? Vim doesn't do it, period.
@rwxrob
@rwxrob 2 ай бұрын
And all anyone needs to know about you is your comment about "skill issues." I don't need to say anything else.
@Ohhimark100
@Ohhimark100 Ай бұрын
@@rwxrob Google it. I'm not the one running a YT channel anyways.
@jonathandavidbrink
@jonathandavidbrink Жыл бұрын
Horrible advice
@rwxrob
@rwxrob 11 ай бұрын
Why? How do you cut and paste using on the terminal from a Vim pane into a shell process in another window? Mouse?
@Yoolayn
@Yoolayn 6 ай бұрын
@@rwxrob the + and * registers exit????
@weedeater64
@weedeater64 Жыл бұрын
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"
How to Learn Vim Quickly and Correctly [20210422163108]
17:36
Smart tmux sessions with zoxide and fzf
14:55
Josh Medeski
Рет қаралды 52 М.
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 14 МЛН
Tom & Jerry !! 😂😂
00:59
Tibo InShape
Рет қаралды 67 МЛН
That's how money comes into our family
00:14
Mamasoboliha
Рет қаралды 8 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 9 МЛН
BSidesSF 2024 - The Secret Life of Secrets (Dylan Ayrey, Hon Kwok)
34:12
Security BSides San Francisco
Рет қаралды 8
Is Tmux DEAD? Zellij is the new multiplexer written in Rust
32:38
Mischa van den Burg
Рет қаралды 10 М.
Smart tmux sessions with sesh
9:27
Josh Medeski
Рет қаралды 5 М.
30 Vim commands you NEED TO KNOW (in just 10 minutes)
10:27
typecraft
Рет қаралды 70 М.
Hidden Tmux POWER: The Missing 50%
8:52
DevOps Toolbox
Рет қаралды 20 М.
Developer Productivity by ThePrimeagen | Preview
18:34
Frontend Masters
Рет қаралды 122 М.
Tmux will SKYROCKET your productivity - here’s how
10:02
typecraft
Рет қаралды 77 М.
~/.dotfiles in 100 Seconds
13:54
Fireship
Рет қаралды 409 М.
Я ВЗЯЛ МАН ЮНАЙТЕД НА 10 СЕЗОНОВ...
30:20