---
title: "Vim Tabs"
url: "https://courses.osherove.com/courses/vim-hates-you/vim-tabs.md"
canonical: "https://courses.osherove.com/courses/vim-hates-you/vim-tabs/"
tags: []
author: "Roy Osherove"
description: "Lesson 14 of 26 in Vim Hates You (Divide & Conquer your windows), 2:10. 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/"
---

# Vim Tabs

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 14 of 26

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

## In this lesson

Roy opens a new tab with tabnew, writes a file in it, and moves to the next tab with gt and to the previous one with g and uppercase T; recent versions also accept Ctrl-Page Up and Page Down. He closes a tab with q, opens a file in a new tab by giving tabnew a file name, or uses tabfind, which searches the Vim path. He adds that some people prefer tabs to windows or buffers.

## Transcript

316 words

[\[00:06\]](https://www.youtube.com/watch?v=1t7iOi29REA&t=6s) Other than Windows, Vim also has the notion of buffers and and it also has the notion of tabs. So today we're going to look at tabs. And tabs basically mean kind of looks like a tabbed interface. And the way you work with tabs, one of the easiest way to work with it is to go to command mode here at the bottom. Type tab new. And here we have a new tab. It doesn't have any file yet. So technically I could just press I to go to insert mode. This is a file in a new tab.

[\[00:37\]](https://www.youtube.com/watch?v=1t7iOi29REA&t=37s) Escape. And then I'm going to write with the file name file 2. And now I have these two tabs. And if I want to move to the next tab or the previous one, I'll do GT to move to the next tab. again GT GT or I can press G and uppercase T to move previous tab. In recent VI versions you can also do control page up and down to move between tabs.

[\[01:08\]](https://www.youtube.com/watch?v=1t7iOi29REA&t=68s) And if you want to close a tab, it's very easy. You simply say command sorry go to command and Q for quit. Now our tab is closed. We can also open a tab by just specifying the file name by saying tab new and then file 2. And here I have my tab open. Or I could do a command tab find and then my file 2 and it will search in the vim path which is defined in a vimrc sometimes or in the default vimrc files which I'll explain in different videos.

[\[01:52\]](https://www.youtube.com/watch?v=1t7iOi29REA&t=112s) So that's it. Working with tabs is pretty easy. Some people like it way more than working with different window windows or just buffers. A buffer is inside a tab but it's visually different. So you can switch between buffers just by switching between different tabs.

[Previous lesson Multiple Windows](https://courses.osherove.com/courses/vim-hates-you/multiple-windows/) [Next lesson Tabs as window Layouts](https://courses.osherove.com/courses/vim-hates-you/tabs-as-window-layouts/)


---

## 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/
