---
title: "Tabs as window Layouts"
url: "https://courses.osherove.com/courses/vim-hates-you/tabs-as-window-layouts.md"
canonical: "https://courses.osherove.com/courses/vim-hates-you/tabs-as-window-layouts/"
tags: []
author: "Roy Osherove"
description: "Lesson 15 of 26 in Vim Hates You (Divide & Conquer your windows), 2:25. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Tabs as window Layouts

1. [Courses](https://courses.osherove.com/#courses)
2. [Vim Hates You](https://courses.osherove.com/courses/vim-hates-you/)
3. Divide & Conquer your windows

Lesson 15 of 26

Duration: 2:25 [Watch on YouTube](https://www.youtube.com/watch?v=lrHFrxRkrYo)

## In this lesson

Roy explains that a tab contains windows and each window is a view into a buffer, so the same file can be open in two tabs at once. He argues that tabs are meant as collections of windows used for layout: in one tab he puts the vimrc and a new file side by side with vsplit, adds a third file with split and moves between them with Ctrl-W. He sums up tabs as a way to lay out buffers or to have different views of the same project.

## Transcript

376 words

[\[00:08\]](https://www.youtube.com/watch?v=lrHFrxRkrYo&t=8s) So now that we've seen windows and tabs, let's understand buffers and the fact that tabs are actually not supposed to be used the way you use tabs today in other IDEs. That is a tab basically can contain a window and a window is just one of them and a window is a view into a specific buffer and you can have multiple windows pointing to the same buffer. In this case, I have one tab that has one window that views the buffer of file 2 and I have another tab with one window that has a view to the vimrc file.

[\[00:41\]](https://www.youtube.com/watch?v=lrHFrxRkrYo&t=41s) But technically, I can view both files in two different tabs or the same file in two different tabs. All I have to do is to say e, sorry, let's make this focus. e .vimrc. And now I have the same file open in two tabs. So what's the point of tabs really? If I just go to the next tab, I'm just switching between the file. And the answer is that tabs were really supposed to be a collections of windows or basically used for layout.

[\[01:13\]](https://www.youtube.com/watch?v=lrHFrxRkrYo&t=73s) So for example, in this case, I can say that in this tab, I'm editing Vimrc side by side with my new file. So I'm going to do a vsplit and file two. So now in this tab I have these two files and I can move between them with control w and and and right or control w and left that is control wtrl w. I can then further split this.

[\[01:43\]](https://www.youtube.com/watch?v=lrHFrxRkrYo&t=103s) For example, in this window right now, I can say split with new file. Another third file that I created. So now I have these three files. I can do control W down, control W right, W left. But this is just the layout of these things. I can switch to my previous tab by saying GT go to next tab. And here I have just one of the files. So I have GT here and I have GT here. And these one of them shows the same file.

[\[02:15\]](https://www.youtube.com/watch?v=lrHFrxRkrYo&t=135s) It's just different layouts. So tabs are one way to lay out all your buffers or to have different views of the same project.

[Previous lesson Vim Tabs](https://courses.osherove.com/courses/vim-hates-you/vim-tabs/) [Next lesson Installing Plugins (Vim plug + Airline)](https://courses.osherove.com/courses/vim-hates-you/installing-plugins-vim-plug-airline/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
