-
Notifications
You must be signed in to change notification settings - Fork 77
Vim 配置vim airline
Haojian Wu edited this page May 24, 2017
·
2 revisions
vim-airline
是一个强化vim
状态栏的插件,配置方法如下:
- 安装
vim-airline/fonts
字体,否则状态栏不会正常显示>>
箭头(乱码) - 安装
vim-airline
和vim-airline/vim-airline-themes
插件,如果使用 Vundle 插件管理工具,直接添加Bundle XX
即可 - 添加下面配置到
.vimrc
:
"" airline settings.
let g:airline_theme = 'simple'
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline#extensions#tabline#enabled = 1
" show absolute file path in status line
let g:airline_section_c = '%<%F%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
" show tab number in tab line
let g:airline#extensions#tabline#tab_nr_type = 1
- 重启 vim会发现状态栏发生变化,但是箭头有可能不对齐,没有一个统一的解决方法(powerline/fonts#31)。在 Mac (iterm2)机器上,箭头就没有对齐,解决方法:在 Iterm2设置
Non-ASCII
字体:在尝试了所有Powerline 字体,13pt Meslo LG L DZ regular for Powerline
效果是最满意的。
还可以在.vimrc
设置如下快捷键,控制split panel
:
" panel navigators
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" map keys for vertical/horizontal split panel
nnoremap <leader>vs <C-w>v
nnoremap <leader>hs <C-w>s
" map keys for resize vertical/horizontal window:
nnoremap <silent> + :exe "resize " . (winheight(0) * 4/3)<CR>
nnoremap <silent> _ :exe "resize " . (winheight(0) * 3/4)<CR>
nnoremap <silent> > :exe "vertical resize " . (winwidth(0) * 4/3)<CR>
nnoremap <silent> < :exe "vertical resize " . (winwidth(0) * 3/4)<CR>
LLVM/Clang
C/C++
- Get lower 32 bits from uint64
- How to unpack a std::tuple to a function with multiple arguments?
- {}-list Initialization
- Empty macro arguments
- 为什么能在函数中以by value方式返回unique_ptr?
- c++unsigned类型提升
- extern "C"
Linux
- ubuntu获取源码方法
- gcc/g++常用命令
- 浏览器导入安全证书
- ubuntu下宏包latex安装
- Bash Shell常用快捷键
- ubuntu把/tmp目录挂载到内存
- tar命令
- voyager12.04 apt-get install无法安装解决方法
- terminal shows git branch
- 编译GTK API源程序(附带pkg-config用法)
- ldconfig检查库是否存在
- Googletest Setup&Install
- Centos设置service开机自动启动
- CentOS create admin user
- 设置时区
- MySQL修改root密码
- MySQL常用命令
- Screen使用
- 环境变量
- Unity桌面环境的desktop文件
- zip和gzip文件区别
- Linux安全设置
Vim
- vim列编辑
- vim编辑二进制文件
- vim quickfix窗口
- Vim 批量操作
- Vim对多行重复操作
- mac下vim编译安装
- mac下vim taglist无效解决方法
- Vim 配置vim-airline
Tools
- gdb cgdb命令
- Source Insight添加.cc文件
- Source Insight快捷键
- GPT分区转MBR分区
- IRC工具Pidgin使用
- iTerm2 shortcuts
- MacOS shortcuts
- Compile/Run JUnitTest in Command Line
- Install Python2.7 on CentOS 6.4
- Install vmware tool on ubuntu server 12.04
- node-gyp Usage
- zsh中文乱码解决方法
- tmux快捷键
- 使用aria2突破百度云盘限速
- 配置 scheme编写环境
- How to list all available targets in ninja
Others
- CRLF换行符
- Git autocrlf设置
- Git reflog数据恢复命令
- how to migrate from SVN repo to Git repo
- Git submodule使用
- Git Pull强制更新
Chromium-Dev tips