---
title: "Vim多文件切换"
author: "amanhu"
date: "2011-05-16T10:30:00Z"
tags: []
slug: "vim"
draft: false
lastmod: "2013-01-05T22:34:07Z"
id: 1762930
url: "https://bithufei.iteye.com/blog/1762930"
---

**多文件切换**

1. 通过vim打开多个文件（可以通过ctags或者cscope）
2. ":ls"查看当前打开的buffer（文件）
3. ":b num"切换文件（其中num为buffer list中的编号）

可以用到的命令有  
":bn" -- next buffer in the buffer list  
":bp" -- previous buffer in the buffer list  
":b#" -- previous buffer you was in