Those who have programming experience should know that when a file is read from disk to memory, a memory buffer is allocated in advance to store the contents of the read file, and vim does the same. When vim reads a file, it maps the contents of the disk to a buffer in memory through memory mapping. vim can open multiple files, each with an independent buffer. In order to manage these open files, vim has the concept of buffer lists, and also provides some accompanying commands to manipulate buffer lists.
I actually like it that he does that. It's nice to have something else at the beginning that is not just a screen. Maybe it's because I like coffee a lot as well 😄
Had to make sure I wasn't suddenly in a European Coffee Trip video haha. I recently switched to using neovim from VS Code and it was a rough mental shift for me to stop thinking of tabs so much. But after some practice, Telescope and Harpoon are hard to go away from now.
I use standard Vim, not Neovim, so perhaps the default keybindings changed, but you could use gt and gT in normal mode to navigate tabs instead of having to use command mode.
how to hide the title bar of a window application? I see your terminal emulator does not have title bar(the bar with name of the window, min/max/close buttons etc). Is this feature from the terminal itself or a custom window manager? Btw, what linux distro are you using? Thanks a lot in advance.
Hi! I’m using wezterm here that has th capability on its own. Same goes for other emulators like iterm and alacritty… I’m using Mac locally and daily many Linux distros but on servers mainly
I'm a self-declared vim expert. I use tabs as they are collections of window layouts. They should not be used to navigate buffers. For larger projects in particular, it's useful to save these window layouts. Edit: I use arch btw
Hi, you propagate to learn how to reduce and eliminate distractions and to be more focused. A transparent and shine through terminal is exactly the opposite of that. Seeing shine through the background is very distracting and annoying and even sacrifices the contrast of the presented information. Always when I see peoples transparent terminals I always think that they want to impress with graphical or screen effects instead of doing their work.
You didn't show the main point of tabs? To have different arrangements of windows in the same session. E.g. sometimes I have one buffer in one tab, and a vertical split of two buffers in another tab.
I get your point. That's the point where I think most users tend to start addressing tabs as additional file memory slots instead of understanding they're just a viewing system. I mean, the cases where I'd need more tabs with different splits just for more buffers doesn't make sense when you understand the buffers are independent. Got me to the point I don't use tabs at all! I just change the splits based on need and change the buffers within them. I hope it makes sense!
@@devopstoolbox So in one tab, I have a source file and its treesitter playground opened in a vertical split. In another tab, I have the treesitter query file I'm writing right now. It's very convenient to use tabs for this. How would you do this without tabs?
@@devopstoolbox What @Tee is saying is indeed the use case of vim tabs (as I understand it) and it definitelly makes sense! You may have a particular useful layout of windows, maybe with a test file and a implementation file with splits and a third or even fourth split with another file, a kind of layout that kinda takes time to recreate, but then you remember you actually have to tweak that other config file, maybe a Docker file, and you want to see it big. You can just create a new tab and open it, this way you can start editing that Docker file without having to touch the layout you took so long to create. When you're done, you can simply just delete that tab, even close the buffer with the Docker file, and that layout that took so long to create is still there, intact, waiting for you. Buffers are indeed independent, and windows are just a viewport to a buffer. And a tab is just a collection of windows, that is it.
@@lucastperez I totally agree with everything you both mentioned! My point was, that workflows differ. One person's open tab with splits for config is the easiest path, while for me it can be Telescope fuzzy finding that specific file and opening the buffer in my current window / split. I'm in no way saying tabs are useless! Just that more often than not, users (including me) use them as buffers (one per file). As long as you understand the relation and what each is used for, your workflow is your own. This is, to me, the power of VIm :) You can customize the environment to your liking and you have all the power and utilities to do so!
@@devopstoolbox agreed about the workflows. i've recently changed mine to stop using NvimTree as a navigation tool and more as a "getting my bearings" tool. so i understand the folder structure better using NvimTree, but actually navigate using Telescope and Harpoon. if im working on two projects at once i like to have two different nvim instances open as well:O because then with "natecraddock/workspaces.nvim" i just open up a workspace in one nvim instance (fancy way to change directory), and know that im in the correct workspace path for all of my navigation needs. also the "require('telescope.builtin').buffers" view with "delete_buffer" bound lets you delete buffers through telescope which makes it really easy to sort out your current nvim instance. oh and i just read a comment about "natecraddock/sessions.nvim"! i forgot i had that installed. i should start using it more :P
Love the question :) For one, because I can link this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HhZJ1kbzkj0.html And beyond, I think it's a lot of muscle memory and years of customizing the environment to my needs and ability to remember. e.g.: leader+s till is for searching with telescope so "sf" for search+files, "sb" for buffers and so on. Same goes for git fugitive (another vid: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IyBAuDPzdFY.html) starting with "g". This is how most of my configuration works.
If you liked this video, you may find my Vim playlist interesting: ru-vid.com/group/PLmcTCfaoOo_grgVqU7UbOx7_RG9kXPgEr Be sure to subscribe for more: www.youtube.com/@devopstoolbox?sub_confirmation=1
This is a native feature of vim - relative line numbers (set rnu) The benefit is knowing how many lines it takes to get somewhere. So I can perform any motion (delete yank or even run a macro) based on the number of lines the cursor is away from the target, up or down
I’m a huge fan of Takuya! It was his content that inspired me to start RU-vid just with a different angle of content. I wish I’d someday get to his level of photography and editing but for now I’ll take your comment as a compliment for managing to reach a tiny fraction of his talent!
Hi DevOps, thanks for the interesting video! In Neovim I usually use splits for showing multiple files (or different locations in the same file) and tabs when I have to open a new project, or some files that are not related to those already open. I know that they're all open buffers without any distinction, but I still find this helpful. Honestly, the only thing I couldn't understand from the video was why neovim users don't use tabs... Maybe I've missed it. It could be useful to do a short recap in the end which just focus on the point you tried to explain 🙂 Thank you anyway and have a nice day
Amazing feedback thanks mate! I’ll take your input into consideration on my next video. With regards to tabs - once you control buffers, the only need for tabs is for a constant window separation that’s not in a split. The idea is not “ignore tabs altogether” but - don’t use it like a normal IDE to keep files open (because it doesn’t). Once you understand the distinction than it’s less likely you’ll use them on a regular basis (that was my experience). I hope it makes sense and thanks again!
Haha! Interesting take :) do you use the internal terminal in nvim or a floating one? In both I find the scrolling and manipulation + overall visual just subpar. I’ll use the floating terminal every once in a while but not beyond
while opened buffers do not take much memory is not a problem. Usually I'm working with no more than 3000 code lines buffers and very often I've at least 5 or 6 buffers and is not problem, but yes, for those who memory is a really problem, will approach so much your recomendations.
I agree! With modern machines, where this becomes a problem is usually with plugins that deal with the entire set of open buffers and then you can start feeling some lag. If you're a complete vanilla user this is probably not a problem. That said, I think it's extremely important to understand the relation between buffers and windows, not only for resource consumption but for the workflow!
This is actually querty! I thought about changing many times, but everyone else, including friends who love other layouts like Dvorak admit it doesn’t improve speed, only strain. I might pick up another one some day 🤷♀️
dvorak user here! while I like it, and there's a bit less key travel, I feel like it was a bit of a waste of time to learn since everything is qwerty centric including vim keys. I never used vim on qwerty, but I am a bit jealous that all the arrow motions are on one hand for example.
this tells me you don't really know how to use other editors/ides. Newsflash for you 1. ALL software has buffers. 2. ALL software that works with files uses buffers to keep the files in memory. 3. ALL software that displays a file in splits is using the same buffer in all those "windows"; the difference is that some software like vim/jedit/emacs and others lets you work with the buffers directly. More Newsflash for you, Emacs has all of those features of vim & more, why? because Emacs is a full blown programming runtime with a 2d text+graphic environment, it also has a server, so you can use emacs in server mode and then just open the client with your tiling window manager or even within a terminal/tmux/screen (the og tmux from gnu) Emacs is more like Electron than an a Text Editor.
Hello there buddy, I hope everything’s ok! I’m doing my best trying to learn 😉 The point of this video was the user perspective and you interact with open files rather the actual implementation but thank you for you important comment! Re emacs, nobody said anything bad about eMacs and I hope you keep having a blast using it! Bonne journee!
you know you're too much of an oldschool vim user when you think that "tabs" refer to ASCII \t and not tab pages and keep forgetting that during the video after getting distracted because your pourover is still dripping... speaking of... brb. Really like the video though. I guess I'll have to subscwibe
I can relate. It took my a long time to convince myself to go for it. I'll tell you what though - it's a lifetime purchase! I bought it 5 years ago, it completely transformed my productivity (with the enjoyment) of typing and working. Just lubed it recently and it's even nicer now! So look at it as investment for years! There's also a great second hand market for them, and, many affordable keybaords with the HHKB layout!
Hi @Devops, love the videos, keep them coming! Question: I saw a video with very minimalistic lua line config somewhere. Was that you? If so, can you share it?
Thanks man! I didn't do a video covering my config. I think I need to do it because I've been asked multiple times, and, I feel like I should go for the "from scratch" video to help beginners out. My configs are always open at dotfiles.omerxx.com LMK if you found what you were looking for!
Hi! Do you use the Lazy package manager? Im not sure why but recently after migrating my Packer configs to Lazy, the command mode's auto (tab) completion doesnt work anymore Not sure why
@@devopstoolbox I use karabiner too, It has conditions that only has this modification when I'm focused on wezterm? Cuz other situation I don't need that
@@devopstoolbox both things. RU-vid is certainly filled with this topic, but people still get confused about it, so it's clearly not enough, despite it should. Thanks for spreading the word in any case
Hey! Lots of people commented about Harpoon. TBH I gave it a shot and it sits somewhere between a mark and a jump list (another video I have). Not sure how this comes into buffers though.. In anycase, maybe I should give it another go ;)
@@devopstoolbox i love it, been using it for over a year now. more specifically i like not having to conform to a specific editing style, rather i can tweak it and make it work the way i want it to. and i can slowly add and tweak things over time to make things easier as well. like recently ive been slowly introducing some modal editing features
@@oddmerlin9797 I totally get that. I could argue that Vim can be tweaked to your liking but I do get your point. Vim’s old selling point was the fact that you had (still do) it everywhere, headless systems and servers, even lean containers. And if you know the basic motions almost every editor has a vim mode (like spacemacs), heck even the most expensive email client in the world uses vim motions 😅 (superhuman). I may be (very) biased, because I already took the time to learn it and it’s mostly muscle memory by now. I have friends enjoying eMacs with spacemacs just for the motions claiming this makes the perfect working environment. Maybe some day I’ll give it a go 😉
@@xthebumpx I remember debating myself a long while with mine and the comandante and went for the 1z eventually. Isn’t yours more suitable for espresso? I’m using mine purely for filter. Got an electrical burr grinder for espresso
@@devopstoolbox Yep, was planning on getting a Flair or Robot for espresso at the time, but never ended up pulling the trigger. Still does a good job for my Moka pot.
I prefer making tabs just so that I can see more, but I try to keep 2-3 tabs that I switch between. There might be other tabs but they will be mostly unused.
I totally get it. Personally though, this changed how I handle open files and viewes. From time to time I still make use of tabs, they’re just no my go-to anymore
@@devopstoolbox What do you do if you need maximum view size with 2 different files. Lets say you are jumping back/forth between 2 bigger files and you need to see a bigger scope of the code in both places?
@@lmnts556 If a split isn't a solution then simply moving between buffers :) Just as you do with tabs! Instead of moving a tab left, you can move to the buffer "on the left". Lua line helps with that and can show you a presentation of open buffers. TBH thought, most of the time I do one of two things - 1. Fuzzy find the file with telescope and jump there, OR 2. Use Harpoon (I have a video on that as well) to move between saved marks These are my go to. I rarely use tabs
@@devopstoolboxCool, yeah I use telescope 👍That is interesting tho. It's probably better as it does not create a new instance. I think the only downside is you can't :wq as it will shut down the whole thing while in tabs it will only remove that tab. So I guess I have to :w then ctrl w to close the buffer, which is what I use as a remap to close buffer window.
I dislike buffers because they can will hidden or will open it in another tab. Managing them is very difficult. Which is why many developers quit Vim/Nvim and reopen it multiple times. While it’s great that buffers can be hidden, I wish I could configure it to prevent opening in another tab,every tab had own buffers
Hey Ayoub! I really think you should check the plugin I use together with Telescope. They do a great job in showing the buffers and helping you navigate. They shouldn't be hidden at all! I don't remember myself ever quitting vim because of too many tabs but I can see how people get there. Check out the flow in the Video if you havn't already but please do ask any questions and I'll do my best to help you with the flow!
I still don't get the love people have for this editor.. it's stupid over complicated with a huge amount of commands you need to memorize for next to no gain.. the only thing is that it maybe makes it more difficult to replace you on the job since its difficult to finde another willing to endure the pain of vim
Hi! I can suggest another POV: you learn it *with a system* not just by memorizing- (it’s not for nothing that you have every modern IDE and even mail client these days ship natively with many of these motions), what you get is productivity and FUN 🤩- which go hand in hand! Job security is actually not among its benefits as most people use GUI based IDEs and it’s almost never a job requirement!
I actually think you can if you want :) Thank you for that! If there's a specific type of content you feel that can make the difference for you please say it!
@@devopstoolbox with neovim embedding to make a real Vim backend available, it doesn't have to be "only motions". But I agree it's still kinda subpar, because now you have two editors clashing and wanting to do things their way.