Tabs in Vim are containers for window layouts. There is always at least one tab page open. Closing a tab doesn't close the buffer. See :help tabpage
@zeocamo2 жыл бұрын
you don't need tabs for this workflow you get, vim do this with buffers, and you say the file goes away and dont auto save with tabs, that is because tabs is not made for what you use it for in vim. when you close a tab you dont close the buffer, Tabs is only a layout thing for holding a set of splits and buffers but it is the same buffers, so what you want is to learn buffers and then you can get your "tabs" in a split, by switch buffer you can see all the buffers with :buffers, also the ones that was in the tabs you close ;) and :files or :ls a list of files you can search for a buffer with :b some_text_in_file and switch to it, :b will auto complete you can use :bn or :bp to move over them you can use :e# to edit alternate file and ctrl-^ do the same thing
@TheLinuxCast2 жыл бұрын
Yeah, I like my way better. If I actually had to go to a list of the buffers, I'd get lost too easily. I like that they are all right there at the top.
@zeocamo2 жыл бұрын
@@TheLinuxCast you can use ctrl+g for the file name
@Kalasklister13372 жыл бұрын
I want to second this. Tabs in vim are not designed to be used as tabs in traditional editors. If you are serious about using vim find a way to integrate buffers into your workflow. In neovim i strongly recommend telescope and binding the buffer listing to some key combination. In regular vim there are a few plugins that make buffers show up as if they were tabs. Believe me, you will have a much better workflow in the long run if u do this. I have ctrl L and ctrl H mapped to bnext and bprev to effortlessly glide through the buffers i have open and telescope for fuzzy finding by name
@zeocamo2 жыл бұрын
@@Kalasklister1337 telescope is great
@retrojon_10 ай бұрын
Just starting to learn nvim and this was extremely helpful! I'm still a vscode user primarily but I really like how simple it is to customize nvim.
@rkdeshdeepak41312 жыл бұрын
Just map tab to tabnext and shift+ tab to tabprev , and space +n to tabnew in normal mode . And cheers. That makes my workflow superawesome.
@arkoprovoshaw57372 жыл бұрын
You can use gt in normal mode to switch tabs
@Ironpants572 жыл бұрын
And gT to go backward
@arkoprovoshaw57372 жыл бұрын
@@Ironpants57 I'll be honest. I didn't know you could do that
@zsadroh52792 жыл бұрын
And a number + gt to go to a specific tab
@CyperN0772 жыл бұрын
Matt this really made my workflow go. Thnx.
@coon-si3ce2 жыл бұрын
I just use gt and GT for next tab and previous tab. And can use Number gt to go to a specific tab. No need to remap keys. but whatever makes you happy.
@djaanmaiden50492 жыл бұрын
There is a out-of-the-box basic fuzzy finder in Vim to navigate between files. vim .zlogin .zshrc .zenv :b rc :b log :b env Not :ls ... keep reading. You can even see what files are opened in a nice popup and navigate between them with [tab] :b[space][tab] and then tab again to change file That's why vim defaults to buffer and not tabs when opening multiple files and why buffesr are better. You will always remember the filename to do ":b rc" and closing one tab will completely destroy your memory to do 1gt 2gt etc. I tried doing :tab name_of_tab but it does not work.
@MrCradleman2 жыл бұрын
C-n actually bind to vim built in autocomplete. Very useful binding. It complete any word from current buffer
@TheLinuxCast2 жыл бұрын
I never use autocomplete, so that's why this binding doesn't bother me.
@thingsiplay2 жыл бұрын
There are default maps: Control-PageDown Control-PageUp
@zeocamo2 жыл бұрын
but you need to move your hand a lot for them. so useless, because with your hands
@whylde78342 жыл бұрын
Very cool. I was envious of people on VS Code with their tabs.
@BrucesWorldofStuff2 жыл бұрын
Oh No! You have turned into a Tab Hoarder Heathen... I know the feeling, I do the same thing... If the program lets me have tabs I have lots and lots of them open! It's like having lots and lots of dogs or cats, or heaven forbid, kids... LOl Is there a pill for this Tab thing? :-P As for the Vim thing... One day we will all have to get down on our knees and wave our arms in the air and chant "We're Not Worthy"! Lol Lol Lol That is so cool as I do like tabs when I'm doing things in Code or Xed. I wish I could get my head wrapped Vim... :-) Anyway, Thanks Matt! LLAP
@TheDistroHopper2 жыл бұрын
`gt` goes to new tab
@casawilinux94972 жыл бұрын
Hi can you please show how to install conky on Debian 11 but step by step how to configure themes conky because I'm a linux beginner I'm not an expert in Linux
@scoopynoodle8418 Жыл бұрын
To save and close tabs you can type "ZZ"
@tiltltt2 жыл бұрын
Tmux plus vim is a god combo. You can use splits, sessions, buffers, tabs and probably more lol.
@zeocamo2 жыл бұрын
no, it is not, Vim will not share buffers in a TMux split(so useless), and the only thing can so is Sessions, but there is a lot buffer ways then tmux for sessions. if you wan splits and tabs out site of vim then use a WM, it is why they exists.
@rvktiw2 жыл бұрын
Were you living in 2008 until this video.
@kaushalkumarllc2 жыл бұрын
Bro, you are awesome. Do you have discord or something where we can communicate..!!