> For the complete documentation index, see [llms.txt](https://dofy.gitbook.io/learn-vim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dofy.gitbook.io/learn-vim/zh-cn/plugins/airline.md).

# Airline & Themes

Airline 可以在 Vim 中显示更友好的状态栏，再配以漂亮的配色，工作更开心。

## 项目地址

* Airline <https://github.com/vim-airline/vim-airline>
* Airline Themes <https://github.com/vim-airline/vim-airline-themes>

## 安装

> 添加 `.vimrc` 配置

```vim
" 同时安装两个插件
Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes'
```

> Vim 中执行 `:source ~/.vimrc` 重载配置文件
>
> 执行 `:PlugInstall` 安装 Airline 和 Aairline Themes 插件
>
> 在 `.vimrc` 中添加如下设置使 Airline 生效

```vim
set laststatus=2    " 始终显示状态栏

" Airline
let g:airline#extensions#tabline#enabled=1    " 开启 tab 栏
```

> 重载配置文件使之生效，如果没有效果可以尝试重启 Vim

现在你应该会看到 Vim 下方显示出了一条状态栏，显示信息一般会包含 **当前模式**， **当前文件**，**文件类型**，**文件编码**以及**当前行列信息**。

因为我们同时安装了 Airline Themes 插件，所以可以通过如下方式设置 Airline 的样式。

> 执行 `:AirlineTheme simple` 应用 `simple` 样式，或者修改 `.vimrc` 文件，添加如 下配置：

```vim
let g:airline_theme='simple'
```

Airline Themes 包含了非常多的样式，具体可以参考该项目的 [样式文件夹](https://github.com/vim-airline/vim-airline-themes/tree/master/autoload/airline/themes) 其中所列的样式都可以应用。

更多细节和效果图可以参考[项目地址](https://github.com/vim-airline/vim-airline)。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dofy.gitbook.io/learn-vim/zh-cn/plugins/airline.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
