mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-07 12:44:26 +08:00
Compare commits
1 Commits
dynamic_wi
...
535
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d69d53b5 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
doc/tags
|
||||
*.lock
|
||||
.vim-flavor
|
||||
*.swp
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
language: ruby
|
||||
before_install:
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim
|
||||
- curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/molokai.vim" -o autoload/airline/themes/molokai.vim
|
||||
- mkdir colors && curl -f -L 'https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim' -o colors/molokai.vim
|
||||
rvm:
|
||||
- 1.9.3
|
||||
script: rake ci
|
||||
|
||||
120
CHANGELOG.md
120
CHANGELOG.md
@@ -1,120 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
This is the Changelog for the vim-airline project.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.8] - 2016-03-09
|
||||
- Changes
|
||||
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
|
||||
- Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
|
||||
- Improvements
|
||||
- Extensions
|
||||
- branch: support Git and Mercurial simultaneously, untracked files
|
||||
- whitespace: new mixed-indent rule
|
||||
- Windows support
|
||||
- Many bug fixes
|
||||
- Support for Neovim
|
||||
- New features
|
||||
- Many new themes
|
||||
- Extensions/integration
|
||||
- [taboo](https://github.com/gcmt/taboo.vim)
|
||||
- [vim-ctrlspace](https://github.com/szw/vim-ctrlspace)
|
||||
- [quickfixsigns](https://github.com/tomtom/quickfixsigns_vim)
|
||||
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
- [po.vim](http://www.vim.org/scripts/script.php?script_id=695)
|
||||
- [unicode.vim](https://github.com/chrisbra/unicode.vim)
|
||||
- wordcount
|
||||
- crypt indicator
|
||||
- byte order mark indicator
|
||||
- Tabline's tab mode can display splits simultaneously
|
||||
|
||||
## [0.7] - 2014-12-10
|
||||
- New features
|
||||
- accents support; allowing multiple colors/styles in the same section
|
||||
- extensions: eclim
|
||||
- themes: understated, monochrome, murmur, sol, lucius
|
||||
- Improvements
|
||||
- solarized theme; support for 8 color terminals
|
||||
- tabline resizes dynamically based on number of open buffers
|
||||
- miscellaneous bug fixes
|
||||
|
||||
## [0.6] - 2013-10-08
|
||||
|
||||
- New features
|
||||
- accents support; allowing multiple colors/styles in the same section
|
||||
- extensions: eclim
|
||||
- themes: understated, monochrome, murmur, sol, lucius
|
||||
- Improvements
|
||||
- solarized theme; support for 8 color terminals
|
||||
- tabline resizes dynamically based on number of open buffers
|
||||
- miscellaneous bug fixes
|
||||
|
||||
## [0.5] - 2013-09-13
|
||||
|
||||
- New features
|
||||
- smart tabline extension which displays all buffers when only one tab is visible
|
||||
- automatic section truncation when the window resizes
|
||||
- support for a declarative style of configuration, allowing parts to contain metadata such as minimum window width or conditional visibility
|
||||
- themes: zenburn, serene
|
||||
- Other
|
||||
- a sizable chunk of vim-airline is now running through a unit testing suite, automated via Travis CI
|
||||
|
||||
## [0.4] - 2013-08-26
|
||||
|
||||
- New features
|
||||
- integration with csv.vim and vim-virtualenv
|
||||
- hunks extension for vim-gitgutter and vim-signify
|
||||
- automatic theme switching with matching colorschemes
|
||||
- commands: AirlineToggle
|
||||
- themes: base16 (all variants)
|
||||
- Improvements
|
||||
- integration with undotree, tagbar, and unite
|
||||
- Other
|
||||
- refactored core and exposed statusline builder and pipeline
|
||||
- all extension related g:airline_variables have been deprecated in favor of g:airline#extensions# variables
|
||||
- extensions found in the runtimepath outside of the default distribution will be automatically loaded
|
||||
|
||||
## [0.3] - 2013-08-12
|
||||
|
||||
- New features
|
||||
- first-class integration with tagbar
|
||||
- white space detection for trailing spaces and mixed indentation
|
||||
- introduced warning section for syntastic and white space detection
|
||||
- improved ctrlp integration: colors are automatically selected based on the current airline theme
|
||||
- new themes: molokai, bubblegum, jellybeans, tomorrow
|
||||
- Bug fixes
|
||||
- improved handling of eventignore used by other plugins
|
||||
- Other
|
||||
- code cleaned up for clearer separation between core functionality and extensions
|
||||
- introduced color extraction from highlight groups, allowing themes to be generated off of the active colorscheme (e.g. jellybeans and tomorrow)
|
||||
- License changed to MIT
|
||||
|
||||
## [0.2] - 2013-07-28
|
||||
|
||||
- New features
|
||||
- iminsert detection
|
||||
- integration with vimshell, vimfiler, commandt, lawrencium
|
||||
- enhanced bufferline theming
|
||||
- support for ctrlp theming
|
||||
- support for custom window excludes
|
||||
- New themes
|
||||
- luna and wombat
|
||||
- Bug fixes
|
||||
- refresh branch name after switching with a shell command
|
||||
|
||||
## [0.1] - 2013-07-17
|
||||
|
||||
- Initial release
|
||||
- integration with other plugins: netrw, unite, nerdtree, undotree, gundo, tagbar, minibufexplr, ctrlp
|
||||
- support for themes: 8 included
|
||||
|
||||
[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.8...HEAD
|
||||
[0.8]: https://github.com/vim-airline/vim-airline/compare/v0.7...v0.8
|
||||
[0.7]: https://github.com/vim-airline/vim-airline/compare/v0.6...v0.7
|
||||
[0.6]: https://github.com/vim-airline/vim-airline/compare/v0.5...v0.6
|
||||
[0.5]: https://github.com/vim-airline/vim-airline/compare/v0.4...v0.5
|
||||
[0.4]: https://github.com/vim-airline/vim-airline/compare/v0.3...v0.4
|
||||
[0.3]: https://github.com/vim-airline/vim-airline/compare/v0.2...v0.3
|
||||
[0.2]: https://github.com/vim-airline/vim-airline/compare/v0.1...v0.2
|
||||
[0.1]: https://github.com/vim-airline/vim-airline/releases/tag/v0.1
|
||||
@@ -1,32 +0,0 @@
|
||||
# Contributions
|
||||
|
||||
Contributions and pull requests are welcome. Please take note of the following guidelines:
|
||||
|
||||
* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords.
|
||||
* Keep the history clean! Squash your branches before you submit a pull request. `pull --rebase` is your friend.
|
||||
* Any changes to the core should be tested against Vim 7.2.
|
||||
|
||||
# Bugs
|
||||
|
||||
Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following:
|
||||
|
||||
* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. Even better, create a `gist` of your vimrc that is compatible with [pathogen][11].
|
||||
* And to make it easier to reproduce, please supply the following:
|
||||
* the `:version` of vim
|
||||
* the commit of vim-airline you're using
|
||||
* the OS that you're using, including terminal emulator, GUI vs non-GUI
|
||||
|
||||
# Themes
|
||||
|
||||
* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
|
||||
* In the majority of cases, modifications to colors of existing themes will likely be rejected. Themes are a subjective thing, so while you may prefer that a particular color be darker, another user will prefer it to be lighter, or something entirely different. The more popular the theme, the more unlikely the change will be accepted. However, it's pretty simple to create your own theme; copy the theme to `~/.vim/autoload/airline/themes` under a new name with your modifications, and it can be used.
|
||||
|
||||
# Maintenance
|
||||
|
||||
If you would like to take a more active role in improving vim-airline, please consider [becoming a maintainer][43].
|
||||
|
||||
|
||||
[7]: https://github.com/bling/minivimrc
|
||||
[11]: https://github.com/tpope/vim-pathogen
|
||||
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
@@ -1,21 +0,0 @@
|
||||
#### environment
|
||||
|
||||
- vim: ????
|
||||
- vim-airline: ????
|
||||
- OS: ????
|
||||
- Have you reproduced with a minimal vimrc: ???
|
||||
- What is your airline configuration: ???
|
||||
if you are using terminal:
|
||||
- terminal: ????
|
||||
- $TERM variable: ???
|
||||
- color configuration (:set t_Co?):
|
||||
if you are using Neovim:
|
||||
- does it happen in Vim: ???
|
||||
|
||||
#### actual behavior
|
||||
|
||||
????
|
||||
|
||||
#### expected behavior
|
||||
|
||||
????
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2013-2016 Bailey Ling
|
||||
Copyright (C) 2013-2015 Bailey Ling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
|
||||
120
README.md
120
README.md
@@ -1,22 +1,16 @@
|
||||
# vim-airline [](https://travis-ci.org/vim-airline/vim-airline)
|
||||
# vim-airline [](https://travis-ci.org/bling/vim-airline)
|
||||
|
||||
Lean & mean status/tabline for vim that's light as air.
|
||||
|
||||

|
||||

|
||||
|
||||
# Features
|
||||
|
||||
* Tiny core written with extensibility in mind ([open/closed principle][8]).
|
||||
* Integrates with a variety of plugins, including: [vim-bufferline][6],
|
||||
[fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16],
|
||||
[undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29],
|
||||
[vim-signify][30], [quickfixsigns][39], [syntastic][5], [eclim][34],
|
||||
[lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37],
|
||||
[ctrlspace][38], [vim-bufmru][47], [vimagit][50], [denite][51] and more.
|
||||
* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21], [virtualenv][31], [tmuxline][35].
|
||||
* Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
|
||||
* Optimized for speed; it loads in under a millisecond.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others.
|
||||
Note these are now external to this plugin. See [below][46] for detail.
|
||||
* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||
* Supports 7.2 as the minimum Vim version.
|
||||
* The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33].
|
||||
* Unit testing suite.
|
||||
@@ -27,20 +21,6 @@ If you don't like the defaults, you can replace all sections with standard `stat
|
||||
|
||||

|
||||
|
||||
## Themes
|
||||
|
||||
Themes have moved to
|
||||
another repository as of [this commit][45].
|
||||
|
||||
Install the themes as you would this plugin (Vundle example):
|
||||
|
||||
```vim
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
```
|
||||
|
||||
See https://github.com/vim-airline/vim-airline-themes for more.
|
||||
|
||||
## Automatic truncation
|
||||
|
||||
Sections and parts within sections can be configured to automatically hide when the window size shrinks.
|
||||
@@ -72,9 +52,6 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### [unite.vim][9]
|
||||

|
||||
|
||||
#### [denite.nvim][51]
|
||||

|
||||
|
||||
#### [tagbar][19]
|
||||

|
||||
|
||||
@@ -87,9 +64,6 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### hunks ([vim-gitgutter][29] & [vim-signify][30])
|
||||

|
||||
|
||||
#### [vimagit][50]
|
||||

|
||||
|
||||
#### [virtualenv][31]
|
||||

|
||||
|
||||
@@ -99,15 +73,6 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
|
||||
#### [promptline][36]
|
||||

|
||||
|
||||
#### [ctrlspace][38]
|
||||

|
||||
|
||||
#### [xkb-switch][48]/[xkb-layout][49]
|
||||

|
||||
|
||||
#### [vimtex][53]
|
||||

|
||||
|
||||
## Extras
|
||||
|
||||
vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also:
|
||||
@@ -123,7 +88,7 @@ Every section is composed of parts, and you can reorder and reconfigure them at
|
||||
|
||||

|
||||
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/vim-airline/vim-airline/issues/299#issuecomment-25772886)).
|
||||
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/bling/vim-airline/issues/299#issuecomment-25772886)).
|
||||
|
||||

|
||||
|
||||
@@ -151,16 +116,17 @@ I wrote the initial version on an airplane, and since it's light as air it turne
|
||||
|
||||
This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
|
||||
|
||||
| Plugin Manager | Install with... |
|
||||
| ------------- | ------------- |
|
||||
| [Pathogen][11] | `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`<br/>Remember to run `:Helptags` to generate help tags |
|
||||
| [NeoBundle][12] | `NeoBundle 'vim-airline/vim-airline'` |
|
||||
| [Vundle][13] | `Plugin 'vim-airline/vim-airline'` |
|
||||
| [Plug][40] | `Plug 'vim-airline/vim-airline'` |
|
||||
| [VAM][22] | `call vam#ActivateAddons([ 'vim-airline' ])` |
|
||||
| [Dein][52] | `call dein#add('vim-airline/vim-airline')` |
|
||||
| [minpac][54] | `call minpac#add('vim-airline/vim-airline')` |
|
||||
| manual | copy all of the files into your `~/.vim` directory |
|
||||
* [Pathogen][11]
|
||||
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* [Vundle][13]
|
||||
* `Plugin 'bling/vim-airline'`
|
||||
* [VAM][22]
|
||||
* `call vam#ActivateAddons([ 'vim-airline' ])`
|
||||
* manual
|
||||
* copy all of the files into your `~/.vim` directory
|
||||
|
||||
# Configuration
|
||||
|
||||
@@ -185,25 +151,37 @@ Whoa! Everything got slow all of a sudden...
|
||||
|
||||
vim-airline strives to make it easy to use out of the box, which means that by default it will look for all compatible plugins that you have installed and enable the relevant extension.
|
||||
|
||||
Many optimizations have been made such that the majority of users will not see any performance degradation, but it can still happen. For example, users who routinely open very large files may want to disable the `tagbar` extension, as it can be very expensive to scan for the name of the current function.
|
||||
Many optimizations have been made such that the majority of users will not see any performance degradation, but it can still happen. For example, users who routinely open very large files may want to disable the tagbar extension, as it can be very expensive to scan for the name of the current function.
|
||||
|
||||
The [minivimrc][7] project has some helper mappings to troubleshoot performance related issues.
|
||||
|
||||
If you don't want all the bells and whistles enabled by default, you can define a value for `g:airline_extensions`. When this variable is defined, only the extensions listed will be loaded; an empty array would effectively disable all extensions.
|
||||
|
||||
# Screenshots
|
||||
|
||||
A full list of screenshots for various themes can be found in the [Wiki][14].
|
||||
|
||||
# Maintainers
|
||||
# Bugs
|
||||
|
||||
The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44].
|
||||
Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following:
|
||||
|
||||
If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43].
|
||||
* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts.
|
||||
* A link to your vimrc or a gist which shows how you configured the plugin(s).
|
||||
* And so I can reproduce; your `:version` of vim, and the commit of vim-airline you're using.
|
||||
|
||||
# Contributions
|
||||
|
||||
Contributions and pull requests are welcome. Please take note of the following guidelines:
|
||||
|
||||
* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords.
|
||||
* Keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend.
|
||||
* Any changes to the core should be tested against Vim 7.2.
|
||||
* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14].
|
||||
|
||||
# License
|
||||
|
||||
MIT License. Copyright (c) 2013-2017 Bailey Ling & Contributors.
|
||||
MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
||||
[1]: https://github.com/Lokaltog/vim-powerline
|
||||
[2]: https://github.com/Lokaltog/powerline
|
||||
@@ -214,11 +192,11 @@ MIT License. Copyright (c) 2013-2017 Bailey Ling & Contributors.
|
||||
[7]: https://github.com/bling/minivimrc
|
||||
[8]: http://en.wikipedia.org/wiki/Open/closed_principle
|
||||
[9]: https://github.com/Shougo/unite.vim
|
||||
[10]: https://github.com/ctrlpvim/ctrlp.vim
|
||||
[10]: https://github.com/kien/ctrlp.vim
|
||||
[11]: https://github.com/tpope/vim-pathogen
|
||||
[12]: https://github.com/Shougo/neobundle.vim
|
||||
[13]: https://github.com/VundleVim/Vundle.vim
|
||||
[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots
|
||||
[13]: https://github.com/gmarik/vundle
|
||||
[14]: https://github.com/bling/vim-airline/wiki/Screenshots
|
||||
[15]: https://github.com/techlivezheng/vim-plugin-minibufexpl
|
||||
[16]: https://github.com/sjl/gundo.vim
|
||||
[17]: https://github.com/mbbill/undotree
|
||||
@@ -231,31 +209,13 @@ MIT License. Copyright (c) 2013-2017 Bailey Ling & Contributors.
|
||||
[24]: https://github.com/chriskempson/tomorrow-theme
|
||||
[25]: https://github.com/tomasr/molokai
|
||||
[26]: https://github.com/nanotech/jellybeans.vim
|
||||
[27]: https://github.com/vim-airline/vim-airline/wiki/FAQ
|
||||
[27]: https://github.com/bling/vim-airline/wiki/FAQ
|
||||
[28]: https://github.com/chrisbra/csv.vim
|
||||
[29]: https://github.com/airblade/vim-gitgutter
|
||||
[30]: https://github.com/mhinz/vim-signify
|
||||
[31]: https://github.com/jmcantrell/vim-virtualenv
|
||||
[32]: https://github.com/chriskempson/base16-vim
|
||||
[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan
|
||||
[33]: https://github.com/bling/vim-airline/wiki/Test-Plan
|
||||
[34]: http://eclim.org
|
||||
[35]: https://github.com/edkolev/tmuxline.vim
|
||||
[36]: https://github.com/edkolev/promptline.vim
|
||||
[37]: https://github.com/gcmt/taboo.vim
|
||||
[38]: https://github.com/szw/vim-ctrlspace
|
||||
[39]: https://github.com/tomtom/quickfixsigns_vim
|
||||
[40]: https://github.com/junegunn/vim-plug
|
||||
[41]: https://github.com/bling
|
||||
[42]: https://github.com/chrisbra
|
||||
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer
|
||||
[44]: https://github.com/mhartington
|
||||
[45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b
|
||||
[46]: https://github.com/vim-airline/vim-airline#themes
|
||||
[47]: https://github.com/mildred/vim-bufmru
|
||||
[48]: https://github.com/ierton/xkb-switch
|
||||
[49]: https://github.com/vovkasm/input-source-switcher
|
||||
[50]: https://github.com/jreybert/vimagit
|
||||
[51]: https://github.com/Shougo/denite.nvim
|
||||
[52]: https://github.com/Shougo/dein.vim
|
||||
[53]: https://github.com/lervag/vimtex
|
||||
[54]: https://github.com/k-takata/minpac/
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
|
||||
|
||||
let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning']
|
||||
let s:sections = ['a','b','c','gutter','x','y','z','warning']
|
||||
let s:inactive_funcrefs = []
|
||||
|
||||
function! airline#add_statusline_func(name)
|
||||
@@ -48,7 +46,6 @@ function! airline#load_theme()
|
||||
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! airline#switch_theme(name)
|
||||
@@ -65,31 +62,23 @@ function! airline#switch_theme(name)
|
||||
endtry
|
||||
|
||||
let w:airline_lastmode = ''
|
||||
call airline#update_statusline()
|
||||
call airline#load_theme()
|
||||
|
||||
silent doautocmd User AirlineAfterTheme
|
||||
|
||||
" this is required to prevent clobbering the startup info message, i don't know why...
|
||||
call airline#check_mode(winnr())
|
||||
endfunction
|
||||
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
let existing = g:airline_theme
|
||||
let theme = substitute(g:colors_name, '-', '_', 'g')
|
||||
try
|
||||
let palette = g:airline#themes#{theme}#palette
|
||||
call airline#switch_theme(theme)
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
return 1
|
||||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
if match(g:colors_name, map[0]) > -1
|
||||
try
|
||||
let palette = g:airline#themes#{map[1]}#palette
|
||||
call airline#switch_theme(map[1])
|
||||
catch
|
||||
call airline#switch_theme(existing)
|
||||
endtry
|
||||
call airline#switch_theme(map[1])
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
@@ -99,9 +88,6 @@ function! airline#switch_matching_theme()
|
||||
endfunction
|
||||
|
||||
function! airline#update_statusline()
|
||||
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
|
||||
return
|
||||
endif
|
||||
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
if airline#util#getwinvar(nr, 'airline_disabled', 0)
|
||||
continue
|
||||
@@ -111,8 +97,11 @@ function! airline#update_statusline()
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
endfor
|
||||
|
||||
unlet! w:airline_render_left w:airline_render_right
|
||||
exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_')
|
||||
unlet! w:airline_render_left
|
||||
unlet! w:airline_render_right
|
||||
for section in s:sections
|
||||
unlet! w:airline_section_{section}
|
||||
endfor
|
||||
|
||||
let w:airline_active = 1
|
||||
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
|
||||
@@ -143,11 +132,6 @@ function! airline#statusline(winnr)
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode(winnr)
|
||||
if !exists("s:airline_run")
|
||||
let s:airline_run = 0
|
||||
endif
|
||||
let s:airline_run += 1
|
||||
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
@@ -158,8 +142,6 @@ function! airline#check_mode(winnr)
|
||||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
elseif l:m ==# "t"
|
||||
let l:mode = ['terminal']
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
@@ -177,31 +159,17 @@ function! airline#check_mode(winnr)
|
||||
call add(l:mode, 'paste')
|
||||
endif
|
||||
|
||||
if g:airline_detect_crypt && exists("+key") && !empty(&key)
|
||||
call add(l:mode, 'crypt')
|
||||
endif
|
||||
|
||||
if g:airline_detect_spell && &spell
|
||||
call add(l:mode, 'spell')
|
||||
endif
|
||||
|
||||
if &readonly || ! &modifiable
|
||||
call add(l:mode, 'readonly')
|
||||
endif
|
||||
|
||||
let mode_string = join(l:mode)
|
||||
if s:airline_run < 3
|
||||
" skip this round.
|
||||
" When this function is run too early after startup,
|
||||
" it forces a redraw by vim which will remove the intro screen.
|
||||
let w:airline_lastmode = mode_string
|
||||
return ''
|
||||
endif
|
||||
if get(w:, 'airline_lastmode', '') != mode_string
|
||||
call airline#highlighter#highlight_modified_inactive(context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode, context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode)
|
||||
let w:airline_lastmode = mode_string
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,37 +1,21 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" min percentage width per section
|
||||
let g:section_width = get(g:, 'airline#extensions#default#section_width', {
|
||||
\ 'a': {'pct': 7},
|
||||
\ 'b': {'pct': 10},
|
||||
\ 'c': {'pct': 25},
|
||||
\ 'x': {'pct': 7},
|
||||
\ 'y': {'pct': 11},
|
||||
\ 'z': {'pct': 15},
|
||||
\ 'warning': {'pct': 10},
|
||||
\ 'error': {'pct': 10},
|
||||
\ 'gutter': {'pct': 5},
|
||||
\ })
|
||||
|
||||
let s:prototype = {}
|
||||
|
||||
function! s:prototype.split(...) dict
|
||||
function! s:prototype.split(...)
|
||||
call add(self._sections, ['|', a:0 ? a:1 : '%='])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section_spaced(group, contents) dict
|
||||
let spc = empty(a:contents) ? '' : g:airline_symbols.space
|
||||
call self.add_section(a:group, spc.a:contents.spc)
|
||||
function! s:prototype.add_section_spaced(group, contents)
|
||||
call self.add_section(a:group, (g:airline_symbols.space).a:contents.(g:airline_symbols.space))
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section(group, contents) dict
|
||||
function! s:prototype.add_section(group, contents)
|
||||
call add(self._sections, [a:group, a:contents])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_raw(text) dict
|
||||
function! s:prototype.add_raw(text)
|
||||
call add(self._sections, ['', a:text])
|
||||
endfunction
|
||||
|
||||
@@ -47,39 +31,18 @@ function! s:get_prev_group(sections, i)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build() dict
|
||||
function! s:prototype.build()
|
||||
let side = 1
|
||||
let line = ''
|
||||
let i = 0
|
||||
let length = len(self._sections)
|
||||
let split = 0
|
||||
let is_empty = 0
|
||||
let prev_group = ''
|
||||
|
||||
while i < length
|
||||
let section = self._sections[i]
|
||||
let group = section[0]
|
||||
let contents = section[1]
|
||||
let pgroup = prev_group
|
||||
let prev_group = s:get_prev_group(self._sections, i)
|
||||
if group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr')
|
||||
let group = 'airline_c'. self._context.bufnr
|
||||
elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr')
|
||||
let prev_group = 'airline_c'. self._context.bufnr
|
||||
endif
|
||||
if is_empty
|
||||
let prev_group = pgroup
|
||||
endif
|
||||
let is_empty = s:section_is_empty(self, contents)
|
||||
|
||||
if is_empty
|
||||
" need to fix highlighting groups, since we
|
||||
" have skipped a section, we actually need
|
||||
" the previous previous group and so the
|
||||
" seperator goes from the previous previous group
|
||||
" to the current group
|
||||
let pgroup = group
|
||||
endif
|
||||
|
||||
if group == ''
|
||||
let line .= contents
|
||||
@@ -91,24 +54,18 @@ function! s:prototype.build() dict
|
||||
if prev_group == ''
|
||||
let line .= '%#'.group.'#'
|
||||
elseif split
|
||||
if !is_empty
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
let split = 0
|
||||
else
|
||||
if !is_empty
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let contents = s:calculate_max_width(self, contents, group)
|
||||
let line .= is_empty ? '' : s:get_accented_line(self, group, contents)
|
||||
let line .= s:get_accented_line(self, group, contents)
|
||||
endif
|
||||
|
||||
let i = i + 1
|
||||
endwhile
|
||||
|
||||
if !self._context.active
|
||||
"let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '')
|
||||
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
endif
|
||||
return line
|
||||
@@ -120,7 +77,7 @@ function! s:should_change_group(group1, group2)
|
||||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if g:airline_gui_mode ==# 'gui'
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
return color1[1] != color2[1] || color1[0] != color2[0]
|
||||
else
|
||||
return color1[3] != color2[3] || color1[2] != color2[2]
|
||||
@@ -161,84 +118,6 @@ function! s:get_accented_line(self, group, contents)
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:calculate_section_width()
|
||||
if get(b:, 'airline_winwidth', 0) != winwidth(0)
|
||||
let winwidth = winwidth(0)
|
||||
for key in keys(g:section_width)
|
||||
let g:section_width[key]['width'] = float2nr(winwidth * (g:section_width[key]['pct']/100.0))
|
||||
endfor
|
||||
let b:airline_winwidth = winwidth
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:calculate_max_width(self, content, key)
|
||||
if a:self._context.active == 0 ||
|
||||
\ get(a:self._context, 'tabline', 0)
|
||||
return a:content
|
||||
endif
|
||||
call s:calculate_section_width()
|
||||
if winwidth(0) >= 100
|
||||
" only truncate sections for window width < 100
|
||||
return a:content
|
||||
endif
|
||||
let section_key = matchstr(a:key, 'airline_\zs.*')
|
||||
let width = g:section_width[section_key]['width']
|
||||
if section_key == 'c'
|
||||
" for the buffername, use a min-width
|
||||
return '%-'.(width > 50 ? 50 : width).'.('.a:content.'%)'
|
||||
else
|
||||
" the rest takes a maxwidth
|
||||
return '%-.'.width.'('.a:content.'%)'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:section_is_empty(self, content)
|
||||
let start=1
|
||||
|
||||
" do not check for inactive windows or the tabline
|
||||
if a:self._context.active == 0
|
||||
return 0
|
||||
elseif get(a:self._context, 'tabline', 0)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" only check, if airline#skip_empty_sections == 1
|
||||
if get(g:, 'airline_skip_empty_sections', 0) == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" only check, if airline#skip_empty_sections == 1
|
||||
if get(w:, 'airline_skip_empty_sections', -1) == 0
|
||||
return 0
|
||||
endif
|
||||
" assume accents sections to be never empty
|
||||
" (avoides, that on startup the mode message becomes empty)
|
||||
if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1
|
||||
return 0
|
||||
endif
|
||||
if empty(a:content)
|
||||
return 1
|
||||
endif
|
||||
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
|
||||
if empty(list)
|
||||
return 0 " no function in statusline text
|
||||
endif
|
||||
while len(list) > 0
|
||||
let expr = list[0]
|
||||
try
|
||||
" catch all exceptions, just in case
|
||||
if !empty(eval(expr))
|
||||
return 0
|
||||
endif
|
||||
catch
|
||||
return 0
|
||||
endtry
|
||||
let start += 1
|
||||
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
|
||||
endw
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! airline#builder#new(context)
|
||||
let builder = copy(s:prototype)
|
||||
let builder._context = a:context
|
||||
@@ -252,3 +131,4 @@ function! airline#builder#new(context)
|
||||
\ }, 'keep')
|
||||
return builder
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#debug#profile1()
|
||||
profile start airline-profile-switch.log
|
||||
profile func *
|
||||
|
||||
32
autoload/airline/deprecation.vim
Normal file
32
autoload/airline/deprecation.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:ext = {}
|
||||
let s:ext._theme_funcrefs = []
|
||||
|
||||
@@ -120,42 +118,17 @@ function! s:sync_active_winnr()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#load()
|
||||
let loaded_ext = []
|
||||
" non-trivial number of external plugins use eventignore=all, so we need to account for that
|
||||
autocmd CursorMoved * call <sid>sync_active_winnr()
|
||||
|
||||
if exists('g:airline_extensions')
|
||||
for ext in g:airline_extensions
|
||||
try
|
||||
call airline#extensions#{ext}#init(s:ext)
|
||||
catch /^Vim\%((\a\+)\)\=:E117/ " E117, function does not exist
|
||||
call airline#util#warning("Extension '".ext."' not installed, ignoring!")
|
||||
endtry
|
||||
endfor
|
||||
return
|
||||
endif
|
||||
|
||||
call airline#extensions#quickfix#init(s:ext)
|
||||
call add(loaded_ext, 'quickfix')
|
||||
|
||||
if get(g:, 'loaded_unite', 0)
|
||||
call airline#extensions#unite#init(s:ext)
|
||||
call add(loaded_ext, 'unite')
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_denite', 0)
|
||||
call airline#extensions#denite#init(s:ext)
|
||||
call add(loaded_ext, 'denite')
|
||||
endif
|
||||
|
||||
if exists(':NetrwSettings')
|
||||
call airline#extensions#netrw#init(s:ext)
|
||||
call add(loaded_ext, 'netrw')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#ycm#enabled', 0)
|
||||
call airline#extensions#ycm#init(s:ext)
|
||||
call add(loaded_ext, 'ycm')
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
@@ -164,46 +137,29 @@ function! airline#extensions#load()
|
||||
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
call airline#extensions#ctrlp#init(s:ext)
|
||||
call add(loaded_ext, 'ctrlp')
|
||||
endif
|
||||
|
||||
if get(g:, 'CtrlSpaceLoaded', 0)
|
||||
call airline#extensions#ctrlspace#init(s:ext)
|
||||
call add(loaded_ext, 'ctrlspace')
|
||||
endif
|
||||
|
||||
if get(g:, 'command_t_loaded', 0)
|
||||
call airline#extensions#commandt#init(s:ext)
|
||||
call add(loaded_ext, 'commandt')
|
||||
endif
|
||||
|
||||
if exists(':UndotreeToggle')
|
||||
call airline#extensions#undotree#init(s:ext)
|
||||
call add(loaded_ext, 'undotree')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#hunks#enabled', 1)
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes') || exists('g:loaded_quickfixsigns'))
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes'))
|
||||
call airline#extensions#hunks#init(s:ext)
|
||||
call add(loaded_ext, 'hunks')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#vimagit#enabled', 1)
|
||||
\ && (exists('g:loaded_magit'))
|
||||
call airline#extensions#vimagit#init(s:ext)
|
||||
call add(loaded_ext, 'vimagit')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tagbar#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
|
||||
\ && exists(':TagbarToggle')
|
||||
call airline#extensions#tagbar#init(s:ext)
|
||||
call add(loaded_ext, 'tagbar')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#csv#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1))
|
||||
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
|
||||
call airline#extensions#csv#init(s:ext)
|
||||
call add(loaded_ext, 'csv')
|
||||
endif
|
||||
|
||||
if exists(':VimShell')
|
||||
@@ -211,109 +167,56 @@ function! airline#extensions#load()
|
||||
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#branch#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
call add(loaded_ext, 'branch')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#bufferline#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
|
||||
\ && exists('*bufferline#get_status_string')
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
call add(loaded_ext, 'bufferline')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV)))
|
||||
if isdirectory($VIRTUAL_ENV) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
call add(loaded_ext, 'virtualenv')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
|
||||
call airline#extensions#eclim#init(s:ext)
|
||||
call add(loaded_ext, 'eclim')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#syntastic#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
call add(loaded_ext, 'syntastic')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#ale#enabled', 1) && exists(':ALELint'))
|
||||
call airline#extensions#ale#init(s:ext)
|
||||
call add(loaded_ext, 'ale')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
call add(loaded_ext, 'whitespace')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#neomake#enabled', 1) && exists(':Neomake'))
|
||||
call airline#extensions#neomake#init(s:ext)
|
||||
call add(loaded_ext, 'neomake')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#po#enabled', 1) && executable('msgfmt')
|
||||
call airline#extensions#po#init(s:ext)
|
||||
call add(loaded_ext, 'po')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#wordcount#enabled', 1)
|
||||
call airline#extensions#wordcount#init(s:ext)
|
||||
call add(loaded_ext, 'wordcount')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
call airline#extensions#tabline#init(s:ext)
|
||||
call add(loaded_ext, 'tabline')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline')
|
||||
call airline#extensions#tmuxline#init(s:ext)
|
||||
call add(loaded_ext, 'tmuxline')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#promptline#enabled', 1) && exists(':PromptlineSnapshot') && len(get(g:, 'airline#extensions#promptline#snapshot_file', ''))
|
||||
call airline#extensions#promptline#init(s:ext)
|
||||
call add(loaded_ext, 'promptline')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2
|
||||
call airline#extensions#nrrwrgn#init(s:ext)
|
||||
call add(loaded_ext, 'nrrwrgn')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#unicode#enabled', 1) && exists(':UnicodeTable') == 2
|
||||
call airline#extensions#unicode#init(s:ext)
|
||||
call add(loaded_ext, 'nrrwrgn')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
call add(loaded_ext, 'capslock')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#xkblayout#enabled', 1) && exists('g:XkbSwitchLib'))
|
||||
call airline#extensions#xkblayout#init(s:ext)
|
||||
call add(loaded_ext, 'xkblayout')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0))
|
||||
call airline#extensions#windowswap#init(s:ext)
|
||||
call add(loaded_ext, 'windowswap')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#obsession#enabled', 1) && exists('*ObsessionStatus'))
|
||||
call airline#extensions#obsession#init(s:ext)
|
||||
call add(loaded_ext, 'obsession')
|
||||
endif
|
||||
|
||||
runtime autoload/vimtex.vim
|
||||
if (get(g:, 'airline#extensions#vimtex#enabled', 1)) && exists('*vimtex#init')
|
||||
call airline#extensions#vimtex#init(s:ext)
|
||||
call add(loaded_ext, 'vimtex')
|
||||
endif
|
||||
|
||||
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
|
||||
@@ -325,8 +228,7 @@ function! airline#extensions#load()
|
||||
if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0
|
||||
\ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0
|
||||
let name = fnamemodify(file, ':t:r')
|
||||
if !get(g:, 'airline#extensions#'.name.'#enabled', 1) ||
|
||||
\ index(loaded_ext, name) > -1
|
||||
if !get(g:, 'airline#extensions#'.name.'#enabled', 1)
|
||||
continue
|
||||
endif
|
||||
try
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2017 Bjorn Neergaard, w0rp
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#ale#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#ale#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#ale#get(type)
|
||||
if !exists(':ALELint')
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:is_err = a:type ==# 'error'
|
||||
let l:counts = ale#statusline#Count(bufnr(''))
|
||||
let l:symbol = l:is_err ? s:error_symbol : s:warning_symbol
|
||||
|
||||
if type(l:counts) == type({}) && has_key(l:counts, 'error')
|
||||
" Use the current Dictionary format.
|
||||
let l:errors = l:counts.error + l:counts.style_error
|
||||
let l:num = l:is_err ? l:errors : l:counts.total - l:errors
|
||||
else
|
||||
" Use the old List format.
|
||||
let l:num = l:is_err ? l:counts[0] : l:counts[1]
|
||||
endif
|
||||
|
||||
if l:num == 0
|
||||
return ''
|
||||
else
|
||||
return l:symbol . l:num
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#get_warning()
|
||||
return airline#extensions#ale#get('warning')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#get_error()
|
||||
return airline#extensions#ale#get('error')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ale#init(ext)
|
||||
call airline#parts#define_function('ale_error_count', 'airline#extensions#ale#get_error')
|
||||
call airline#parts#define_function('ale_warning_count', 'airline#extensions#ale#get_warning')
|
||||
endfunction
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling et al.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:has_fugitive = exists('*fugitive#head')
|
||||
let s:has_lawrencium = exists('*lawrencium#statusline')
|
||||
let s:has_vcscommand = get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
|
||||
@@ -11,335 +9,83 @@ if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:has_async = airline#util#async
|
||||
|
||||
" s:vcs_config contains static configuration of VCSes and their status relative
|
||||
" to the active file.
|
||||
" 'branch' - The name of currently active branch. This field is empty iff it
|
||||
" has not been initialized yet or the current file is not in
|
||||
" an active branch.
|
||||
" 'untracked' - Cache of untracked files represented as a dictionary with files
|
||||
" as keys. A file has a not exists symbol set as its value if it
|
||||
" is untracked. A file is present in this dictionary iff its
|
||||
" status is considered up to date.
|
||||
" 'untracked_mark' - used as regexp to test against the output of 'cmd'
|
||||
let s:vcs_config = {
|
||||
\ 'git': {
|
||||
\ 'exe': 'git',
|
||||
\ 'cmd': 'git status --porcelain -- ',
|
||||
\ 'untracked_mark': '??',
|
||||
\ 'update_branch': 's:update_git_branch',
|
||||
\ 'exclude': '\.git',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
\ },
|
||||
\ 'mercurial': {
|
||||
\ 'exe': 'hg',
|
||||
\ 'cmd': 'hg status -u -- ',
|
||||
\ 'untracked_mark': '?',
|
||||
\ 'exclude': '\.hg',
|
||||
\ 'update_branch': 's:update_hg_branch',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Initializes b:buffer_vcs_config. b:buffer_vcs_config caches the branch and
|
||||
" untracked status of the file in the buffer. Caching those fields is necessary,
|
||||
" because s:vcs_config may be updated asynchronously and s:vcs_config fields may
|
||||
" be invalid during those updates. b:buffer_vcs_config fields are updated
|
||||
" whenever corresponding fields in s:vcs_config are updated or an inconsistency
|
||||
" is detected during update_* operation.
|
||||
"
|
||||
" b:airline_head caches the head string it is empty iff it needs to be
|
||||
" recalculated. b:airline_head is recalculated based on b:buffer_vcs_config.
|
||||
function! s:init_buffer()
|
||||
let b:buffer_vcs_config = {}
|
||||
for vcs in keys(s:vcs_config)
|
||||
let b:buffer_vcs_config[vcs] = {
|
||||
\ 'branch': '',
|
||||
\ 'untracked': '',
|
||||
\ }
|
||||
endfor
|
||||
unlet! b:airline_head
|
||||
endfunction
|
||||
|
||||
let s:head_format = get(g:, 'airline#extensions#branch#format', 0)
|
||||
if s:head_format == 1
|
||||
function! s:format_name(name)
|
||||
return fnamemodify(a:name, ':t')
|
||||
endfunction
|
||||
elseif s:head_format == 2
|
||||
function! s:format_name(name)
|
||||
return pathshorten(a:name)
|
||||
endfunction
|
||||
elseif type(s:head_format) == type('')
|
||||
function! s:format_name(name)
|
||||
return call(s:head_format, [a:name])
|
||||
endfunction
|
||||
else
|
||||
function! s:format_name(name)
|
||||
return a:name
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
|
||||
function! s:update_git_branch(path)
|
||||
if !s:has_fugitive
|
||||
let s:vcs_config['git'].branch = ''
|
||||
return
|
||||
function! s:get_git_branch(path)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
endif
|
||||
|
||||
let name = fugitive#head(7)
|
||||
if empty(name)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
let s:vcs_config['git'].branch = s:git_dirs[a:path]
|
||||
return
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
endtry
|
||||
endif
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
let s:vcs_config['git'].branch = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! s:update_hg_branch(path)
|
||||
if s:has_lawrencium
|
||||
let stl=lawrencium#statusline()
|
||||
if !empty(stl) && s:has_async
|
||||
call s:get_mq_async('LC_ALL=C hg qtop', expand('%:p'))
|
||||
endif
|
||||
if exists("s:mq") && !empty(s:mq)
|
||||
if stl is# 'default'
|
||||
" Shorten default a bit
|
||||
let stl='def'
|
||||
endif
|
||||
let stl.=' ['.s:mq.']'
|
||||
endif
|
||||
let s:vcs_config['mercurial'].branch = stl
|
||||
else
|
||||
let s:vcs_config['mercurial'].branch = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:update_branch()
|
||||
let l:path = exists("*fnamemodify") ? fnamemodify(resolve(@%), ":p:h") : expand("%:p:h")
|
||||
for vcs in keys(s:vcs_config)
|
||||
call {s:vcs_config[vcs].update_branch}(l:path)
|
||||
if b:buffer_vcs_config[vcs].branch != s:vcs_config[vcs].branch
|
||||
let b:buffer_vcs_config[vcs].branch = s:vcs_config[vcs].branch
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:update_untracked_in_buffer_config(file, vcs)
|
||||
if !has_key(s:vcs_config[a:vcs].untracked, a:file)
|
||||
return
|
||||
elseif s:vcs_config[a:vcs].untracked[a:file] != b:buffer_vcs_config[a:vcs].untracked
|
||||
let b:buffer_vcs_config[a:vcs].untracked = s:vcs_config[a:vcs].untracked[a:file]
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:update_untracked()
|
||||
let l:file = expand("%:p")
|
||||
if empty(l:file) || isdirectory(l:file)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:needs_update = 1
|
||||
for vcs in keys(s:vcs_config)
|
||||
if l:file =~ s:vcs_config[vcs].exclude
|
||||
" Skip check for files that live in the exclude directory
|
||||
let l:needs_update = 0
|
||||
endif
|
||||
if has_key(s:vcs_config[vcs].untracked, l:file)
|
||||
let l:needs_update = 0
|
||||
call s:update_untracked_in_buffer_config(l:file, vcs)
|
||||
endif
|
||||
endfor
|
||||
|
||||
if !l:needs_update
|
||||
return
|
||||
endif
|
||||
|
||||
for vcs in keys(s:vcs_config)
|
||||
let l:config = s:vcs_config[vcs]
|
||||
if s:has_async
|
||||
" Note that asynchronous update updates s:vcs_config only, and only
|
||||
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is
|
||||
" invalidated again before s:update_untracked is called, then we lose the
|
||||
" result of the previous call, i.e. the head string is not updated. It
|
||||
" doesn't happen often in practice, so we let it be.
|
||||
call s:get_vcs_untracked_async(l:config, l:file)
|
||||
else
|
||||
let output = airline#util#system(l:config.cmd . shellescape(l:file))
|
||||
if output =~? ('^' . l:config.untracked_mark)
|
||||
let l:config.untracked[l:file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
|
||||
else
|
||||
let l:config.untracked[l:file] = ''
|
||||
endif
|
||||
call s:update_untracked_in_buffer_config(l:file, vcs)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if s:has_async
|
||||
let s:jobs = {}
|
||||
|
||||
function! s:on_stdout(channel, msg) dict abort
|
||||
let self.buf .= a:msg
|
||||
endfunction
|
||||
|
||||
function! s:on_exit(channel) dict abort
|
||||
if self.buf =~? ('^' . self.config['untracked_mark'])
|
||||
let self.config.untracked[self.file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
|
||||
else
|
||||
let self.config.untracked[self.file] = ''
|
||||
endif
|
||||
" b:buffer_vcs_config will be updated on next call of update_untracked if
|
||||
" needed
|
||||
if has_key(s:jobs, self.file)
|
||||
call remove(s:jobs, self.file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_vcs_untracked_async(config, file)
|
||||
if g:airline#util#is_windows && &shell =~ 'cmd'
|
||||
let cmd = a:config['cmd'] . shellescape(a:file)
|
||||
else
|
||||
let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)]
|
||||
endif
|
||||
|
||||
let options = {'config': a:config, 'buf': '', 'file': a:file}
|
||||
if has_key(s:jobs, a:file)
|
||||
if job_status(get(s:jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:jobs, a:file)
|
||||
call remove(s:jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit', options)})
|
||||
let s:jobs[a:file] = id
|
||||
endfu
|
||||
|
||||
function! s:on_exit_mq(channel) dict abort
|
||||
if !empty(self.buf)
|
||||
if self.buf is# 'no patches applied' ||
|
||||
\ self.buf =~# "unknown command 'qtop'"
|
||||
let self.buf = ''
|
||||
elseif exists("s:mq") && s:mq isnot# self.buf
|
||||
" make sure, statusline is updated
|
||||
unlet! b:airline_head
|
||||
endif
|
||||
let s:mq = self.buf
|
||||
endif
|
||||
if has_key(s:jobs, self.file)
|
||||
call remove(s:jobs, self.file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_mq_async(cmd, file)
|
||||
if g:airline#util#is_windows && &shell =~ 'cmd'
|
||||
let cmd = a:cmd
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd]
|
||||
endif
|
||||
|
||||
let options = {'cmd': a:cmd, 'buf': '', 'file': a:file}
|
||||
if has_key(s:jobs, a:file)
|
||||
if job_status(get(s:jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:jobs, a:file)
|
||||
call remove(s:jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit_mq', options)})
|
||||
let s:jobs[a:file] = id
|
||||
endfu
|
||||
endif
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if !exists('b:buffer_vcs_config')
|
||||
call s:init_buffer()
|
||||
endif
|
||||
|
||||
call s:update_branch()
|
||||
call s:update_untracked()
|
||||
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let l:vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
|
||||
let found_fugitive_head = 0
|
||||
|
||||
let l:heads = {}
|
||||
for vcs in l:vcs_priority
|
||||
if !empty(b:buffer_vcs_config[vcs].branch)
|
||||
let l:heads[vcs] = b:buffer_vcs_config[vcs].branch
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let b:airline_head = fugitive#head(7)
|
||||
let found_fugitive_head = 1
|
||||
|
||||
if empty(b:airline_head) && !exists('b:git_dir')
|
||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
for vcs in keys(l:heads)
|
||||
if !empty(b:airline_head)
|
||||
let b:airline_head .= ' | '
|
||||
if empty(b:airline_head)
|
||||
if s:has_lawrencium
|
||||
let b:airline_head = lawrencium#statusline()
|
||||
endif
|
||||
let b:airline_head .= (len(l:heads) > 1 ? s:vcs_config[l:vcs].exe .':' : '') . s:format_name(l:heads[l:vcs])
|
||||
let b:airline_head .= b:buffer_vcs_config[vcs].untracked
|
||||
endfor
|
||||
endif
|
||||
|
||||
if empty(l:heads)
|
||||
if empty(b:airline_head)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
|
||||
let b:airline_head = get(b:VCSCommandBufferInfo, 0, '')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
|
||||
if exists("g:airline#extensions#branch#displayed_head_limit")
|
||||
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
|
||||
if len(b:airline_head) > w:displayed_head_limit - 1
|
||||
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.')
|
||||
let b:airline_head = b:airline_head[0:w:displayed_head_limit - 1].'…'
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(l:heads, 'git') && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
|
||||
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
@@ -347,7 +93,7 @@ function! airline#extensions#branch#get_head()
|
||||
endfunction
|
||||
|
||||
function! s:check_in_path()
|
||||
if !exists('b:airline_file_in_root')
|
||||
if !exists('b:airline_branch_path')
|
||||
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
||||
let bufferpath = resolve(fnamemodify(expand('%'), ':p'))
|
||||
|
||||
@@ -357,13 +103,7 @@ function! s:check_in_path()
|
||||
let root = expand(fnamemodify(root, ':h'))
|
||||
else
|
||||
" else it's the newer format, and we need to guesstimate
|
||||
" 1) check for worktrees
|
||||
if match(root, 'worktrees') > -1
|
||||
" worktree can be anywhere, so simply assume true here
|
||||
return 1
|
||||
endif
|
||||
" 2) check for submodules
|
||||
let pattern = '\.git[\\/]\(modules\)[\\/]'
|
||||
let pattern = '\.git\(\\\|\/\)modules\(\\\|\/\)'
|
||||
if match(root, pattern) >= 0
|
||||
let root = substitute(root, pattern, '', '')
|
||||
endif
|
||||
@@ -375,35 +115,9 @@ function! s:check_in_path()
|
||||
return b:airline_file_in_root
|
||||
endfunction
|
||||
|
||||
function! s:reset_untracked_cache(shellcmdpost)
|
||||
" shellcmdpost - whether function was called as a result of ShellCmdPost hook
|
||||
if !s:has_async && !has('nvim')
|
||||
if a:shellcmdpost
|
||||
" Clear cache only if there was no error or the script uses an
|
||||
" asynchronous interface. Otherwise, cache clearing would overwrite
|
||||
" v:shell_error with a system() call inside get_*_untracked.
|
||||
if v:shell_error
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:file = expand("%:p")
|
||||
for vcs in keys(s:vcs_config)
|
||||
" Dump the value of the cache for the current file. Partially mitigates the
|
||||
" issue of cache invalidation happening before a call to
|
||||
" s:update_untracked()
|
||||
call s:update_untracked_in_buffer_config(l:file, l:vcs)
|
||||
let s:vcs_config[vcs].untracked = {}
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
|
||||
|
||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
||||
autocmd BufWritePost * call s:reset_untracked_cache(0)
|
||||
autocmd ShellCmdPost * call s:reset_untracked_cache(1)
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*bufferline#get_status_string')
|
||||
finish
|
||||
endif
|
||||
@@ -20,10 +18,6 @@ function! airline#extensions#bufferline#init(ext)
|
||||
let g:bufferline_separator = g:airline_symbols.space
|
||||
endif
|
||||
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
" if 'acd' is set, vim-airline uses the path section, so we need ot redefine this here as well
|
||||
call airline#parts#define_raw('path', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
else
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
endif
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
" MIT License. Copyright (c) 2014 Mathias Andersson.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*CapsLockStatusline')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#capslock#status()
|
||||
return tolower(CapsLockStatusline()) == '[caps]' ? 'CAPS' : ''
|
||||
return CapsLockStatusline() == '[caps]' ? 'CAPS' : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#capslock#init(ext)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'command_t_loaded', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_csv', 0) && !exists(':Table')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:padding = s:spc . s:spc . s:spc
|
||||
|
||||
function! airline#extensions#ctrlspace#statusline(...)
|
||||
let b = airline#builder#new({ 'active': 1 })
|
||||
call b.add_section('airline_b', '⌗' . s:padding . ctrlspace#api#StatuslineModeSegment(s:padding))
|
||||
call b.split()
|
||||
call b.add_section('airline_x', s:spc . ctrlspace#api#StatuslineTabSegment() . s:spc)
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlspace#init(ext)
|
||||
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
|
||||
endfunction
|
||||
@@ -1,20 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_groupitems', 1)
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning', 'error' ]
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
@@ -24,9 +19,6 @@ function! s:get_section(winnr, key, ...)
|
||||
endif
|
||||
endif
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_{a:key}')
|
||||
return ''
|
||||
endif
|
||||
let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
|
||||
let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
|
||||
return empty(text) ? '' : prefix.text.suffix
|
||||
@@ -34,42 +26,30 @@ endfunction
|
||||
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if (key == 'warning' || key == 'error') && !a:context.active
|
||||
if key == 'warning' && !a:context.active
|
||||
continue
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" There still is a highlighting bug when using groups %(%) in the statusline,
|
||||
" deactivate it, unless it is fixed (7.4.1511)
|
||||
if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch81')))
|
||||
function! s:add_section(builder, context, key)
|
||||
let condition = (a:key is# "warning" || a:key is# "error") &&
|
||||
\ (v:version == 704 && !has("patch1511"))
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
if condition
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if condition
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function! s:add_section(builder, context, key)
|
||||
if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
|
||||
return
|
||||
endif
|
||||
function s:add_section(builder, context, key)
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%#airline_warning#'.s:get_section(a:context.winnr, a:key))
|
||||
elseif a:key == 'error'
|
||||
call a:builder.add_raw('%#airline_error#'.s:get_section(a:context.winnr, a:key))
|
||||
else
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
endif
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
" MIT License. Copyright (c) 2017 Thomas Dy
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_denite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
" Denite does not use vim's built-in modal editing but has a custom prompt
|
||||
" that implements its own insert/normal mode so we have to handle changing the
|
||||
" highlight
|
||||
function! airline#extensions#denite#check_denite_mode(bufnr)
|
||||
let l:mode = split(denite#get_status_mode(), ' ')
|
||||
let l:mode = tolower(l:mode[1])
|
||||
if !exists('b:denite_mode_cache') || l:mode != b:denite_mode_cache
|
||||
call airline#highlighter#highlight([l:mode], a:bufnr)
|
||||
let b:denite_mode_cache = l:mode
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#denite#apply(...)
|
||||
if &ft == 'denite'
|
||||
let w:airline_skip_empty_sections = 0
|
||||
call a:1.add_section('airline_a', ' Denite %{airline#extensions#denite#check_denite_mode('.a:2['bufnr'].')}')
|
||||
call a:1.add_section('airline_c', ' %{denite#get_status_sources()}')
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', ' %{denite#get_status_path()} ')
|
||||
call a:1.add_section('airline_z', ' %{denite#get_status_linenr()} ')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#denite#init(ext)
|
||||
call denite#custom#option('_', 'statusline', 0)
|
||||
call a:ext.add_statusline_func('airline#extensions#denite#apply')
|
||||
|
||||
" airline#extensions#denite#apply normally gets called only after the
|
||||
" denite window gets closed, so we have to call airline#update_statusline
|
||||
" ourselves to make sure it's applied when the window is opened.
|
||||
augroup airline_denite
|
||||
autocmd!
|
||||
autocmd FileType denite call airline#update_statusline()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':ProjectCreate')
|
||||
finish
|
||||
endif
|
||||
@@ -18,13 +16,7 @@ function! airline#extensions#eclim#creat_line(...)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#get_warnings()
|
||||
" Cache vavlues, so that it isn't called too often
|
||||
if exists("s:eclim_errors") &&
|
||||
\ get(b:, 'airline_changenr', 0) == changenr()
|
||||
return s:eclim_errors
|
||||
endif
|
||||
let eclimList = eclim#display#signs#GetExisting()
|
||||
let s:eclim_errors = ''
|
||||
|
||||
if !empty(eclimList)
|
||||
" Remove any non-eclim signs (see eclim#display#signs#Update)
|
||||
@@ -47,12 +39,11 @@ function! airline#extensions#eclim#get_warnings()
|
||||
let errorsNumber = len(eclimList)
|
||||
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
|
||||
let s:eclim_errors = errors.(g:airline_symbols.space)
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let b:airline_changenr = changenr()
|
||||
return s:eclim_errors
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#init(ext)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" we don't actually want this loaded :P
|
||||
finish
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0) && !get(g:, 'loaded_quickfixsigns', 0)
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -46,51 +44,39 @@ function! s:get_hunks_empty()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
let s:source_func = ''
|
||||
function! s:get_hunks()
|
||||
if !exists('b:source_func') || get(b:, 'source_func', '') is# 's:get_hunks_empty'
|
||||
if get(g:, 'loaded_signify') && sy#buffer_is_active()
|
||||
let b:source_func = 's:get_hunks_signify'
|
||||
if empty(s:source_func)
|
||||
if get(g:, 'loaded_signify', 0)
|
||||
let s:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
let b:source_func = 's:get_hunks_gitgutter'
|
||||
let s:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let b:source_func = 's:get_hunks_changes'
|
||||
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
|
||||
let b:source_func = 'quickfixsigns#vcsdiff#GetHunkSummary'
|
||||
let s:source_func = 's:get_hunks_changes'
|
||||
else
|
||||
let b:source_func = 's:get_hunks_empty'
|
||||
let s:source_func = 's:get_hunks_empty'
|
||||
endif
|
||||
endif
|
||||
return {b:source_func}()
|
||||
return {s:source_func}()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#get_hunks()
|
||||
if !get(w:, 'airline_active', 0)
|
||||
return ''
|
||||
endif
|
||||
" Cache vavlues, so that it isn't called too often
|
||||
if exists("b:airline_hunks") &&
|
||||
\ get(b:, 'airline_changenr', 0) == changenr() &&
|
||||
\ winwidth(0) == get(s:, 'airline_winwidth', 0) &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_signify' &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_gitgutter' &&
|
||||
\ get(b:, 'source_func', '') isnot# 's:get_hunks_empty'
|
||||
return b:airline_hunks
|
||||
endif
|
||||
let hunks = s:get_hunks()
|
||||
let string = ''
|
||||
if !empty(hunks)
|
||||
for i in [0, 1, 2]
|
||||
if (s:non_zero_only == 0 && winwidth(0) > 100) || hunks[i] > 0
|
||||
if s:non_zero_only == 0 || hunks[i] > 0
|
||||
let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let b:airline_hunks = string
|
||||
let b:airline_changenr = changenr()
|
||||
let s:airline_winwidth = winwidth(0)
|
||||
return string
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#init(ext)
|
||||
call airline#parts#define_function('hunks', 'airline#extensions#hunks#get_hunks')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':Neomake')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#neomake#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#neomake#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#neomake#get_warnings()
|
||||
let counts = neomake#statusline#LoclistCounts()
|
||||
let warnings = get(counts, 'W', 0)
|
||||
return warnings ? s:warning_symbol.warnings : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#get_errors()
|
||||
let counts = neomake#statusline#LoclistCounts()
|
||||
let errors = get(counts, 'E', 0)
|
||||
return errors ? s:error_symbol.errors : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#init(ext)
|
||||
call airline#parts#define_function('neomake_warning_count', 'airline#extensions#neomake#get_warnings')
|
||||
call airline#parts#define_function('neomake_error_count', 'airline#extensions#neomake#get_errors')
|
||||
endfunction
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':NetrwSettings')
|
||||
finish
|
||||
endif
|
||||
@@ -29,6 +27,6 @@ endfunction
|
||||
|
||||
|
||||
function! airline#extensions#netrw#sortstring()
|
||||
let order = (get(g:, 'netrw_sort_direction', 'n') =~ 'n') ? '+' : '-'
|
||||
let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-'
|
||||
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
finish
|
||||
endif
|
||||
@@ -41,8 +39,7 @@ function! airline#extensions#nrrwrgn#apply(...)
|
||||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range,
|
||||
\ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!'))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('*ObsessionStatus')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
if !exists('g:airline#extensions#obsession#indicator_text')
|
||||
let g:airline#extensions#obsession#indicator_text = '$'
|
||||
endif
|
||||
|
||||
function! airline#extensions#obsession#init(ext)
|
||||
call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#obsession#get_status()
|
||||
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '')
|
||||
endfunction
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:has_async = airline#util#async
|
||||
|
||||
function! s:shorten()
|
||||
if exists("g:airline#extensions#po#displayed_limit")
|
||||
let w:displayed_po_limit = g:airline#extensions#po#displayed_limit
|
||||
if len(b:airline_po_stats) > w:displayed_po_limit - 1
|
||||
let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 2)].(&encoding==?'utf-8' ? '…' : '.'). ']'
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
if s:has_async
|
||||
let s:jobs = {}
|
||||
|
||||
function! s:on_stdout(channel, msg) dict abort
|
||||
let self.buf = a:msg
|
||||
endfunction
|
||||
|
||||
function! s:on_exit(channel) dict abort
|
||||
if !empty(self.buf)
|
||||
let b:airline_po_stats = printf("[%s]", self.buf)
|
||||
else
|
||||
let b:airline_po_stats = ''
|
||||
endif
|
||||
if has_key(s:jobs, self.file)
|
||||
call remove(s:jobs, self.file)
|
||||
endif
|
||||
call s:shorten()
|
||||
endfunction
|
||||
|
||||
function! s:get_msgfmt_stat_async(cmd, file)
|
||||
if g:airline#util#is_windows || !executable('msgfmt')
|
||||
" no msgfmt on windows?
|
||||
return
|
||||
else
|
||||
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
|
||||
endif
|
||||
|
||||
let options = {'buf': '', 'file': a:file}
|
||||
if has_key(s:jobs, a:file)
|
||||
if job_status(get(s:jobs, a:file)) == 'run'
|
||||
return
|
||||
elseif has_key(s:jobs, a:file)
|
||||
call remove(s:jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
let id = job_start(cmd, {
|
||||
\ 'err_io': 'out',
|
||||
\ 'out_cb': function('s:on_stdout', options),
|
||||
\ 'close_cb': function('s:on_exit', options)})
|
||||
let s:jobs[a:file] = id
|
||||
endfu
|
||||
endif
|
||||
|
||||
function! airline#extensions#po#apply(...)
|
||||
if &ft ==# 'po'
|
||||
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}')
|
||||
autocmd airline BufWritePost * unlet! b:airline_po_stats
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#stats()
|
||||
if exists('b:airline_po_stats') && !empty(b:airline_po_stats)
|
||||
return b:airline_po_stats
|
||||
endif
|
||||
|
||||
let cmd = 'msgfmt --statistics -o /dev/null -- '
|
||||
if s:has_async
|
||||
call s:get_msgfmt_stat_async(cmd, expand('%:p'))
|
||||
else
|
||||
let airline_po_stats = system(cmd. shellescape(expand('%:p')))
|
||||
if v:shell_error
|
||||
return ''
|
||||
endif
|
||||
try
|
||||
let b:airline_po_stats = '['. split(airline_po_stats, '\n')[0]. ']'
|
||||
let b:airline_po_stats = substitute(b:airline_po_stats, ' \(message\|translation\)s*\.*', '', 'g')
|
||||
catch
|
||||
let b:airline_po_stats = ''
|
||||
endtry
|
||||
call s:shorten()
|
||||
endif
|
||||
return get(b:, 'airline_po_stats', '')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#po#apply')
|
||||
endfunction
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':PromptlineSnapshot')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
|
||||
@@ -17,24 +15,9 @@ endfunction
|
||||
|
||||
function! airline#extensions#quickfix#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#quickfix#apply')
|
||||
call a:ext.add_inactive_statusline_func('airline#extensions#quickfix#inactive_qf_window')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#quickfix#inactive_qf_window(...)
|
||||
if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', ''))
|
||||
call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_text()
|
||||
if exists("*win_getid") && exists("*getwininfo")
|
||||
let dict = getwininfo(win_getid())
|
||||
if len(dict) > 0 && get(dict[0], 'quickfix', 0) && !get(dict[0], 'loclist', 0)
|
||||
return g:airline#extensions#quickfix#quickfix_text
|
||||
elseif len(dict) > 0 && get(dict[0], 'quickfix', 0) && get(dict[0], 'loclist', 0)
|
||||
return g:airline#extensions#quickfix#location_text
|
||||
endif
|
||||
endif
|
||||
redir => buffers
|
||||
silent ls
|
||||
redir END
|
||||
@@ -51,3 +34,4 @@ function! s:get_text()
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,43 +1,19 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':SyntasticCheck')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:error_symbol = get(g:, 'airline#extensions#syntastic#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#syntastic#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#syntastic#get_warning()
|
||||
return airline#extensions#syntastic#get('warning')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#get_error()
|
||||
return airline#extensions#syntastic#get('error')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#get(type)
|
||||
let _backup = get(g:, 'syntastic_stl_format', '')
|
||||
let is_err = (a:type is# 'error')
|
||||
if is_err
|
||||
let g:syntastic_stl_format = '%E{%e}'
|
||||
else
|
||||
let g:syntastic_stl_format = '%W{%w}'
|
||||
endif
|
||||
let cnt = SyntasticStatuslineFlag()
|
||||
if !empty(_backup)
|
||||
let g:syntastic_stl_format = _backup
|
||||
endif
|
||||
if cnt == 0
|
||||
return ''
|
||||
else
|
||||
return (is_err ? s:error_symbol : s:warning_symbol).cnt
|
||||
function! airline#extensions#syntastic#get_warnings()
|
||||
let errors = SyntasticStatuslineFlag()
|
||||
if strlen(errors) > 0
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call airline#parts#define_function('syntastic-warn', 'airline#extensions#syntastic#get_warning')
|
||||
call airline#parts#define_function('syntastic-err', 'airline#extensions#syntastic#get_error')
|
||||
call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
let s:ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree')
|
||||
|
||||
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
|
||||
if s:taboo
|
||||
let g:taboo_tabline = 0
|
||||
endif
|
||||
|
||||
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('gui_running')
|
||||
@@ -31,54 +21,31 @@ function! s:toggle_off()
|
||||
call airline#extensions#tabline#autoshow#off()
|
||||
call airline#extensions#tabline#tabs#off()
|
||||
call airline#extensions#tabline#buffers#off()
|
||||
call airline#extensions#tabline#ctrlspace#off()
|
||||
endfunction
|
||||
|
||||
function! s:toggle_on()
|
||||
call airline#extensions#tabline#autoshow#on()
|
||||
call airline#extensions#tabline#tabs#on()
|
||||
call airline#extensions#tabline#buffers#on()
|
||||
call airline#extensions#tabline#ctrlspace#on()
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
endfunction
|
||||
|
||||
function! s:update_tabline()
|
||||
if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
|
||||
return
|
||||
endif
|
||||
let match = expand('<afile>')
|
||||
if pumvisible()
|
||||
return
|
||||
elseif !get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
return
|
||||
" return, if buffer matches ignore pattern or is directory (netrw)
|
||||
elseif empty(match)
|
||||
\ || match(match, s:ignore_bufadd_pat) > -1
|
||||
\ || isdirectory(expand("<afile>"))
|
||||
return
|
||||
endif
|
||||
doautocmd User BufMRUChange
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let colors = get(a:palette, 'tabline', {})
|
||||
" Theme for tabs on the left
|
||||
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
|
||||
endif
|
||||
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
call airline#highlighter#exec('airline_tab', l:tab)
|
||||
call airline#highlighter#exec('airline_tabsel', l:tabsel)
|
||||
call airline#highlighter#exec('airline_tabtype', l:tabtype)
|
||||
@@ -86,23 +53,6 @@ function! airline#extensions#tabline#load_theme(palette)
|
||||
call airline#highlighter#exec('airline_tabmod', l:tabmod)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
|
||||
call airline#highlighter#exec('airline_tabhid', l:tabhid)
|
||||
|
||||
" Theme for tabs on the right
|
||||
let l:tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
|
||||
let l:tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
|
||||
let l:tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
|
||||
let l:tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
|
||||
endif
|
||||
call airline#highlighter#exec('airline_tab_right', l:tab_right)
|
||||
call airline#highlighter#exec('airline_tabsel_right', l:tabsel_right)
|
||||
call airline#highlighter#exec('airline_tabmod_right', l:tabmod_right)
|
||||
call airline#highlighter#exec('airline_tabhid_right', l:tabhid_right)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel_right', l:tabmodu_right)
|
||||
endfunction
|
||||
|
||||
let s:current_tabcnt = -1
|
||||
@@ -112,15 +62,9 @@ function! airline#extensions#tabline#get()
|
||||
let s:current_tabcnt = curtabcnt
|
||||
call airline#extensions#tabline#tabs#invalidate()
|
||||
call airline#extensions#tabline#buffers#invalidate()
|
||||
call airline#extensions#tabline#ctrlspace#invalidate()
|
||||
endif
|
||||
|
||||
if !exists('#airline#BufAdd#*')
|
||||
autocmd airline BufAdd * call <sid>update_tabline()
|
||||
endif
|
||||
if s:ctrlspace
|
||||
return airline#extensions#tabline#ctrlspace#get()
|
||||
elseif s:show_buffers && curtabcnt == 1 || !s:show_tabs
|
||||
if s:show_buffers && curtabcnt == 1 || !s:show_tabs
|
||||
return airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
return airline#extensions#tabline#tabs#get()
|
||||
@@ -128,36 +72,18 @@ function! airline#extensions#tabline#get()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#title(n)
|
||||
let title = ''
|
||||
if s:taboo
|
||||
let title = TabooTabTitle(a:n)
|
||||
endif
|
||||
|
||||
if empty(title) && exists('*gettabvar')
|
||||
let title = gettabvar(a:n, 'title')
|
||||
endif
|
||||
|
||||
if empty(title)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
let all_buffers = airline#extensions#tabline#buflist#list()
|
||||
return airline#extensions#tabline#get_buffer_name(
|
||||
\ buflist[winnr - 1],
|
||||
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
||||
endif
|
||||
|
||||
return title
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
return airline#extensions#tabline#get_buffer_name(buflist[winnr - 1])
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get_buffer_name(nr, ...)
|
||||
let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list()
|
||||
return airline#extensions#tabline#formatters#{s:formatter}#format(a:nr, buffers)
|
||||
function! airline#extensions#tabline#get_buffer_name(nr)
|
||||
return airline#extensions#tabline#formatters#{s:formatter}#format(a:nr, airline#extensions#tabline#buflist#list())
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#new_builder()
|
||||
let builder_context = {
|
||||
\ 'active' : 1,
|
||||
\ 'tabline' : 1,
|
||||
\ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep),
|
||||
\ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep),
|
||||
\ }
|
||||
@@ -171,23 +97,3 @@ function! airline#extensions#tabline#new_builder()
|
||||
|
||||
return airline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
|
||||
let cur = bufnr('%')
|
||||
if cur == a:bufnr
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(a:tab_bufs, a:bufnr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
return group
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
|
||||
let s:tab_min_count = get(g:, 'airline#extensions#tabline#tab_min_count', 0)
|
||||
@@ -24,9 +22,7 @@ function! airline#extensions#tabline#autoshow#on()
|
||||
augroup airline_tabline_autoshow
|
||||
autocmd!
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
if &lines > 3
|
||||
set showtabline=2
|
||||
endif
|
||||
set showtabline=2
|
||||
else
|
||||
if s:show_buffers == 1
|
||||
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()))
|
||||
@@ -38,13 +34,13 @@ function! airline#extensions#tabline#autoshow#on()
|
||||
|
||||
" Invalidate cache. This has to come after the BufUnload for
|
||||
" s:show_buffers, to invalidate the cache for BufEnter.
|
||||
autocmd BufLeave,BufAdd,BufUnload * call airline#extensions#tabline#buflist#invalidate()
|
||||
autocmd BufAdd,BufUnload * call airline#extensions#tabline#buflist#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:show_tabline(min_count, total_count)
|
||||
if a:total_count >= a:min_count
|
||||
if &showtabline != 2 && &lines > 3
|
||||
if &showtabline != 2
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:buffer_idx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
@@ -13,7 +11,8 @@ let s:current_modified = 0
|
||||
let s:current_tabline = ''
|
||||
let s:current_visible_buffers = []
|
||||
|
||||
let s:number_map = {
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? {
|
||||
\ '0': '⁰',
|
||||
\ '1': '¹',
|
||||
\ '2': '²',
|
||||
@@ -25,8 +24,6 @@ let s:number_map = {
|
||||
\ '8': '⁸',
|
||||
\ '9': '⁹'
|
||||
\ }
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? get(g:, 'airline#extensions#tabline#buffer_idx_format', s:number_map)
|
||||
\ : {}
|
||||
|
||||
function! airline#extensions#tabline#buffers#off()
|
||||
@@ -39,9 +36,11 @@ function! airline#extensions#tabline#buffers#on()
|
||||
augroup airline_tabline_buffers
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#buffers#invalidate()
|
||||
autocmd User BufMRUChange call airline#extensions#tabline#buflist#invalidate()
|
||||
autocmd User BufMRUChange call airline#extensions#tabline#buffers#invalidate()
|
||||
augroup END
|
||||
|
||||
if s:buffer_idx_mode
|
||||
call s:define_buffer_idx_mode_mappings()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#invalidate()
|
||||
@@ -49,7 +48,6 @@ function! airline#extensions#tabline#buffers#invalidate()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#get()
|
||||
call <sid>map_keys()
|
||||
let cur = bufnr('%')
|
||||
if cur == s:current_bufnr
|
||||
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
||||
@@ -66,16 +64,23 @@ function! airline#extensions#tabline#buffers#get()
|
||||
continue
|
||||
endif
|
||||
|
||||
let group = airline#extensions#tabline#group_of_bufnr(tab_bufs, nr)
|
||||
|
||||
if nr == cur
|
||||
if cur == nr
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(tab_bufs, nr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Neovim feature: Have clickable buffers
|
||||
if has("tablineat")
|
||||
call b.add_raw('%'.nr.'@airline#extensions#tabline#buffers#clickbuf@')
|
||||
endif
|
||||
if s:buffer_idx_mode
|
||||
if len(s:number_map) > 0
|
||||
call b.add_section(group, s:spc . get(s:number_map, l:index, '') . '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)' . s:spc)
|
||||
@@ -86,20 +91,12 @@ function! airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endif
|
||||
if has("tablineat")
|
||||
call b.add_raw('%X')
|
||||
endif
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
if s:show_tab_type
|
||||
call b.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
endif
|
||||
if tabpagenr('$') > 1
|
||||
call b.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||
endif
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
|
||||
let s:current_bufnr = cur
|
||||
let s:current_tabline = b.build()
|
||||
@@ -176,76 +173,14 @@ function! s:select_tab(buf_index)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:jump_to_tab(offset)
|
||||
let l = s:current_visible_buffers
|
||||
let i = index(l, bufnr('%'))
|
||||
if i > -1
|
||||
exec 'b!' . l[float2nr(fmod(i + a:offset, len(l)))]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:map_keys()
|
||||
if s:buffer_idx_mode
|
||||
noremap <silent> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
|
||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, modifiers) abort
|
||||
" Clickable buffers
|
||||
" works only in recent NeoVim with has('tablineat')
|
||||
|
||||
" single mouse button click without modifiers pressed
|
||||
if a:clicks == 1 && a:modifiers !~# '[^ ]'
|
||||
if a:button is# 'l'
|
||||
" left button - switch to buffer
|
||||
silent execute 'buffer' a:minwid
|
||||
elseif a:button is# 'm'
|
||||
" middle button - delete buffer
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#middle_click_preserves_windows', 0) == 0
|
||||
" just simply delete the clicked buffer. This will cause windows
|
||||
" associated with the clicked buffer to be closed.
|
||||
silent execute 'bdelete' a:minwid
|
||||
else
|
||||
" find windows displaying the clicked buffer and open an new
|
||||
" buffer in them.
|
||||
let current_window = bufwinnr("%")
|
||||
let window_number = bufwinnr(a:minwid)
|
||||
let last_window_visited = -1
|
||||
|
||||
" Set to 1 if the clicked buffer was open in any windows.
|
||||
let buffer_in_window = 0
|
||||
|
||||
" Find the next window with the clicked buffer open. If bufwinnr()
|
||||
" returns the same window number, this is because we clicked a new
|
||||
" buffer, and then tried editing a new buffer. Vim won't create a
|
||||
" new empty buffer for the same window, so we get the same window
|
||||
" number from bufwinnr(). In this case we just give up and don't
|
||||
" delete the buffer.
|
||||
" This could be made cleaner if we could check if the clicked buffer
|
||||
" is a new buffer, but I don't know if there is a way to do that.
|
||||
while window_number != -1 && window_number != last_window_visited
|
||||
let buffer_in_window = 1
|
||||
silent execute window_number . 'wincmd w'
|
||||
silent execute 'enew'
|
||||
let last_window_visited = window_number
|
||||
let window_number = bufwinnr(a:minwid)
|
||||
endwhile
|
||||
silent execute current_window . 'wincmd w'
|
||||
if window_number != last_window_visited || buffer_in_window == 0
|
||||
silent execute 'bdelete' a:minwid
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
function! s:define_buffer_idx_mode_mappings()
|
||||
noremap! <unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||
noremap! <unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||
endfunction
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let s:buffers = {}
|
||||
|
||||
for nr in range(1, bufnr('$'))
|
||||
let s:buffers[nr] = 1
|
||||
endfor
|
||||
|
||||
autocmd BufAdd * let s:buffers[expand('<abuf>')] = 1
|
||||
autocmd BufDelete * let nr = expand('<abuf>') | if has_key(s:buffers, nr) | unlet s:buffers[nr] | endif
|
||||
|
||||
function! airline#extensions#tabline#buflist#invalidate()
|
||||
unlet! s:current_buffer_list
|
||||
@@ -12,29 +20,23 @@ function! airline#extensions#tabline#buflist#list()
|
||||
return s:current_buffer_list
|
||||
endif
|
||||
|
||||
let excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
|
||||
|
||||
let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$"))
|
||||
|
||||
let buffers = []
|
||||
" If this is too slow, we can switch to a different algorithm.
|
||||
" Basically branch 535 already does it, but since it relies on
|
||||
" BufAdd autocommand, I'd like to avoid this if possible.
|
||||
for nr in list
|
||||
if buflisted(nr)
|
||||
" Do not add to the bufferlist, if either
|
||||
" 1) buffername matches exclude pattern
|
||||
" 2) buffer is a quickfix buffer
|
||||
" 3) exclude preview windows (if 'bufhidden' == wipe
|
||||
" and 'buftype' == nofile
|
||||
if (!empty(excludes) && match(bufname(nr), join(excludes, '\|')) > -1) ||
|
||||
\ (getbufvar(nr, 'current_syntax') == 'qf') ||
|
||||
\ (exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe'
|
||||
\ && getbufvar(nr, '&buftype') == 'nofile')
|
||||
continue
|
||||
for key in keys(s:buffers)
|
||||
let nr = str2nr(key)
|
||||
if buflisted(nr) && bufexists(nr)
|
||||
let toadd = 1
|
||||
for ex in s:excludes
|
||||
if match(bufname(nr), ex) >= 0
|
||||
let toadd = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if getbufvar(nr, 'current_syntax') == 'qf'
|
||||
let toadd = 0
|
||||
endif
|
||||
if toadd
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
" MIT License. Copyright (c) 2016 Kevin Sapper
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_tabline = ''
|
||||
|
||||
let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:switch_buffers_and_tabs = get(g:, 'airline#extensions#tabline#switch_buffers_and_tabs', 0)
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#off()
|
||||
augroup airline_tabline_ctrlspace
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#on()
|
||||
augroup airline_tabline_ctrlspace
|
||||
autocmd!
|
||||
autocmd BufDelete * call airline#extensions#tabline#ctrlspace#invalidate()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#invalidate()
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
let s:buffer_list = ctrlspace#api#BufferList(a:cur_tab)
|
||||
for buffer in s:buffer_list
|
||||
if a:cur_buf == buffer.index
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
elseif buffer.visible
|
||||
let group = 'airline_tab'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
|
||||
|
||||
if has("tablineat")
|
||||
let buf_name = '%'.buffer.index.'@airline#extensions#tabline#buffers#clickbuf@'.buf_name.'%X'
|
||||
endif
|
||||
|
||||
call a:builder.add_section_spaced(group, buf_name)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
call a:builder.add_section_spaced(group, '%'.tab.index.'T'.tab.title.ctrlspace#api#TabBuffersNumber(tab.index).'%T')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#get()
|
||||
let cur_buf = bufnr('%')
|
||||
|
||||
call airline#extensions#tabline#tabs#map_keys()
|
||||
let s:tab_list = ctrlspace#api#TabList()
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
let cur_tab = tab.index
|
||||
endif
|
||||
endfor
|
||||
|
||||
if cur_buf == s:current_bufnr && cur_tab == s:current_tabnr
|
||||
return s:current_tabline
|
||||
endif
|
||||
|
||||
let builder = airline#extensions#tabline#new_builder()
|
||||
|
||||
" Add left tabline content
|
||||
if s:show_buffers == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
elseif s:show_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
endif
|
||||
endif
|
||||
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
call builder.split()
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
|
||||
" Add right tabline content
|
||||
if s:show_buffers == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
elseif s:show_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
else
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur_buf
|
||||
let s:current_tabnr = cur_tab
|
||||
let s:current_tabline = builder.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
@@ -1,16 +1,13 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
|
||||
let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
|
||||
let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
|
||||
let s:buf_modified_symbol = g:airline_symbols.modified
|
||||
|
||||
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
let _ = ''
|
||||
|
||||
let name = bufname(a:bufnr)
|
||||
@@ -18,12 +15,9 @@ function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
|
||||
let _ .= '[No Name]'
|
||||
else
|
||||
if s:fnamecollapse
|
||||
let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
else
|
||||
let _ .= fnamemodify(name, fmod)
|
||||
endif
|
||||
if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate
|
||||
let _ = strpart(_, 0, s:fnametruncate)
|
||||
let _ .= fnamemodify(name, s:fmod)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffers)
|
||||
let duplicates = {}
|
||||
let tails = {}
|
||||
@@ -12,7 +10,7 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer
|
||||
if empty(name)
|
||||
let map[nr] = '[No Name]'
|
||||
else
|
||||
let tail = fnamemodify(name, ':s?/\+$??:t')
|
||||
let tail = fnamemodify(name, ':t')
|
||||
if has_key(tails, tail)
|
||||
let duplicates[nr] = nr
|
||||
endif
|
||||
@@ -25,10 +23,5 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer
|
||||
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.'))
|
||||
endfor
|
||||
|
||||
if has_key(map, a:bufnr)
|
||||
return map[a:bufnr]
|
||||
endif
|
||||
|
||||
" if we get here, the buffer list isn't in sync with the selected buffer yet, fall back to the default
|
||||
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers)
|
||||
return map[a:bufnr]
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:show_splits = get(g:, 'airline#extensions#tabline#show_splits', 1)
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
@@ -36,7 +31,6 @@ endfunction
|
||||
function! airline#extensions#tabline#tabs#get()
|
||||
let curbuf = bufnr('%')
|
||||
let curtab = tabpagenr()
|
||||
call airline#extensions#tabline#tabs#map_keys()
|
||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
||||
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
@@ -44,7 +38,6 @@ function! airline#extensions#tabline#tabs#get()
|
||||
endif
|
||||
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == curtab
|
||||
let group = 'airline_tabsel'
|
||||
@@ -62,32 +55,22 @@ function! airline#extensions#tabline#tabs#get()
|
||||
let val = '%('
|
||||
if s:show_tab_nr
|
||||
if s:tab_nr_type == 0
|
||||
let val .= (g:airline_symbols.space).'%{len(tabpagebuflist('.i.'))}'
|
||||
elseif s:tab_nr_type == 1
|
||||
let val .= ' %{len(tabpagebuflist('.i.'))}'
|
||||
else
|
||||
let val .= (g:airline_symbols.space).i
|
||||
else "== 2
|
||||
let val .= (g:airline_symbols.space).i.'.%{len(tabpagebuflist('.i.'))}'
|
||||
endif
|
||||
endif
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
|
||||
call b.add_raw('%T')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
if s:show_close_button
|
||||
call b.add_section('airline_tab_right', ' %999X'.s:close_symbol.' ')
|
||||
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
|
||||
endif
|
||||
|
||||
if s:show_splits == 1
|
||||
let buffers = tabpagebuflist(curtab)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right"
|
||||
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
|
||||
endfor
|
||||
elseif s:show_tab_type == 1
|
||||
call b.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' tabs ')
|
||||
endif
|
||||
|
||||
let s:current_bufnr = curbuf
|
||||
@@ -95,18 +78,3 @@ function! airline#extensions#tabline#tabs#get()
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#tabs#map_keys()
|
||||
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab4 :4tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab5 :5tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab6 :6tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab7 :7tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab8 :8tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectTab9 :9tabn<CR>
|
||||
noremap <silent> <Plug>AirlineSelectPrevTab gT
|
||||
" tabn {count} goes to count tab does not go {count} tab pages forward!
|
||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
|
||||
endfunction
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':TagbarToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':Tmuxline')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':UndotreeToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_unicodePlugin', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#unicode#apply(...)
|
||||
if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable'
|
||||
call airline#parts#define('unicode', {
|
||||
\ 'text': '[UnicodeTable]',
|
||||
\ 'accent': 'bold' })
|
||||
let w:airline_section_a = airline#section#create(['unicode'])
|
||||
let w:airline_section_b = ''
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_y = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#unicode#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#unicode#apply')
|
||||
endfunction
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_unite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
" MIT License. Copyright (c) 2016 Jerome Reybert
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" This plugin replace the whole section_a when in vimagit buffer
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'loaded_magit', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#vimagit#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#vimagit#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#get_mode()
|
||||
if ( b:magit_current_commit_mode == '' )
|
||||
return "STAGING"
|
||||
elseif ( b:magit_current_commit_mode == 'CC' )
|
||||
return "COMMIT"
|
||||
elseif ( b:magit_current_commit_mode == 'CA' )
|
||||
return "AMEND"
|
||||
else
|
||||
return "???"
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimagit#apply(...)
|
||||
if ( &filetype == 'magit' )
|
||||
let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}'
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,81 +0,0 @@
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! s:SetDefault(var, val)
|
||||
if !exists(a:var)
|
||||
execute 'let ' . a:var . '=' . string(a:val)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Left and right delimiters (added only when status string is not empty)
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#left', "{")
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#right', "}")
|
||||
|
||||
" The current tex file is the main project file
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#main', "" )
|
||||
"
|
||||
" The current tex file is a subfile of the project
|
||||
" and the compilation is set for the main file
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#sub_main', "m")
|
||||
"
|
||||
" The current tex file is a subfile of the project
|
||||
" and the compilation is set for this subfile
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#sub_local', "l")
|
||||
"
|
||||
" Compilation is running and continuous compilation is off
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#compiled', "c₁")
|
||||
|
||||
" Compilation is running and continuous compilation is on
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#continuous', "c")
|
||||
|
||||
" Viewer is opened
|
||||
call s:SetDefault( 'g:airline#extensions#vimtex#viewer', "v")
|
||||
|
||||
function! airline#extensions#vimtex#init(ext)
|
||||
call airline#parts#define_raw('vimtex', '%{airline#extensions#vimtex#get_scope()}')
|
||||
call a:ext.add_statusline_func('airline#extensions#vimtex#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimtex#apply(...)
|
||||
if exists("b:vimtex")
|
||||
let w:airline_section_x = get(w:, 'airline_section_x', g:airline_section_x)
|
||||
let w:airline_section_x.=s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#vimtex#get_scope()}'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimtex#get_scope()
|
||||
let l:status = ''
|
||||
|
||||
let vt_local = get(b:, 'vimtex_local', {})
|
||||
if empty(vt_local)
|
||||
let l:status .= g:airline#extensions#vimtex#main
|
||||
else
|
||||
if get(vt_local, 'active')
|
||||
let l:status .= g:airline#extensions#vimtex#sub_local
|
||||
else
|
||||
let l:status .= g:airline#extensions#vimtex#sub_main
|
||||
endif
|
||||
endif
|
||||
|
||||
if get(get(get(b:, 'vimtex', {}), 'viewer', {}), 'xwin_id')
|
||||
let l:status .= g:airline#extensions#vimtex#viewer
|
||||
endif
|
||||
|
||||
let l:compiler = get(get(b:, 'vimtex', {}), 'compiler', {})
|
||||
if !empty(l:compiler)
|
||||
if has_key(l:compiler, 'is_running') && b:vimtex.compiler.is_running()
|
||||
if get(l:compiler, 'continuous')
|
||||
let l:status .= g:airline#extensions#vimtex#continuous
|
||||
else
|
||||
let l:status .= g:airline#extensions#vimtex#compiled
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if !empty(l:status)
|
||||
let l:status = g:airline#extensions#vimtex#left . l:status . g:airline#extensions#vimtex#right
|
||||
endif
|
||||
return l:status
|
||||
endfunction
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
if !isdirectory($VIRTUAL_ENV)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
@@ -10,22 +12,14 @@ function! airline#extensions#virtualenv#init(ext)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#apply(...)
|
||||
if &filetype =~# "python"
|
||||
if &filetype =~ "python"
|
||||
if get(g:, 'virtualenv_loaded', 0)
|
||||
let statusline = virtualenv#statusline()
|
||||
else
|
||||
let statusline = fnamemodify($VIRTUAL_ENV, ':t')
|
||||
endif
|
||||
if !empty(statusline)
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
endif
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#update()
|
||||
if &filetype =~# "python"
|
||||
call airline#extensions#virtualenv#apply()
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
|
||||
|
||||
scriptencoding utf-8
|
||||
" for backwards compatibility
|
||||
if exists('g:airline_detect_whitespace')
|
||||
let s:show_message = g:airline_detect_whitespace == 1
|
||||
else
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
endif
|
||||
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file']
|
||||
let s:default_checks = ['indent', 'trailing']
|
||||
|
||||
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', '[%s]trailing')
|
||||
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', '[%s]mixed-indent')
|
||||
let s:long_format = get(g:, 'airline#extensions#whitespace#long_format', '[%s]long')
|
||||
let s:mixed_indent_file_format = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', '[%s]mix-indent-file')
|
||||
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
|
||||
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
|
||||
let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'] }
|
||||
|
||||
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
|
||||
|
||||
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
let s:c_like_langs = get(g:, 'airline#extensions#c_like_langs', [ 'c', 'cpp', 'cuda', 'go', 'javascript', 'ld', 'php' ])
|
||||
|
||||
function! s:check_mixed_indent()
|
||||
if s:indent_algo == 1
|
||||
@@ -25,96 +27,46 @@ function! s:check_mixed_indent()
|
||||
" spaces before or between tabs are not allowed
|
||||
let t_s_t = '(^\t* +\t\s*\S)'
|
||||
" <tab>(<space> x count)
|
||||
" count of spaces at the end of tabs should be less than tabstop value
|
||||
" count of spaces at the end of tabs should be less then tabstop value
|
||||
let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)'
|
||||
return search('\v' . t_s_t . '|' . t_l_s, 'nw')
|
||||
elseif s:indent_algo == 2
|
||||
return search('\v(^\t* +\t\s*\S)', 'nw')
|
||||
else
|
||||
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:check_mixed_indent_file()
|
||||
if index(s:c_like_langs, &ft) > -1
|
||||
" for C-like languages: allow /** */ comment style with one space before the '*'
|
||||
let head_spc = '\v(^ +\*@!)'
|
||||
else
|
||||
let head_spc = '\v(^ +)'
|
||||
endif
|
||||
let indent_tabs = search('\v(^\t+)', 'nw')
|
||||
let indent_spc = search(head_spc, 'nw')
|
||||
if indent_tabs > 0 && indent_spc > 0
|
||||
return printf("%d:%d", indent_tabs, indent_spc)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#check()
|
||||
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
|
||||
\ || get(b:, 'airline_whitespace_disabled', 0)
|
||||
return ''
|
||||
endif
|
||||
|
||||
if !exists('b:airline_whitespace_check')
|
||||
let b:airline_whitespace_check = ''
|
||||
let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks))
|
||||
let checks = get(g:, 'airline#extensions#whitespace#checks', s:default_checks)
|
||||
|
||||
let trailing = 0
|
||||
if index(checks, 'trailing') > -1
|
||||
try
|
||||
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
|
||||
let trailing = search(regexp, 'nw')
|
||||
catch
|
||||
echomsg 'airline#whitespace: error occured evaluating '. regexp
|
||||
echomsg v:exception
|
||||
return ''
|
||||
endtry
|
||||
let trailing = search('\s$', 'nw')
|
||||
endif
|
||||
|
||||
let mixed = 0
|
||||
let check = 'indent'
|
||||
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
|
||||
if index(checks, 'indent') > -1
|
||||
let mixed = s:check_mixed_indent()
|
||||
endif
|
||||
|
||||
let mixed_file = ''
|
||||
let check = 'mixed-indent-file'
|
||||
if index(checks, check) > -1 && index(get(s:skip_check_ft, &ft, []), check) < 0
|
||||
let mixed_file = s:check_mixed_indent_file()
|
||||
endif
|
||||
|
||||
let long = 0
|
||||
if index(checks, 'long') > -1 && &tw > 0
|
||||
let long = search('\%>'.&tw.'v.\+', 'nw')
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file)
|
||||
if trailing != 0 || mixed != 0
|
||||
let b:airline_whitespace_check = s:symbol
|
||||
if strlen(s:symbol) > 0
|
||||
let space = (g:airline_symbols.space)
|
||||
else
|
||||
let space = ''
|
||||
endif
|
||||
|
||||
if s:show_message
|
||||
if trailing != 0
|
||||
let b:airline_whitespace_check .= space.printf(s:trailing_format, trailing)
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing)
|
||||
endif
|
||||
if mixed != 0
|
||||
let b:airline_whitespace_check .= space.printf(s:mixed_indent_format, mixed)
|
||||
endif
|
||||
if long != 0
|
||||
let b:airline_whitespace_check .= space.printf(s:long_format, long)
|
||||
endif
|
||||
if !empty(mixed_file)
|
||||
let b:airline_whitespace_check .= space.printf(s:mixed_indent_file_format, mixed_file)
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixed)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return airline#util#shorten(b:airline_whitespace_check, 120, 9)
|
||||
return b:airline_whitespace_check
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#toggle()
|
||||
@@ -139,29 +91,13 @@ function! airline#extensions#whitespace#toggle()
|
||||
echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#disable()
|
||||
if s:enabled
|
||||
call airline#extensions#whitespace#toggle()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#init(...)
|
||||
call airline#parts#define_function('whitespace', 'airline#extensions#whitespace#check')
|
||||
|
||||
unlet! b:airline_whitespace_check
|
||||
augroup airline_whitespace
|
||||
autocmd!
|
||||
autocmd CursorHold,BufWritePost * call <sid>ws_refresh()
|
||||
autocmd CursorHold,BufWritePost * unlet! b:airline_whitespace_check
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! s:ws_refresh()
|
||||
if get(b:, 'airline_ws_changedtick', 0) == b:changedtick
|
||||
return
|
||||
endif
|
||||
unlet! b:airline_whitespace_check
|
||||
if get(g:, 'airline_skip_empty_sections', 0)
|
||||
exe ':AirlineRefresh'
|
||||
endif
|
||||
let b:airline_ws_changedtick = b:changedtick
|
||||
endfunction
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('g:loaded_windowswap')
|
||||
finish
|
||||
endif
|
||||
@@ -17,11 +15,7 @@ function! airline#extensions#windowswap#init(ext)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#windowswap#get_status()
|
||||
" use new tab-aware api if WS is up to date
|
||||
let s:mark = exists('*WindowSwap#IsCurrentWindowMarked') ?
|
||||
\WindowSwap#IsCurrentWindowMarked() :
|
||||
\(WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr())
|
||||
if s:mark
|
||||
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
|
||||
return g:airline#extensions#windowswap#indicator_text.s:spc
|
||||
endif
|
||||
return ''
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:formatter = get(g:, 'airline#extensions#wordcount#formatter', 'default')
|
||||
let g:airline#extensions#wordcount#filetypes = get(g:, 'airline#extensions#wordcount#filetypes',
|
||||
\ '\vhelp|markdown|rst|org|text|asciidoc|tex|mail')
|
||||
|
||||
function! s:wordcount_update()
|
||||
if empty(bufname(''))
|
||||
return
|
||||
endif
|
||||
if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1
|
||||
let l:mode = mode()
|
||||
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
|
||||
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
let b:airline_change_tick = b:changedtick
|
||||
else
|
||||
if get(b:, 'airline_wordcount_cache', '') is# '' ||
|
||||
\ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') ||
|
||||
\ get(b:, 'airline_change_tick', 0) != b:changedtick ||
|
||||
\ get(b:, 'airline_winwidth', 0) != winwidth(0)
|
||||
" cache data
|
||||
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
|
||||
let b:airline_wordcount_cache = b:airline_wordcount
|
||||
let b:airline_change_tick = b:changedtick
|
||||
let b:airline_winwidth = winwidth(0)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#wordcount#apply(...)
|
||||
if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1
|
||||
call airline#extensions#prepend_to_section('z', '%{get(b:, "airline_wordcount", "")}')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#wordcount#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#wordcount#apply')
|
||||
autocmd BufReadPost,CursorMoved,CursorMovedI * call s:wordcount_update()
|
||||
endfunction
|
||||
@@ -1,64 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! airline#extensions#wordcount#formatters#default#format()
|
||||
let words = string(s:wordcount())
|
||||
if empty(words)
|
||||
return
|
||||
endif
|
||||
let result = g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
if winwidth(0) >= 80
|
||||
let separator = s:get_decimal_group()
|
||||
if words > 999 && !empty(separator)
|
||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||
let words = substitute(words, '\d\@<=\(\(\d\{3\}\)\+\)$', separator.'&', 'g')
|
||||
endif
|
||||
let result = printf("%s%s", words, " words"). result
|
||||
else
|
||||
let result = printf("%s%s", words, "W"). result
|
||||
endif
|
||||
return result
|
||||
endfunction
|
||||
|
||||
function! s:wordcount()
|
||||
if exists("*wordcount")
|
||||
let l:mode = mode()
|
||||
if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S'
|
||||
let l:visual_words = wordcount()['visual_words']
|
||||
if l:visual_words != ''
|
||||
return l:visual_words
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
else
|
||||
return wordcount()['words']
|
||||
endif
|
||||
elseif mode() =~? 's'
|
||||
return
|
||||
else
|
||||
let old_status = v:statusmsg
|
||||
let position = getpos(".")
|
||||
exe "silent normal! g\<c-g>"
|
||||
let stat = v:statusmsg
|
||||
call setpos('.', position)
|
||||
let v:statusmsg = old_status
|
||||
|
||||
let parts = split(stat)
|
||||
if len(parts) > 11
|
||||
return str2nr(parts[11])
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_decimal_group()
|
||||
if match(v:lang, '\v\cC|en') > -1
|
||||
return ','
|
||||
elseif match(v:lang, '\v\cde|dk|fr|pt') > -1
|
||||
return '.'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
@@ -1,25 +0,0 @@
|
||||
" MIT License. Copyright (c) 2017 YoungHoon Rhiu.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists('g:XkbSwitchLib')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#xkblayout#status()
|
||||
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
|
||||
let keyboard_layout = split(keyboard_layout, '\.')[-1]
|
||||
let short_codes = {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'}
|
||||
|
||||
if has_key(short_codes, keyboard_layout)
|
||||
let keyboard_layout = short_codes[keyboard_layout]
|
||||
endif
|
||||
|
||||
return keyboard_layout
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#xkblayout#init(ext)
|
||||
call airline#parts#define_function('xkblayout', 'airline#extensions#xkblayout#status')
|
||||
endfunction
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
" MIT License. Copyright (c) 2015 Evgeny Firsov.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
let s:error_symbol = get(g:, 'airline#extensions#ycm#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#ycm#warning_symbol', 'W:')
|
||||
|
||||
function! airline#extensions#ycm#init(ext)
|
||||
call airline#parts#define_function('ycm_error_count', 'airline#extensions#ycm#get_error_count')
|
||||
call airline#parts#define_function('ycm_warning_count', 'airline#extensions#ycm#get_warning_count')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ycm#get_error_count()
|
||||
if exists(':YcmDiag') && exists("*youcompleteme#GetErrorCount")
|
||||
let cnt = youcompleteme#GetErrorCount()
|
||||
|
||||
if cnt != 0
|
||||
return s:error_symbol.cnt
|
||||
endif
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ycm#get_warning_count()
|
||||
if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount")
|
||||
let cnt = youcompleteme#GetWarningCount()
|
||||
|
||||
if cnt != 0
|
||||
return s:warning_symbol.cnt.s:spc
|
||||
endif
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,55 +1,48 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) &&
|
||||
\ !has('gui_running') &&
|
||||
\ (empty($CONEMUBUILD) || &term !=? 'xterm') &&
|
||||
\ !(exists("+termguicolors") && &termguicolors)
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
|
||||
let s:separators = {}
|
||||
let s:accents = {}
|
||||
|
||||
function! s:gui2cui(rgb, fallback)
|
||||
if a:rgb == ''
|
||||
return a:fallback
|
||||
elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1
|
||||
return a:rgb
|
||||
endif
|
||||
let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)')
|
||||
return airline#msdos#round_msdos_colors(rgb)
|
||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
||||
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
|
||||
return rgb[0]+rgb[1]+rgb[2]
|
||||
endfunction
|
||||
|
||||
function! s:get_syn(group, what)
|
||||
if !exists("g:airline_gui_mode")
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
endif
|
||||
let color = ''
|
||||
if hlexists(a:group)
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
|
||||
" need to pass in mode, known to break on 7.3.547
|
||||
let mode = has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
" should always exists
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
|
||||
" however, just in case
|
||||
if empty(color) || color == -1
|
||||
let color = 'NONE'
|
||||
if has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
||||
function! s:get_array(fg, bg, opts)
|
||||
return g:airline_gui_mode ==# 'gui'
|
||||
\ ? [ a:fg, a:bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', a:fg, a:bg, join(a:opts, ',') ]
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let reverse = g:airline_gui_mode ==# 'gui'
|
||||
let reverse = has('gui_running') || (has("termtruecolor") && &guicolors == 1)
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
@@ -62,83 +55,24 @@ function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
return s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! s:hl_group_exists(group)
|
||||
if !hlexists(a:group)
|
||||
return 0
|
||||
elseif empty(synIDattr(hlID(a:group), 'fg'))
|
||||
return 0
|
||||
endif
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#exec(group, colors)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let colors = a:colors
|
||||
if s:is_win32term
|
||||
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
|
||||
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
|
||||
endif
|
||||
let old_hi = airline#highlighter#get_highlight(a:group)
|
||||
if len(colors) == 4
|
||||
call add(colors, '')
|
||||
endif
|
||||
let colors = s:CheckDefined(colors)
|
||||
if old_hi != colors || !s:hl_group_exists(a:group)
|
||||
let cmd = printf('hi %s %s %s %s %s %s %s %s',
|
||||
\ a:group, s:Get(colors, 0, 'guifg=', ''), s:Get(colors, 1, 'guibg=', ''),
|
||||
\ s:Get(colors, 2, 'ctermfg=', ''), s:Get(colors, 3, 'ctermbg=', ''),
|
||||
\ s:Get(colors, 4, 'gui=', ''), s:Get(colors, 4, 'cterm=', ''),
|
||||
\ s:Get(colors, 4, 'term=', ''))
|
||||
exe cmd
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:CheckDefined(colors)
|
||||
" Checks, whether the definition of the colors is valid and is not empty or NONE
|
||||
" e.g. if the colors would expand to this:
|
||||
" hi airline_c ctermfg=NONE ctermbg=NONE
|
||||
" that means to clear that highlighting group, therefore, fallback to Normal
|
||||
" highlighting group for the cterm values
|
||||
|
||||
" This only works, if the Normal highlighting group is actually defined, so
|
||||
" return early, if it has been cleared
|
||||
if !exists("g:airline#highlighter#normal_fg_hi")
|
||||
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
|
||||
endif
|
||||
if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0
|
||||
return a:colors
|
||||
endif
|
||||
|
||||
for val in a:colors
|
||||
if !empty(val) && val !=# 'NONE'
|
||||
return a:colors
|
||||
endif
|
||||
endfor
|
||||
" this adds the bold attribute to the term argument of the :hi command,
|
||||
" but at least this makes sure, the group will be defined
|
||||
let fg = g:airline#highlighter#normal_fg_hi
|
||||
let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm')
|
||||
if bg < 0
|
||||
" in case there is no background color defined for Normal
|
||||
let bg = a:colors[3]
|
||||
endif
|
||||
return a:colors[0:1] + [fg, bg] + [a:colors[4]]
|
||||
endfunction
|
||||
|
||||
function! s:Get(dict, key, prefix, default)
|
||||
if get(a:dict, a:key, a:default) isnot# a:default
|
||||
return a:prefix. get(a:dict, a:key)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
exec printf('hi %s %s %s %s %s %s %s %s',
|
||||
\ a:group,
|
||||
\ get(colors, 0, '') != '' ? 'guifg='.colors[0] : '',
|
||||
\ get(colors, 1, '') != '' ? 'guibg='.colors[1] : '',
|
||||
\ get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '',
|
||||
\ get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '',
|
||||
\ get(colors, 4, '') != '' ? 'gui='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'cterm='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
|
||||
endfunction
|
||||
|
||||
function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
let l:from = airline#themes#get_highlight(a:from.a:suffix)
|
||||
let l:to = airline#themes#get_highlight(a:to.a:suffix)
|
||||
let group = a:from.'_to_'.a:to.a:suffix
|
||||
@@ -152,18 +86,11 @@ function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#load_theme()
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
|
||||
endfor
|
||||
call airline#highlighter#highlight(['inactive'])
|
||||
if getbufvar( bufnr('%'), '&modified' )
|
||||
call airline#highlighter#highlight(['normal', 'modified'])
|
||||
else
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
endif
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#add_separator(from, to, inverse)
|
||||
@@ -189,8 +116,7 @@ function! airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight(modes, ...)
|
||||
let bufnr = a:0 ? a:1 : ''
|
||||
function! airline#highlighter#highlight(modes)
|
||||
let p = g:airline#themes#{g:airline_theme}#palette
|
||||
|
||||
" draw the base mode, followed by any overrides
|
||||
@@ -201,11 +127,7 @@ function! airline#highlighter#highlight(modes, ...)
|
||||
let dict = g:airline#themes#{g:airline_theme}#palette[mode]
|
||||
for kvp in items(dict)
|
||||
let mode_colors = kvp[1]
|
||||
let name = kvp[0]
|
||||
if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive'
|
||||
let name = 'airline_c'.bufnr
|
||||
endif
|
||||
call airline#highlighter#exec(name.suffix, mode_colors)
|
||||
call airline#highlighter#exec(kvp[0].suffix, mode_colors)
|
||||
|
||||
for accent in keys(s:accents)
|
||||
if !has_key(p.accents, accent)
|
||||
@@ -223,7 +145,7 @@ function! airline#highlighter#highlight(modes, ...)
|
||||
else
|
||||
call add(colors, get(p.accents[accent], 4, ''))
|
||||
endif
|
||||
call airline#highlighter#exec(name.suffix.'_'.accent, colors)
|
||||
call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors)
|
||||
endfor
|
||||
endfor
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
function! s:check_defined(variable, default)
|
||||
if !exists(a:variable)
|
||||
let {a:variable} = a:default
|
||||
@@ -18,19 +16,17 @@ function! airline#init#bootstrap()
|
||||
|
||||
let g:airline#init#bootstrapping = 1
|
||||
|
||||
let g:airline#util#async = v:version >= 800 && has('job')
|
||||
let g:airline#util#is_windows = has('win32') || has('win64')
|
||||
|
||||
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b0":">")
|
||||
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b1":">")
|
||||
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b2":"<")
|
||||
call s:check_defined('g:airline_right_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b3":"<")
|
||||
call s:check_defined('g:airline_detect_modified', 1)
|
||||
call s:check_defined('g:airline_detect_paste', 1)
|
||||
call s:check_defined('g:airline_detect_crypt', 1)
|
||||
call s:check_defined('g:airline_detect_spell', 1)
|
||||
call s:check_defined('g:airline_detect_iminsert', 0)
|
||||
call s:check_defined('g:airline_inactive_collapse', 1)
|
||||
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
||||
call s:check_defined('g:airline_exclude_filetypes', [])
|
||||
call s:check_defined('g:airline_exclude_preview', 0)
|
||||
call s:check_defined('g:airline_gui_mode', airline#init#gui_mode())
|
||||
|
||||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
@@ -45,80 +41,28 @@ function! airline#init#bootstrap()
|
||||
\ 's' : 'SELECT',
|
||||
\ 'S' : 'S-LINE',
|
||||
\ '' : 'S-BLOCK',
|
||||
\ 't' : 'TERMINAL',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_theme_map', {})
|
||||
call extend(g:airline_theme_map, {
|
||||
\ '\CTomorrow': 'tomorrow',
|
||||
\ 'base16': 'base16',
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat': 'wombat',
|
||||
\ 'zenburn': 'zenburn',
|
||||
\ 'solarized': 'solarized',
|
||||
\ 'flattened': 'solarized',
|
||||
\ '\CNeoSolarized': 'solarized',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
" First define the symbols,
|
||||
" that are common in Powerline/Unicode/ASCII mode,
|
||||
" then add specific symbols for either mode
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'paste': 'PASTE',
|
||||
\ 'spell': 'SPELL',
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' '
|
||||
\ }, 'keep')
|
||||
|
||||
if get(g:, 'airline_powerline_fonts', 0)
|
||||
" Symbols for Powerline terminals
|
||||
call s:check_defined('g:airline_left_sep', "\ue0b0") "
|
||||
call s:check_defined('g:airline_left_alt_sep', "\ue0b1") "
|
||||
call s:check_defined('g:airline_right_sep', "\ue0b2") "
|
||||
call s:check_defined('g:airline_right_alt_sep', "\ue0b3") "
|
||||
" ro=, ws=☲, lnr=☰, mlnr=, br=, nx=Ɇ, crypt=🔒
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': "\ue0a2",
|
||||
\ 'whitespace': "\u2632",
|
||||
\ 'linenr': "\u2630 ",
|
||||
\ 'maxlinenr': " \ue0a1",
|
||||
\ 'branch': "\ue0a0",
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ }, 'keep')
|
||||
elseif &encoding==?'utf-8' && !get(g:, "airline_symbols_ascii", 0)
|
||||
" Symbols for Unicode terminals
|
||||
call s:check_defined('g:airline_left_sep', "")
|
||||
call s:check_defined('g:airline_left_alt_sep', "")
|
||||
call s:check_defined('g:airline_right_sep', "")
|
||||
call s:check_defined('g:airline_right_alt_sep', "")
|
||||
" ro=⊝, ws=☲, lnr=☰, mlnr=㏑, br=ᚠ, nx=Ɇ, crypt=🔒
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': "\u229D",
|
||||
\ 'whitespace': "\u2632",
|
||||
\ 'linenr': "\u2630 ",
|
||||
\ 'maxlinenr': " \u33D1",
|
||||
\ 'branch': "\u16A0",
|
||||
\ 'notexists': "\u0246",
|
||||
\ 'crypt': nr2char(0x1F512),
|
||||
\ }, 'keep')
|
||||
else
|
||||
" Symbols for ASCII terminals
|
||||
call s:check_defined('g:airline_left_sep', "")
|
||||
call s:check_defined('g:airline_left_alt_sep', "")
|
||||
call s:check_defined('g:airline_right_sep', "")
|
||||
call s:check_defined('g:airline_right_alt_sep', "")
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'readonly': 'RO',
|
||||
\ 'whitespace': '!',
|
||||
\ 'linenr': 'ln ',
|
||||
\ 'maxlinenr': ' :',
|
||||
\ 'branch': '',
|
||||
\ 'notexists': '?',
|
||||
\ 'crypt': 'cr',
|
||||
\ }, 'keep')
|
||||
endif
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', 'PASTE'),
|
||||
\ 'readonly': get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO'),
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : ''),
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ }, 'keep')
|
||||
|
||||
call airline#parts#define('mode', {
|
||||
\ 'function': 'airline#parts#mode',
|
||||
@@ -126,52 +70,30 @@ function! airline#init#bootstrap()
|
||||
\ })
|
||||
call airline#parts#define_function('iminsert', 'airline#parts#iminsert')
|
||||
call airline#parts#define_function('paste', 'airline#parts#paste')
|
||||
call airline#parts#define_function('crypt', 'airline#parts#crypt')
|
||||
call airline#parts#define_function('spell', 'airline#parts#spell')
|
||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||
call airline#parts#define('readonly', {
|
||||
\ 'function': 'airline#parts#readonly',
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
call airline#parts#define_raw('file', '%f%m')
|
||||
call airline#parts#define_raw('path', '%F%m')
|
||||
call airline#parts#define('linenr', {
|
||||
\ 'raw': '%{g:airline_symbols.linenr}%4l',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define('maxlinenr', {
|
||||
\ 'raw': '/%L%{g:airline_symbols.maxlinenr}',
|
||||
\ 'accent': 'bold'})
|
||||
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
|
||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'obsession', 'tagbar',
|
||||
\ 'syntastic-warn', 'syntastic-err', 'eclim', 'whitespace','windowswap',
|
||||
\ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count',
|
||||
\ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count'])
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
call airline#parts#define_text('xkblayout', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#gui_mode()
|
||||
return ((has('nvim') && exists('$NVIM_TUI_ENABLE_TRUE_COLOR') && !exists("+termguicolors"))
|
||||
\ || has('gui_running') || (has("termtruecolor") && &guicolors == 1) || (has("termguicolors") && &termguicolors == 1)) ?
|
||||
\ 'gui' : 'cterm'
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'spell', 'capslock', 'xkblayout', 'iminsert'])
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'paste', 'capslock', 'iminsert'])
|
||||
endif
|
||||
if !exists('g:airline_section_b')
|
||||
let g:airline_section_b = airline#section#create(['hunks', 'branch'])
|
||||
endif
|
||||
if !exists('g:airline_section_c')
|
||||
if exists("+autochdir") && &autochdir == 1
|
||||
let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly'])
|
||||
else
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
if !exists('g:airline_section_gutter')
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
@@ -183,16 +105,10 @@ function! airline#init#sections()
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||
endif
|
||||
if !exists('g:airline_section_z')
|
||||
if winwidth(0) > 80
|
||||
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v'])
|
||||
else
|
||||
let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3v'])
|
||||
endif
|
||||
endif
|
||||
if !exists('g:airline_section_error')
|
||||
let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic-err', 'eclim', 'neomake_error_count', 'ale_error_count'])
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v '])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['ycm_warning_count', 'syntastic-warn', 'neomake_warning_count', 'ale_warning_count', 'whitespace'])
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" basic 16 msdos from MSDOS
|
||||
" see output of color, should be
|
||||
" 0 Black
|
||||
" 1 DarkBlue
|
||||
" 2 DarkGreen
|
||||
" 3 DarkCyan
|
||||
" 4 DarkRed
|
||||
" 5 DarkMagenta
|
||||
" 6 Brown
|
||||
" 7 LightGray
|
||||
" 8 DarkGray
|
||||
" 9 Blue
|
||||
" 10 Green
|
||||
" 11 Cyan
|
||||
" 12 Red
|
||||
" 13 Magenta
|
||||
" 14 Yellow
|
||||
" 15 White
|
||||
|
||||
let s:basic16 = [
|
||||
\ [ 0x00, 0x00, 0x00 ],
|
||||
\ [ 0x00, 0x00, 0x80 ],
|
||||
\ [ 0x00, 0x80, 0x00 ],
|
||||
\ [ 0x00, 0x80, 0x80 ],
|
||||
\ [ 0x80, 0x00, 0x00 ],
|
||||
\ [ 0x80, 0x00, 0x80 ],
|
||||
\ [ 0x80, 0x80, 0x00 ],
|
||||
\ [ 0xC0, 0xC0, 0xC0 ],
|
||||
\ [ 0x80, 0x80, 0x80 ],
|
||||
\ [ 0x00, 0x00, 0xFF ],
|
||||
\ [ 0x00, 0xFF, 0x00 ],
|
||||
\ [ 0x00, 0xFF, 0xFF ],
|
||||
\ [ 0xFF, 0x00, 0x00 ],
|
||||
\ [ 0xFF, 0x00, 0xFF ],
|
||||
\ [ 0xFF, 0xFF, 0x00 ],
|
||||
\ [ 0xFF, 0xFF, 0xFF ]
|
||||
\ ]
|
||||
|
||||
function! airline#msdos#round_msdos_colors(rgblist)
|
||||
" Check for values from MSDOS 16 color terminal
|
||||
let best = []
|
||||
let min = 100000
|
||||
let list = s:basic16
|
||||
for value in list
|
||||
let t = abs(value[0] - a:rgblist[0]) +
|
||||
\ abs(value[1] - a:rgblist[1]) +
|
||||
\ abs(value[2] - a:rgblist[2])
|
||||
if min > t
|
||||
let min = t
|
||||
let best = value
|
||||
endif
|
||||
endfor
|
||||
return index(s:basic16, best)
|
||||
endfunction
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:parts = {}
|
||||
|
||||
" PUBLIC API {{{
|
||||
@@ -53,21 +51,13 @@ endfunction
|
||||
" }}}
|
||||
|
||||
function! airline#parts#mode()
|
||||
return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1)
|
||||
endfunction
|
||||
|
||||
function! airline#parts#crypt()
|
||||
return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
|
||||
return get(w:, 'airline_current_mode', '')
|
||||
endfunction
|
||||
|
||||
function! airline#parts#paste()
|
||||
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#spell()
|
||||
return g:airline_detect_spell && &spell ? g:airline_symbols.spell : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#iminsert()
|
||||
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
|
||||
return toupper(b:keymap_name)
|
||||
@@ -76,24 +66,14 @@ function! airline#parts#iminsert()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
if &readonly && &modifiable && !filereadable(bufname('%'))
|
||||
return '[noperm]'
|
||||
else
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endif
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype
|
||||
return &filetype
|
||||
endfunction
|
||||
|
||||
function! airline#parts#ffenc()
|
||||
let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
|
||||
let bomb = &l:bomb ? '[BOM]' : ''
|
||||
let ff = strlen(&ff) ? '['.&ff.']' : ''
|
||||
if expected is# &fenc.bomb.ff
|
||||
return ''
|
||||
else
|
||||
return &fenc.bomb.ff
|
||||
endif
|
||||
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
@@ -19,7 +17,6 @@ function! s:create(parts, append)
|
||||
for idx in range(len(a:parts))
|
||||
let part = airline#parts#get(a:parts[idx])
|
||||
let val = ''
|
||||
let add_sep = get(l:, 'add_sep', 0)
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
@@ -30,11 +27,7 @@ function! s:create(parts, append)
|
||||
let val .= s:spc.g:airline_left_alt_sep.s:spc
|
||||
endif
|
||||
if a:append < 0 && idx != 0
|
||||
let t = ''
|
||||
if !add_sep
|
||||
let t = s:spc.g:airline_right_alt_sep.s:spc
|
||||
endif
|
||||
let val = t.val
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
@@ -49,15 +42,10 @@ function! s:create(parts, append)
|
||||
|
||||
if a:append > 0 && idx != 0
|
||||
let partval = printf('%%{airline#util#append(%s,%s)}', func, minwidth)
|
||||
" will add an extra separator, if minwidth is zero
|
||||
let add_sep = (minwidth == 0)
|
||||
elseif a:append < 0 && idx != len(a:parts) - 1
|
||||
let partval = printf('%%{airline#util#prepend(%s,%s)}', func, minwidth)
|
||||
" will add an extra separator, if minwidth is zero
|
||||
let add_sep = (minwidth == 0)
|
||||
else
|
||||
let partval = printf('%%{airline#util#wrap(%s,%s)}', func, minwidth)
|
||||
let add_sep = 0
|
||||
endif
|
||||
|
||||
if exists('part.condition')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" generates a dictionary which defines the colors for each highlight group
|
||||
function! airline#themes#generate_color_map(sect1, sect2, sect3, ...)
|
||||
let palette = {
|
||||
@@ -41,13 +39,9 @@ function! airline#themes#patch(palette)
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
if !has_key(a:palette[mode], 'airline_error')
|
||||
let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ]
|
||||
endif
|
||||
endfor
|
||||
|
||||
let a:palette.accents = get(a:palette, 'accents', {})
|
||||
let a:palette.accents.none = [ '', '', '', '', '' ]
|
||||
let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
|
||||
let a:palette.accents.italic = [ '', '', '', '', 'italic' ]
|
||||
|
||||
|
||||
52
autoload/airline/themes/badwolf.vim
Normal file
52
autoload/airline/themes/badwolf.vim
Normal file
@@ -0,0 +1,52 @@
|
||||
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime
|
||||
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel
|
||||
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel
|
||||
let s:N4 = [ '#666462' , 241 ] " mediumgravel
|
||||
|
||||
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis
|
||||
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook
|
||||
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel
|
||||
|
||||
let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange
|
||||
let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale
|
||||
let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee
|
||||
let s:V4 = [ '#c7915b' , 173 ] " coffee
|
||||
|
||||
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
|
||||
let s:RE = [ '#ff9eb8' , 211 ] " dress
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#badwolf#palette = {}
|
||||
|
||||
let g:airline#themes#badwolf#palette.accents = {
|
||||
\ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#badwolf#palette.normal_modified = {
|
||||
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#badwolf#palette.insert_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#badwolf#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
|
||||
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#badwolf#palette.visual_modified = {
|
||||
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#badwolf#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
107
autoload/airline/themes/base16.vim
Normal file
107
autoload/airline/themes/base16.vim
Normal file
@@ -0,0 +1,107 @@
|
||||
if get(g:, 'airline#themes#base16#constant', 0)
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#202020'
|
||||
let s:cterm_dark_gray = 234
|
||||
let s:gui_med_gray_hi = '#303030'
|
||||
let s:cterm_med_gray_hi = 236
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#505050'
|
||||
let s:cterm_light_gray = 239
|
||||
let s:gui_green = '#99cc99'
|
||||
let s:cterm_green = 151
|
||||
let s:gui_blue = '#6a9fb5'
|
||||
let s:cterm_blue = 67
|
||||
let s:gui_purple = '#aa759f'
|
||||
let s:cterm_purple = 139
|
||||
let s:gui_orange = '#d28445'
|
||||
let s:cterm_orange = 173
|
||||
let s:gui_red = '#ac4142'
|
||||
let s:cterm_red = 131
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
|
||||
let g:airline#themes#base16#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#base16#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#base16#palette.replace_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
else
|
||||
function! airline#themes#base16#refresh()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
let g:airline#themes#base16#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight2(['Visual', 'fg'], ['Visual', 'bg'])
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'statusline': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffAdded', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
call airline#themes#base16#refresh()
|
||||
endif
|
||||
|
||||
70
autoload/airline/themes/bubblegum.vim
Normal file
70
autoload/airline/themes/bubblegum.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#303030'
|
||||
let s:cterm_dark_gray = 236
|
||||
let s:gui_med_gray_hi = '#444444'
|
||||
let s:cterm_med_gray_hi = 238
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#b2b2b2'
|
||||
let s:cterm_light_gray = 249
|
||||
let s:gui_green = '#afd787'
|
||||
let s:cterm_green = 150
|
||||
let s:gui_blue = '#87afd7'
|
||||
let s:cterm_blue = 110
|
||||
let s:gui_purple = '#afafd7'
|
||||
let s:cterm_purple = 146
|
||||
let s:gui_orange = '#d7af5f'
|
||||
let s:cterm_orange = 179
|
||||
let s:gui_red = '#d78787'
|
||||
let s:cterm_red = 174
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
let g:airline#themes#bubblegum#palette = {}
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#bubblegum#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
|
||||
let g:airline#themes#bubblegum#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#bubblegum#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_light_gray, s:gui_med_gray_hi, s:cterm_light_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#bubblegum#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#bubblegum#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, '' ] ,
|
||||
\ [ s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, '' ] ,
|
||||
\ [ s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green, 'bold' ] )
|
||||
@@ -1,5 +1,3 @@
|
||||
scriptencoding utf-8
|
||||
|
||||
" Each theme is contained in its own file and declares variables scoped to the
|
||||
" file. These variables represent the possible "modes" that airline can
|
||||
" detect. The mode is the return value of mode(), which gets converted to a
|
||||
@@ -94,10 +92,11 @@ let g:airline#themes#dark#palette.accents = {
|
||||
" variable so that related functionality is loaded iff the user is using
|
||||
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
|
||||
" they will be chosen automatically from the existing palette.
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
|
||||
59
autoload/airline/themes/durant.vim
Normal file
59
autoload/airline/themes/durant.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
|
||||
let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ]
|
||||
let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ]
|
||||
let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
|
||||
let g:airline#themes#durant#normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ]
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
|
||||
let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#durant#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#durant#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert)
|
||||
let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
|
||||
let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ]
|
||||
let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ]
|
||||
let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ]
|
||||
let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#durant#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#durant#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
58
autoload/airline/themes/hybrid.vim
Normal file
58
autoload/airline/themes/hybrid.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
" vim-airline companion theme of Hybrid
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
let g:airline#themes#hybrid#palette = {}
|
||||
|
||||
function! airline#themes#hybrid#refresh()
|
||||
let s:N1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:N2 = airline#themes#get_highlight('CursorLine')
|
||||
let s:N3 = airline#themes#get_highlight('PMenu')
|
||||
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.normal_modified = {
|
||||
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
|
||||
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let replace_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#hybrid#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybrid#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#hybrid#refresh()
|
||||
52
autoload/airline/themes/jellybeans.vim
Normal file
52
autoload/airline/themes/jellybeans.vim
Normal file
@@ -0,0 +1,52 @@
|
||||
let g:airline#themes#jellybeans#palette = {}
|
||||
|
||||
" The name of the function must be 'refresh'.
|
||||
function! airline#themes#jellybeans#refresh()
|
||||
" This theme is an example of how to use helper functions to extract highlight
|
||||
" values from the corresponding colorscheme. It was written in a hurry, so it
|
||||
" is very minimalistic. If you are a jellybeans user and want to make updates,
|
||||
" please send pull requests.
|
||||
|
||||
" Here are examples where the entire highlight group is copied and an airline
|
||||
" compatible color array is generated.
|
||||
let s:N1 = airline#themes#get_highlight('DbgCurrent', 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#jellybeans#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#jellybeans#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" Sometimes you want to mix and match colors from different groups, you can do
|
||||
" that with this method.
|
||||
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" And of course, you can always do it manually as well.
|
||||
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#jellybeans#palette.inactive_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
endfunction
|
||||
|
||||
call airline#themes#jellybeans#refresh()
|
||||
|
||||
70
autoload/airline/themes/kalisi.vim
Normal file
70
autoload/airline/themes/kalisi.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
"
|
||||
" Colorscheme: Kalisi for airline. Inspired by powerline.
|
||||
" Arthur Jaron
|
||||
" hifreeo@gmail.com
|
||||
" 24.10.2014
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#0087ff' , '#ffffff','33','231']
|
||||
let s:V2 = [ '#005faf' , '#5fafff','25','75']
|
||||
let s:V3 = [ '#87d7ff' , '#005faf','117','25']
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#d75fff' , '#ffffff','171','231']
|
||||
let s:R2 = [ '#5f005f' , '#d75fff','53','171']
|
||||
let s:R3 = [ '#ff87ff' , '#8700af','213','91']
|
||||
|
||||
let g:airline#themes#kalisi#palette = {}
|
||||
|
||||
|
||||
function! airline#themes#kalisi#refresh()
|
||||
|
||||
let s:StatusLine = airline#themes#get_highlight('StatusLine')
|
||||
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#ffffff' , '#e80000','231','160']
|
||||
let s:I2 = [ '#ff0000' , '#5f0000','196','52']
|
||||
let s:I3 = s:StatusLine
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#005f00' , '#afd700','22','148']
|
||||
let s:N2 = [ '#afd700' , '#005f00','148','22']
|
||||
let s:N3 = s:StatusLine
|
||||
|
||||
" Tabline Plugin
|
||||
let g:airline#themes#kalisi#palette.tabline = {
|
||||
\ 'airline_tab': ['#bcbcbc', '#005f00','250','22'],
|
||||
\ 'airline_tabsel': ['#404042', '#A6DB29','238','148'],
|
||||
\ 'airline_tabtype':['#afd700', '#204d20','148','22'],
|
||||
\ 'airline_tabfill': s:StatusLine,
|
||||
\ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'],
|
||||
\ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'],
|
||||
\ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22']
|
||||
\ }
|
||||
|
||||
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
|
||||
" Inactive Mode
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#kalisi#palette.inactive_modified = {
|
||||
\ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]],
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#kalisi#refresh()
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ s:StatusLine,
|
||||
\ ['#afd700', '#005f00','148','22'],
|
||||
\ [ '#005f00' , '#afd700' , '22','148']
|
||||
\)
|
||||
|
||||
59
autoload/airline/themes/kolor.vim
Normal file
59
autoload/airline/themes/kolor.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
let g:airline#themes#kolor#palette = {}
|
||||
|
||||
let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ]
|
||||
let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ]
|
||||
let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
|
||||
let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#kolor#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ]
|
||||
let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ]
|
||||
let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kolor#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert)
|
||||
let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ]
|
||||
let g:airline#themes#kolor#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ]
|
||||
let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ]
|
||||
let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kolor#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ]
|
||||
let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#kolor#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.accents = {
|
||||
\ 'red': [ '#d96e8a' , '' , 168 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ],
|
||||
\ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ],
|
||||
\ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ])
|
||||
62
autoload/airline/themes/laederon.vim
Normal file
62
autoload/airline/themes/laederon.vim
Normal file
@@ -0,0 +1,62 @@
|
||||
" vim-airline companion theme of Laederon
|
||||
" (https://github.com/Donearm/Laederon)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow
|
||||
let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel
|
||||
let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
|
||||
let s:N4 = [ '#777470' , 240 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
|
||||
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
|
||||
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry
|
||||
let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain
|
||||
let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain
|
||||
let s:V4 = [ '#515744' , 101 ] " lichen
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#233e09' , 22 ] " oakleaf
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette = {}
|
||||
|
||||
let g:airline#themes#laederon#palette.accents = {
|
||||
\ 'red': [ '#ef393d' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#laederon#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#laederon#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#laederon#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert)
|
||||
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#laederon#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#laederon#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
45
autoload/airline/themes/light.vim
Normal file
45
autoload/airline/themes/light.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
let g:airline#themes#light#palette = {}
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ]
|
||||
let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ]
|
||||
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
|
||||
let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#light#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#light#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#light#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert)
|
||||
let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#light#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ]
|
||||
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
|
||||
let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ]
|
||||
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#light#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
56
autoload/airline/themes/lucius.vim
Normal file
56
autoload/airline/themes/lucius.vim
Normal file
@@ -0,0 +1,56 @@
|
||||
let g:airline#themes#lucius#palette = {}
|
||||
|
||||
function! airline#themes#lucius#refresh()
|
||||
|
||||
let s:N1 = airline#themes#get_highlight('StatusLine')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#lucius#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight('Statement')
|
||||
let g:airline#themes#lucius#palette.normal_modified = {
|
||||
\ 'airline_c': [modified_group[0], '', modified_group[2], '', '']
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('DiffDelete')
|
||||
let g:airline#themes#lucius#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#lucius#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#lucius#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#lucius#palette.insert_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.insert.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.insert_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#lucius#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#lucius#palette.replace_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.replace.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.replace_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight('Cursor')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#lucius#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#lucius#palette.visual_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.visual.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.visual_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#lucius#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#lucius#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#lucius#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#lucius#refresh()
|
||||
|
||||
92
autoload/airline/themes/luna.vim
Normal file
92
autoload/airline/themes/luna.vim
Normal file
@@ -0,0 +1,92 @@
|
||||
" vim-airline companion theme of Luna
|
||||
" (https://github.com/Pychimp/vim-luna)
|
||||
|
||||
let g:airline#themes#luna#palette = {}
|
||||
|
||||
let g:airline#themes#luna#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
|
||||
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#luna#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
|
||||
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#luna#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#luna#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
|
||||
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
|
||||
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
|
||||
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#luna#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#luna#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#luna#palette.tabline = {
|
||||
\ 'airline_tab': ['#2aa198', '#003f3f', 231, 29, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''],
|
||||
\ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''],
|
||||
\ 'airline_tabfill': ['#ffffff', '#002b2b', 231, 23, ''],
|
||||
\ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ffffff', '#5f0000', 231, 88 ]
|
||||
let g:airline#themes#luna#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#luna#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
|
||||
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
|
||||
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
|
||||
|
||||
65
autoload/airline/themes/molokai.vim
Normal file
65
autoload/airline/themes/molokai.vim
Normal file
@@ -0,0 +1,65 @@
|
||||
let g:airline#themes#molokai#palette = {}
|
||||
|
||||
let g:airline#themes#molokai#palette.accents = {
|
||||
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode
|
||||
let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info
|
||||
let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline
|
||||
|
||||
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#molokai#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
|
||||
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#molokai#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert)
|
||||
let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
|
||||
let g:airline#themes#molokai#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
|
||||
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#molokai#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Inactive
|
||||
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#molokai#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
|
||||
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
|
||||
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )
|
||||
|
||||
15
autoload/airline/themes/monochrome.vim
Normal file
15
autoload/airline/themes/monochrome.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
let g:airline#themes#monochrome#palette = {}
|
||||
|
||||
function! airline#themes#monochrome#refresh()
|
||||
let s:SL = airline#themes#get_highlight('StatusLine')
|
||||
let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL)
|
||||
let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal
|
||||
|
||||
let s:SLNC = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC)
|
||||
endfunction
|
||||
|
||||
call airline#themes#monochrome#refresh()
|
||||
|
||||
82
autoload/airline/themes/murmur.vim
Normal file
82
autoload/airline/themes/murmur.vim
Normal file
@@ -0,0 +1,82 @@
|
||||
let g:airline#themes#murmur#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:cterm_termbg = 237 " Background for branch and file format blocks
|
||||
let s:gui_termbg = '#5F5F5F'
|
||||
let s:cterm_termfg = 144 " Foreground for branch and file format blocks
|
||||
let s:gui_termfg = '#AFAF87'
|
||||
|
||||
let s:cterm_termbg2 = 234 " Background for middle block
|
||||
let s:gui_termbg2 = '#1C1C1C'
|
||||
let s:cterm_termfg2 = 39 " Foreground for middle block
|
||||
let s:gui_termfg2 = '#F5F5F5'
|
||||
|
||||
let s:cterm_normalbg = 27 " Background for normal mode and file position blocks
|
||||
let s:gui_normalbg = '#5F87FF'
|
||||
let s:cterm_normalfg = 15 " Foreground for normal mode and file position blocks
|
||||
let s:gui_normalfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_insertbg = 70 " Background for insert mode and file position blocks
|
||||
let s:gui_insertbg = '#87AF5F'
|
||||
let s:cterm_insertfg = 15 " Foreground for insert mode and file position blocks
|
||||
let s:gui_insertfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_visualbg = 166 " Background for visual mode and file position blocks
|
||||
let s:gui_visualbg = '#ff8c00'
|
||||
let s:cterm_visualfg = 15 " Foreground for visual mode and file position blocks
|
||||
let s:gui_visualfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_replacebg = 88 " Background for replace mode and file position blocks
|
||||
let s:gui_replacebg = '#870000'
|
||||
let s:cterm_replacefg = 15 " Foreground for replace mode and file position blocks
|
||||
let s:gui_replacefg = '#FFFFFF'
|
||||
|
||||
let s:cterm_alert = 88 " Modified file alert color
|
||||
let s:gui_alert = '#870000'
|
||||
|
||||
let s:cterm_inactivebg = 234 " Background for inactive mode
|
||||
let s:gui_inactivebg = '#1C1C1C'
|
||||
let s:cterm_inactivefg = 239 " Foreground for inactive mode
|
||||
let s:gui_inactivefg = '#4E4E4E'
|
||||
|
||||
" Branch and file format
|
||||
let s:BB = [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg] " Branch and file format blocks
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg] " Outside blocks in normal mode
|
||||
let s:N2 = [s:gui_termfg2, s:gui_termbg2, s:cterm_normalbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.normal = airline#themes#generate_color_map(s:N1, s:BB, s:N2)
|
||||
let g:airline#themes#murmur#palette.normal_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_insertfg, s:gui_insertbg, s:cterm_insertfg, s:cterm_insertbg] " Outside blocks in insert mode
|
||||
let s:I2 = [s:gui_insertbg, s:gui_termbg2, s:cterm_insertbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.insert = airline#themes#generate_color_map(s:I1, s:BB, s:I2)
|
||||
let g:airline#themes#murmur#palette.insert_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:gui_replacefg, s:gui_replacebg, s:cterm_replacefg, s:cterm_replacebg] " Outside blocks in replace mode
|
||||
let s:R2 = [s:gui_termfg, s:gui_termbg2, s:cterm_termfg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.replace = airline#themes#generate_color_map(s:R1, s:BB, s:R2)
|
||||
let g:airline#themes#murmur#palette.replace_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_visualfg, s:gui_visualbg, s:cterm_visualfg, s:cterm_visualbg] " Outside blocks in visual mode
|
||||
let s:V2 = [s:gui_visualbg, s:gui_termbg2, s:cterm_visualbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.visual = airline#themes#generate_color_map(s:V1, s:BB, s:V2)
|
||||
let g:airline#themes#murmur#palette.visual_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Inactive mode
|
||||
let s:IA1 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA2 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA3 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let g:airline#themes#murmur#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
|
||||
" CtrlP plugin colors
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#murmur#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg, ''],
|
||||
\ [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg, ''],
|
||||
\ [s:gui_termfg2, s:gui_termbg2, s:cterm_termfg2, s:cterm_termbg2, 'bold'])
|
||||
46
autoload/airline/themes/powerlineish.vim
Normal file
46
autoload/airline/themes/powerlineish.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Theme to mimic the default colorscheme of powerline
|
||||
" Not 100% the same so it's powerline... ish.
|
||||
"
|
||||
" Differences from default powerline:
|
||||
" * Paste indicator isn't colored different
|
||||
" * Far right hand section matches the color of the mode indicator
|
||||
"
|
||||
" Differences from other airline themes:
|
||||
" * No color differences when you're in a modified buffer
|
||||
" * Visual mode only changes the mode section. Otherwise
|
||||
" it appears the same as normal mode
|
||||
|
||||
" Normal mode " fg & bg
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] " darkestgreen & brightgreen
|
||||
let s:N2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] " gray8 & gray2
|
||||
let s:N3 = [ '#ffffff' , '#121212' , 231 , 233 ] " white & gray4
|
||||
|
||||
" Insert mode " fg & bg
|
||||
let s:I1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] " darkestcyan & white
|
||||
let s:I2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] " darkcyan & darkblue
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] " mediumcyan & darkestblue
|
||||
|
||||
" Visual mode " fg & bg
|
||||
let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestorange
|
||||
|
||||
" Replace mode " fg & bg
|
||||
let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred
|
||||
|
||||
let g:airline#themes#powerlineish#palette = {}
|
||||
|
||||
let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#powerlineish#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#powerlineish#palette.insert_replace = {
|
||||
\ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.visual = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.replace = copy(airline#themes#powerlineish#palette.normal)
|
||||
let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ]
|
||||
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
|
||||
85
autoload/airline/themes/raven.vim
Normal file
85
autoload/airline/themes/raven.vim
Normal file
@@ -0,0 +1,85 @@
|
||||
let g:airline#themes#raven#palette = {}
|
||||
|
||||
let g:airline#themes#raven#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N2 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let g:airline#themes#raven#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#raven#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I2 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I3 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let g:airline#themes#raven#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#raven#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#raven#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#2e2e2e' , s:I1[2] , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.replace = copy(g:airline#themes#raven#palette.insert)
|
||||
let g:airline#themes#raven#palette.replace.airline_a = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace.airline_z = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace_modified = g:airline#themes#raven#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V2 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V3 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let g:airline#themes#raven#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#raven#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#5e5e5e' , '#222222' , 59 , 235 , '' ]
|
||||
let g:airline#themes#raven#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#raven#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.tabline = {
|
||||
\ 'airline_tab': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabsel': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ 'airline_tabtype': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabfill': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabmod': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#2e2e2e', 196, 235 ]
|
||||
let g:airline#themes#raven#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#raven#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#raven#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#2e2e2e' , '#a4c639' , 235 , 149 , '' ] )
|
||||
41
autoload/airline/themes/serene.vim
Normal file
41
autoload/airline/themes/serene.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
let g:airline#themes#serene#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:termbg = 232
|
||||
let s:termsep = 236
|
||||
let s:guisep = '#303030'
|
||||
|
||||
let s:N1 = [ '#00dfff' , s:guibg , 45 , s:termbg ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:N3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
|
||||
let g:airline#themes#serene#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#serene#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#5fff00' , s:guibg , 82 , s:termbg ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:I3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#serene#palette.insert_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
let g:airline#themes#serene#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#serene#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#serene#palette.replace_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:V1 = [ '#dfdf00' , s:guibg , 184 , s:termbg ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:V3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#serene#palette.visual_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guisep , 239 , s:termsep , '' ]
|
||||
let g:airline#themes#serene#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
85
autoload/airline/themes/silver.vim
Normal file
85
autoload/airline/themes/silver.vim
Normal file
@@ -0,0 +1,85 @@
|
||||
let g:airline#themes#silver#palette = {}
|
||||
|
||||
let g:airline#themes#silver#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N2 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N3 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let g:airline#themes#silver#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#silver#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I2 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I3 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let g:airline#themes#silver#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#silver#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#silver#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#e1e1e1' , s:I1[2] , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.replace = copy(g:airline#themes#silver#palette.insert)
|
||||
let g:airline#themes#silver#palette.replace.airline_a = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace.airline_z = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace_modified = g:airline#themes#silver#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V2 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V3 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let g:airline#themes#silver#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#silver#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#a1a1a1' , '#dddddd' , 145 , 188 , '' ]
|
||||
let g:airline#themes#silver#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#silver#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.tabline = {
|
||||
\ 'airline_tab': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabsel': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ 'airline_tabtype': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabfill': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabmod': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#e1e1e1', 196, 188 ]
|
||||
let g:airline#themes#silver#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#silver#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#silver#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#e1e1e1' , '#007599' , 188 , 30 , '' ] )
|
||||
46
autoload/airline/themes/simple.vim
Normal file
46
autoload/airline/themes/simple.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
let g:airline#themes#simple#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:guibg2 = '#1c1c1c'
|
||||
let s:termbg = 232
|
||||
let s:termbg2= 234
|
||||
|
||||
let s:N1 = [ s:guibg , '#00dfff' , s:termbg , 45 ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg]
|
||||
let g:airline#themes#simple#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#simple#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ s:guibg, '#5fff00' , s:termbg , 82 ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:I3 = [ '#767676' , s:guibg, 243 , s:termbg ]
|
||||
let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#simple#palette.insert_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
let g:airline#themes#simple#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#simple#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
|
||||
|
||||
let s:V1 = [ s:guibg, '#dfdf00' , s:termbg , 184 ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:V3 = [ '#767676' , s:guibg, 243 , s:termbg ]
|
||||
let g:airline#themes#simple#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#simple#palette.visual_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guibg2 , 239 , s:termbg2 , '' ]
|
||||
let g:airline#themes#simple#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#simple#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000', '', 160, '', '' ] ,
|
||||
\ }
|
||||
|
||||
90
autoload/airline/themes/sol.vim
Normal file
90
autoload/airline/themes/sol.vim
Normal file
@@ -0,0 +1,90 @@
|
||||
" vim-airline companion theme of Sol
|
||||
" (https://github.com/Pychimp/vim-sol)
|
||||
|
||||
let g:airline#themes#sol#palette = {}
|
||||
|
||||
let g:airline#themes#sol#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#343434' , '#a0a0a0' , 237 , 248 ]
|
||||
let s:N2 = [ '#343434' , '#b3b3b3' , 237 , 250 ]
|
||||
let s:N3 = [ '#343434' , '#c7c7c7' , 237 , 252 ]
|
||||
let g:airline#themes#sol#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#sol#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#ff6868' , 237 , 209 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#eeeeee' , '#09643f' , 255 , 30 ]
|
||||
let s:I2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:I3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#sol#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#sol#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#09643f' , s:I1[2] , 30 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#sol#palette.replace = copy(g:airline#themes#sol#palette.insert)
|
||||
let g:airline#themes#sol#palette.replace.airline_a = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace.airline_z = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace_modified = g:airline#themes#sol#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff6003' , 222 , 202 ]
|
||||
let s:V2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:V3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#sol#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#777777' , '#c7c7c7' , 244 , 251 , '' ]
|
||||
let g:airline#themes#sol#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#sol#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#ff3535' , '' , 203 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#sol#palette.tabline = {
|
||||
\ 'airline_tab': ['#343434', '#b3b3b3', 237, 250, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#004b9a', 231, 31 , ''],
|
||||
\ 'airline_tabtype': ['#343434', '#a0a0a0', 237, 248, ''],
|
||||
\ 'airline_tabfill': ['#343434', '#c7c7c7', 237, 251, ''],
|
||||
\ 'airline_tabmod': ['#343434', '#ffdbc7', 237, 216, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#eeeeee', '#e33900', 255, 166 ]
|
||||
let g:airline#themes#sol#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#sol#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#sol#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#343434' , '#c7c7c7' , 237 , 251 , '' ] ,
|
||||
\ [ '#343434' , '#b3b3b3' , 237 , 250 , '' ] ,
|
||||
\ [ '#eeeeee' , '#007fff' , 255 , 27 , '' ] )
|
||||
176
autoload/airline/themes/solarized.vim
Normal file
176
autoload/airline/themes/solarized.vim
Normal file
@@ -0,0 +1,176 @@
|
||||
let g:airline#themes#solarized#palette = {}
|
||||
|
||||
function! airline#themes#solarized#refresh()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:background = get(g:, 'airline_solarized_bg', &background)
|
||||
let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0
|
||||
let s:tty = &t_Co == 8
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colors
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Base colors
|
||||
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#002b36'}
|
||||
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#073642'}
|
||||
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#586e75'}
|
||||
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#657b83'}
|
||||
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#839496'}
|
||||
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#93a1a1'}
|
||||
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#eee8d5'}
|
||||
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 230), 'g': '#fdf6e3'}
|
||||
let s:yellow = {'t': s:ansi_colors ? 3 : (s:tty ? '3' : 136), 'g': '#b58900'}
|
||||
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#cb4b16'}
|
||||
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#dc322f'}
|
||||
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#d33682'}
|
||||
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6c71c4'}
|
||||
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#268bd2'}
|
||||
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#2aa198'}
|
||||
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#859900'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
" NOTE: These are easily tweakable mappings. The actual mappings get
|
||||
" the specific gui and terminal colors from the base color dicts.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Normal mode
|
||||
if s:background == 'dark'
|
||||
let s:N1 = [s:base3, s:base1, 'bold']
|
||||
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
|
||||
let s:N3 = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:N1 = [s:base2, s:base00, 'bold']
|
||||
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
|
||||
let s:N3 = [s:base1, s:base2, '']
|
||||
endif
|
||||
let s:NF = [s:orange, s:N3[1], '']
|
||||
let s:NW = [s:base3, s:orange, '']
|
||||
if s:background == 'dark'
|
||||
let s:NM = [s:base1, s:N3[1], '']
|
||||
let s:NMi = [s:base2, s:N3[1], '']
|
||||
else
|
||||
let s:NM = [s:base01, s:N3[1], '']
|
||||
let s:NMi = [s:base02, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:N1[0], s:yellow, 'bold']
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:N1[0], s:magenta, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let s:VF = s:NF
|
||||
let s:VM = s:NM
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:N1[0], s:red, '']
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let s:RM = s:NM
|
||||
let s:RF = s:NF
|
||||
|
||||
" Inactive, according to VertSplit in solarized
|
||||
" (bg dark: base00; bg light: base0)
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base02, s:base00, '']
|
||||
else
|
||||
let s:IA = [s:base2, s:base0, '']
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Actual mappings
|
||||
" WARNING: Don't modify this section unless necessary.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
|
||||
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
|
||||
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
|
||||
let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.accents = {
|
||||
\ 'red': s:NFa,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#solarized#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
|
||||
let g:airline#themes#solarized#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.normal = airline#themes#generate_color_map(
|
||||
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
|
||||
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
|
||||
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.normal.airline_warning = [
|
||||
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.normal_modified = {
|
||||
\ 'airline_c': [s:NM[0].g, s:NM[1].g,
|
||||
\ s:NM[0].t, s:NM[1].t, s:NM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.insert = airline#themes#generate_color_map(
|
||||
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
|
||||
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
|
||||
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.insert.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified = {
|
||||
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
|
||||
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual = airline#themes#generate_color_map(
|
||||
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
|
||||
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.visual.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified = {
|
||||
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
|
||||
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace = airline#themes#generate_color_map(
|
||||
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
|
||||
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
|
||||
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.replace.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified = {
|
||||
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
|
||||
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline = {}
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tab = [
|
||||
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tabtype = [
|
||||
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
|
||||
endfunction
|
||||
|
||||
call airline#themes#solarized#refresh()
|
||||
|
||||
44
autoload/airline/themes/tomorrow.vim
Normal file
44
autoload/airline/themes/tomorrow.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
let g:airline#themes#tomorrow#palette = {}
|
||||
|
||||
function! airline#themes#tomorrow#refresh()
|
||||
let g:airline#themes#tomorrow#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Directory', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Pmenu')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#tomorrow#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#tomorrow#palette.normal_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['MoreMsg', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['MoreMsg', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#tomorrow#palette.insert_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('Error', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#tomorrow#palette.replace_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#tomorrow#palette.visual_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#tomorrow#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#tomorrow#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#tomorrow#refresh()
|
||||
|
||||
64
autoload/airline/themes/ubaryd.vim
Normal file
64
autoload/airline/themes/ubaryd.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
" vim-airline companion theme of Ubaryd
|
||||
" (https://github.com/Donearm/Ubaryd)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#141413' , '#c7b386' , 232 , 252 ] " blackestgravel & bleaksand
|
||||
let s:N2 = [ '#c7b386' , '#45413b' , 252, 238 ] " bleaksand & deepgravel
|
||||
let s:N3 = [ '#b88853' , '#242321' , 137, 235 ] " toffee & darkgravel
|
||||
let s:N4 = [ '#857f78' , 243 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn
|
||||
let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel
|
||||
let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe
|
||||
let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino
|
||||
let s:V3 = [ '#88633f' , '#c7b386' , 95 , 252 ] " cappuccino & bleaksand
|
||||
let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#c7915b' , 173 ] " nut
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon
|
||||
|
||||
let s:IA = [ s:N2[1], s:N3[1], s:N2[3], s:N3[3], '' ]
|
||||
|
||||
let g:airline#themes#ubaryd#palette = {}
|
||||
|
||||
let g:airline#themes#ubaryd#palette.accents = {
|
||||
\ 'red': [ '#ff7400' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = {
|
||||
\ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#ubaryd#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#ubaryd#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#ubaryd#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.replace = copy(airline#themes#ubaryd#palette.insert)
|
||||
let g:airline#themes#ubaryd#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#ubaryd#palette.replace_modified = g:airline#themes#ubaryd#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#ubaryd#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#ubaryd#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
43
autoload/airline/themes/understated.vim
Normal file
43
autoload/airline/themes/understated.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
let g:airline#themes#understated#palette = {}
|
||||
|
||||
let s:N1 = ['#FFFFFF', '#5F87FF', 15, 69] " Outside blocks in normal mode (mode and file position)
|
||||
let s:N2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:N3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
|
||||
let g:airline#themes#understated#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#understated#palette.normal_modified = {'airline_c': ['#ffffff', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:I1 = ['#FFFFFF', '#87AF5F', 15, 107] " Outside blocks in normal mode (mode and file position)
|
||||
let s:I2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:I3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
let g:airline#themes#understated#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.insert_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
let g:airline#themes#understated#palette.insert_paste = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, ''] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.replace = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.replace.airline_a = ['#FFFFFF', '#870000', 15, 88, '']
|
||||
let g:airline#themes#understated#palette.replace_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#FFFFFF', '#AF5F00', 15, 130]
|
||||
let s:V2 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let s:V3 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let g:airline#themes#understated#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#understated#palette.visual_modified = {'airline_c': [ '#AFAF87', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#080808', '#FFAF00', 232, 214]
|
||||
let s:IA1 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA2 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA3 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let g:airline#themes#understated#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#understated#palette.inactive_modified = {'airline_c': ['#4E4E4E', '', 239, '', 'bold'] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.accents = {'red': ['#FF0000', '', 88, '']}
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#understated#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ ['#FFFFFF', '#1C1C1C', 15, 234, '' ],
|
||||
\ ['#FFFFFF', '#262626', 15, 235, '' ],
|
||||
\ ['#FFFFFF', '#303030', 15, 236, 'bold'])
|
||||
|
||||
90
autoload/airline/themes/wombat.vim
Normal file
90
autoload/airline/themes/wombat.vim
Normal file
@@ -0,0 +1,90 @@
|
||||
" vim-airline companion theme of Wombat
|
||||
" looks great with wombat256 vim colorscheme
|
||||
|
||||
" Normal mode
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]
|
||||
let s:N1 = [ '#141413' , '#CAE682' , 232 , 192 ] " mode
|
||||
let s:N2 = [ '#CAE682' , '#32322F' , 192 , 236 ] " info
|
||||
let s:N3 = [ '#CAE682' , '#242424' , 192 , 234 ] " statusline
|
||||
let s:N4 = [ '#86CD74' , 113 ] " mode modified
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 227 ]
|
||||
let s:I2 = [ '#FDE76E' , '#32322F' , 227 , 236 ]
|
||||
let s:I3 = [ '#FDE76E' , '#242424' , 227 , 234 ]
|
||||
let s:I4 = [ '#FADE3E' , 221 ]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 153 ]
|
||||
let s:V2 = [ '#B5D3F3' , '#32322F' , 153 , 236 ]
|
||||
let s:V3 = [ '#B5D3F3' , '#242424' , 153 , 234 ]
|
||||
let s:V4 = [ '#7CB0E6' , 111 ]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#141413' , '#E5786D' , 232 , 173 ]
|
||||
let s:R2 = [ '#E5786D' , '#32322F' , 173 , 236 ]
|
||||
let s:R3 = [ '#E5786D' , '#242424' , 173 , 234 ]
|
||||
let s:R4 = [ '#E55345' , 203 ]
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#94E42C' , 47 ]
|
||||
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 238 ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#wombat#palette = {}
|
||||
|
||||
let g:airline#themes#wombat#palette.accents = {
|
||||
\ 'red': [ '#E5786D' , '' , 203 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#wombat#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#wombat#palette.normal_modified = {
|
||||
\ 'airline_a': [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:N4[0] , s:N3[1] , s:N4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#wombat#palette.insert_modified = {
|
||||
\ 'airline_a': [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:I4[0] , s:N3[1] , s:I4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#wombat#palette.visual_modified = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V4[0] , s:N3[1] , s:V4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#wombat#palette.replace_modified = {
|
||||
\ 'airline_a': [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:R4[0] , s:N3[1] , s:R4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
|
||||
\ 'airline_b': [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:PA[0] , s:N3[1] , s:PA[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#wombat#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#wombat#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
|
||||
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
|
||||
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )
|
||||
|
||||
44
autoload/airline/themes/zenburn.vim
Normal file
44
autoload/airline/themes/zenburn.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
let g:airline#themes#zenburn#palette = {}
|
||||
|
||||
function! airline#themes#zenburn#refresh()
|
||||
let g:airline#themes#zenburn#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Folded', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#zenburn#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let s:Nmod = airline#themes#get_highlight('Comment')
|
||||
let g:airline#themes#zenburn#palette.normal_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['String', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['String', 'fg'], ['Folded', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#zenburn#palette.insert_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Comment', 'fg'], 'bold')
|
||||
let s:R2 = airline#themes#get_highlight2(['Comment', 'fg'], ['Folded', 'bg'])
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#zenburn#palette.replace_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Identifier', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Identifier', 'fg'], ['Folded', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#zenburn#palette.visual_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight('NonText')
|
||||
let g:airline#themes#zenburn#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#zenburn#palette.inactive_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#zenburn#refresh()
|
||||
|
||||
@@ -1,25 +1,9 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#util#shorten(text, winwidth, minwidth, ...)
|
||||
if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
|
||||
if get(a:000, 0, 0)
|
||||
" shorten from tail
|
||||
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$')
|
||||
else
|
||||
" shorten from beginning of string
|
||||
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
|
||||
endif
|
||||
else
|
||||
return a:text
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#util#wrap(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
@@ -35,12 +19,6 @@ function! airline#util#append(text, minwidth)
|
||||
return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#warning(msg)
|
||||
echohl WarningMsg
|
||||
echomsg "airline: ".a:msg
|
||||
echohl Normal
|
||||
endfunction
|
||||
|
||||
function! airline#util#prepend(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
@@ -84,30 +62,3 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Define a wrapper over system() that uses nvim's async job control if
|
||||
" available. This way we avoid overwriting v:shell_error, which might
|
||||
" potentially disrupt other plugins.
|
||||
if has('nvim')
|
||||
function! s:system_job_handler(job_id, data, event) dict
|
||||
if a:event == 'stdout'
|
||||
let self.buf .= join(a:data)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#util#system(cmd)
|
||||
let l:config = {
|
||||
\ 'buf': '',
|
||||
\ 'on_stdout': function('s:system_job_handler'),
|
||||
\ }
|
||||
let l:id = jobstart(a:cmd, l:config)
|
||||
if l:id < 1
|
||||
return system(a:cmd)
|
||||
endif
|
||||
call jobwait([l:id])
|
||||
return l:config.buf
|
||||
endfunction
|
||||
else
|
||||
function! airline#util#system(cmd)
|
||||
return system(a:cmd)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
566
doc/airline.txt
566
doc/airline.txt
@@ -1,5 +1,5 @@
|
||||
*airline.txt* Lean and mean status/tabline that's light as air
|
||||
*airline* *vim-airline*
|
||||
*airline*
|
||||
_ _ _ _ ~
|
||||
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
|
||||
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
|
||||
@@ -14,17 +14,16 @@ CONTENTS *airline-contents*
|
||||
03. Name ................................................. |airline-name|
|
||||
04. Configuration ............................... |airline-configuration|
|
||||
05. Commands ......................................... |airline-commands|
|
||||
06. Autocommands ................................. |airline-autocommands|
|
||||
07. Customization ............................... |airline-customization|
|
||||
08. Extensions ..................................... |airline-extensions|
|
||||
09. Advanced Customization ............. |airline-advanced-customization|
|
||||
10. Funcrefs ......................................... |airline-funcrefs|
|
||||
11. Pipeline ......................................... |airline-pipeline|
|
||||
12. Writing Extensions ..................... |airline-writing-extensions|
|
||||
13. Writing Themes ..................................... |airline-themes|
|
||||
14. Troubleshooting ........................... |airline-troubleshooting|
|
||||
15. Contributions ............................... |airline-contributions|
|
||||
16. License ........................................... |airline-license|
|
||||
06. Customization ............................... |airline-customization|
|
||||
07. Extensions ..................................... |airline-extensions|
|
||||
08. Advanced Customization ............. |airline-advanced-customization|
|
||||
09. Funcrefs ......................................... |airline-funcrefs|
|
||||
10. Pipeline ......................................... |airline-pipeline|
|
||||
11. Writing Extensions ..................... |airline-writing-extensions|
|
||||
12. Writing Themes ..................................... |airline-themes|
|
||||
13. Troubleshooting ........................... |airline-troubleshooting|
|
||||
14. Contributions ............................... |airline-contributions|
|
||||
15. License ........................................... |airline-license|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *airline-intro*
|
||||
@@ -32,62 +31,6 @@ INTRODUCTION *airline-intro*
|
||||
vim-airline is a fast and lightweight alternative to powerline, written
|
||||
in 100% vimscript with no outside dependencies.
|
||||
|
||||
When the plugin is correctly loaded, and Vim is configured for drawing a
|
||||
'statusline' (set 'laststatus' to 2, to always display the airline
|
||||
statusline) Vim will draw a nice statusline at the bottom of each window.
|
||||
|
||||
That line consists of several sections, each one displaying some piece of
|
||||
information. By default (without configuration) this line will look like this: >
|
||||
|
||||
+-----------------------------------------------------------------------------+
|
||||
|~ |
|
||||
|~ |
|
||||
|~ VIM - Vi IMproved |
|
||||
|~ |
|
||||
|~ version 8.0 |
|
||||
|~ by Bram Moolenaar et al. |
|
||||
|~ Vim is open source and freely distributable |
|
||||
|~ |
|
||||
|~ type :h :q<Enter> to exit |
|
||||
|~ type :help<Enter> or <F1> for on-line help |
|
||||
|~ type :help version8<Enter> for version info |
|
||||
|~ |
|
||||
|~ |
|
||||
+-----------------------------------------------------------------------------+
|
||||
| A | B | C X | Y | Z | [...] |
|
||||
+-----------------------------------------------------------------------------+
|
||||
|
||||
The statusline is the colored line at the bottom, which contains the sections
|
||||
(possibly in different colors):
|
||||
|
||||
section meaning (example)~
|
||||
--------------------------
|
||||
A displays the mode + additional flags like crypt/spell/paste (INSERT)
|
||||
B VCS information (branch, hunk summary) (master)
|
||||
C filename + read-only flag (~/.vim/vimrc RO)
|
||||
X filetype (vim)
|
||||
Y file encoding[fileformat] (utf-8[unix])
|
||||
Z current position in the file
|
||||
percentage % ☰ current line/number of lines ln : column
|
||||
So this: 10% ☰ 10/100 ln : 20 means: >
|
||||
10% - 10 percent
|
||||
☰ 10 - current line 10
|
||||
/100 ln - of 100 lines
|
||||
: 20 - current column 20
|
||||
<
|
||||
[...] additional sections (warning/errors/statistics)
|
||||
from external plugins (e.g. YCM/syntastic/...)
|
||||
|
||||
For a better look, those sections can be colored differently, depending on the mode and
|
||||
whether the current file is 'modified'
|
||||
|
||||
Additionally, several extensions exists, that can provide additional feature (e.g. the
|
||||
tabline extension provides an extra statusline on the top of the Vim window and can
|
||||
display loaded buffers and tabs in the current Vim session).
|
||||
|
||||
Most of this is customizable and the default sections can be configured using the vim
|
||||
variables g:airline_section_<name> (see |airline-default-sections|)
|
||||
|
||||
==============================================================================
|
||||
FEATURES *airline-features*
|
||||
|
||||
@@ -126,12 +69,6 @@ values):
|
||||
* enable paste detection >
|
||||
let g:airline_detect_paste=1
|
||||
<
|
||||
* enable crypt detection >
|
||||
let g:airline_detect_crypt=1
|
||||
|
||||
* enable spell detection >
|
||||
let g:airline_detect_spell=1
|
||||
<
|
||||
* enable iminsert detection >
|
||||
let g:airline_detect_iminsert=0
|
||||
<
|
||||
@@ -141,12 +78,8 @@ values):
|
||||
<
|
||||
* themes are automatically selected based on the matching colorscheme. this
|
||||
can be overridden by defining a value. >
|
||||
let g:airline_theme='dark'
|
||||
let g:airline_theme=
|
||||
<
|
||||
Note: Only the dark theme is distributed with vim-airline. For more themes,
|
||||
checkout the vim-airline-themes repository
|
||||
(github.com/vim-airline/vim-airline-themes)
|
||||
|
||||
* if you want to patch the airline theme before it gets applied, you can
|
||||
supply the name of a function where you can modify the palette. >
|
||||
let g:airline_theme_patch_func = 'AirlineThemePatch'
|
||||
@@ -158,12 +91,9 @@ values):
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
* By default, airline will use unicode symbols if your encoding matches
|
||||
utf-8. If you want the powerline symbols set this variable: >
|
||||
let g:airline_powerline_fonts = 1
|
||||
<
|
||||
If you want to use plain ascii symbols, set this variable: >
|
||||
let g:airline_symbols_ascii = 1
|
||||
* enable/disable automatic population of the `g:airline_symbols` dictionary
|
||||
with powerline symbols. >
|
||||
let g:airline_powerline_fonts=0
|
||||
<
|
||||
* define the set of text to display for each mode. >
|
||||
let g:airline_mode_map = {} " see source for the defaults
|
||||
@@ -199,14 +129,8 @@ values):
|
||||
* disable the Airline customization for selective windows (this is a
|
||||
window-local variable so you can disable it for only some windows) >
|
||||
let w:airline_disabled = 1
|
||||
<
|
||||
|
||||
* Do not draw separators for empty sections (only for the active window) >
|
||||
let g:airline_skip_empty_sections = 1
|
||||
<
|
||||
This variable can be overriden by setting a window-local variable with
|
||||
the same name (in the correct window): >
|
||||
let w:airline_skip_empty_sections = 0
|
||||
<
|
||||
==============================================================================
|
||||
COMMANDS *airline-commands*
|
||||
|
||||
@@ -222,26 +146,14 @@ COMMANDS *airline-commands*
|
||||
:AirlineRefresh *:AirlineRefresh*
|
||||
Refreshes all highlight groups and redraws the statusline.
|
||||
|
||||
==============================================================================
|
||||
AUTOCOMMANDS *airline-autocommands*
|
||||
|
||||
Airline comes with some user-defined autocommands.
|
||||
|
||||
|AirlineAfterInit| after plugin is initialized, but before the statusline
|
||||
is replaced
|
||||
|AirlineAfterTheme| after theme of the statusline has been changed
|
||||
|AirlineToggledOn| after airline is activated and replaced the statusline
|
||||
|AirlineToggledOff| after airline is deactivated and the statusline is
|
||||
restored to the original
|
||||
|
||||
==============================================================================
|
||||
CUSTOMIZATION *airline-customization*
|
||||
|
||||
The following are some unicode symbols for customizing the left/right
|
||||
separators, as well as the powerline font glyphs.
|
||||
separators, as well as the powerline font glyths.
|
||||
|
||||
Note: You must define the dictionary first before setting values. Also, it's a
|
||||
good idea to check whether it exists as to avoid accidentally overwriting
|
||||
good idea to check whether if it exists as to avoid accidentally overwritting
|
||||
its contents. >
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
@@ -252,18 +164,13 @@ its contents. >
|
||||
let g:airline_left_sep = '▶'
|
||||
let g:airline_right_sep = '«'
|
||||
let g:airline_right_sep = '◀'
|
||||
let g:airline_symbols.crypt = '🔒'
|
||||
let g:airline_symbols.linenr = '␊'
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.linenr = '¶'
|
||||
let g:airline_symbols.maxlinenr = '☰'
|
||||
let g:airline_symbols.maxlinenr = ''
|
||||
let g:airline_symbols.branch = '⎇'
|
||||
let g:airline_symbols.paste = 'ρ'
|
||||
let g:airline_symbols.paste = 'Þ'
|
||||
let g:airline_symbols.paste = '∥'
|
||||
let g:airline_symbols.spell = 'Ꞩ'
|
||||
let g:airline_symbols.notexists = '∄'
|
||||
let g:airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
" powerline symbols
|
||||
@@ -292,24 +199,21 @@ Note: If you define any section variables it will replace the default values
|
||||
entirely. If you want to disable only certain parts of a section you can try
|
||||
using variables defined in the |airline-configuration| or |airline-extensions|
|
||||
section.
|
||||
|airline-default-sections|
|
||||
>
|
||||
variable names default contents
|
||||
----------------------------------------------------------------------------
|
||||
let g:airline_section_a (mode, crypt, paste, spell, iminsert)
|
||||
let g:airline_section_a (mode, paste, iminsert)
|
||||
let g:airline_section_b (hunks, branch)
|
||||
let g:airline_section_c (bufferline or filename)
|
||||
let g:airline_section_gutter (readonly, csv)
|
||||
let g:airline_section_x (tagbar, filetype, virtualenv)
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
let g:airline_section_error (ycm_error_count, syntastic-err, eclim)
|
||||
let g:airline_section_warning (ycm_warning_count, syntastic-warn, whitespace)
|
||||
let g:airline_section_warning (syntastic, whitespace)
|
||||
|
||||
" here is an example of how you could replace the branch indicator with
|
||||
" the current working directory (limited to 10 characters),
|
||||
" followed by the filename.
|
||||
let g:airline_section_b = '%-0.10{getcwd()}'
|
||||
" the current working directory, followed by the filename.
|
||||
let g:airline_section_b = '%{getcwd()}'
|
||||
let g:airline_section_c = '%t'
|
||||
<
|
||||
==============================================================================
|
||||
@@ -319,22 +223,13 @@ Most extensions are enabled by default and lazily loaded when the
|
||||
corresponding plugin (if any) is detected.
|
||||
|
||||
By default, airline will attempt to load any extension it can find in the
|
||||
'runtimepath'. On some systems this can result in an undesirable startup
|
||||
'runtimepath'. On some systems this can result in an undersirable startup
|
||||
cost. You can disable the check with the following flag. >
|
||||
let g:airline#extensions#disable_rtp_load = 1
|
||||
<
|
||||
Note: Third party plugins that rely on this behavior will be affected. You
|
||||
will need to manually load them.
|
||||
|
||||
Alternatively, if you want a minimalistic setup and would rather opt-in which
|
||||
extensions get loaded instead of disabling each individually, you can declare
|
||||
the following list variable: >
|
||||
" an empty list disables all extensions
|
||||
let g:airline_extensions = []
|
||||
|
||||
" or only load what you want
|
||||
let g:airline_extensions = ['branch', 'tabline']
|
||||
<
|
||||
------------------------------------- *airline-default*
|
||||
The default extension understands all of the `g:` variables in the
|
||||
|airline-configuration| section, however it also has some more fine-tuned
|
||||
@@ -346,30 +241,18 @@ configuration values that you can use.
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ 'warning': 80,
|
||||
\ 'error': 80,
|
||||
\ }
|
||||
|
||||
" Note: set to an empty dictionary to disable truncation.
|
||||
let g:airline#extensions#default#section_truncate_width = {}
|
||||
<
|
||||
* configure the layout of the sections by specifying an array of two arrays
|
||||
* configure the layout of the sections by specificing an array of two arrays
|
||||
(first array is the left side, second array is the right side). >
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'error', 'warning' ]
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ]
|
||||
<
|
||||
* configure the layout to not use %(%) grouping items in the statusline.
|
||||
Try setting this to zero, if you notice bleeding color artifacts >
|
||||
let airline#extensions#default#section_use_groupitems = 1
|
||||
<
|
||||
* configure the fileformat output
|
||||
By default, it will display something like 'utf-8[unix]', however, you can
|
||||
skip displaying it, if the output matches a configured string. To do so,
|
||||
set >
|
||||
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
|
||||
<
|
||||
------------------------------------- *airline-quickfix*
|
||||
The quickfix extension is a simple built-in extension which determines
|
||||
whether the buffer is a quickfix or location list buffer, and adjusts the
|
||||
@@ -392,66 +275,27 @@ vim-bufferline <https://github.com/bling/vim-bufferline>
|
||||
let g:airline#extensions#bufferline#overwrite_variables = 1
|
||||
<
|
||||
------------------------------------- *airline-branch*
|
||||
|
||||
vim-airline will display the branch-indicator together with the branch name in
|
||||
the statusline, if one of the following plugins is installed:
|
||||
|
||||
fugitive.vim <https://github.com/tpope/vim-fugitive>
|
||||
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
|
||||
|
||||
If a file is edited, that is not yet in the repository, the
|
||||
notexists symbol will be displayed after the branch name.
|
||||
|
||||
* enable/disable fugitive/lawrencium integration >
|
||||
let g:airline#extensions#branch#enabled = 1
|
||||
<
|
||||
* change the text for when no branch is detected >
|
||||
let g:airline#extensions#branch#empty_message = ''
|
||||
<
|
||||
* define the order in which the branches of different vcs systems will be
|
||||
displayed on the statusline (currently only for fugitive and lawrencium) >
|
||||
let g:airline#extensions#branch#vcs_priority = ["git", "mercurial"]
|
||||
<
|
||||
|
||||
* use vcscommand.vim if available >
|
||||
let g:airline#extensions#branch#use_vcscommand = 0
|
||||
<
|
||||
|
||||
* truncate long branch names to a fixed length >
|
||||
let g:airline#extensions#branch#displayed_head_limit = 10
|
||||
<
|
||||
* customize formatting of branch name >
|
||||
" default value leaves the name unmodifed
|
||||
let g:airline#extensions#branch#format = 0
|
||||
|
||||
" to only show the tail, e.g. a branch 'feature/foo' becomes 'foo', use
|
||||
let g:airline#extensions#branch#format = 1
|
||||
|
||||
" to truncate all path sections but the last one, e.g. a branch
|
||||
" 'foo/bar/baz' becomes 'f/b/baz', use
|
||||
let g:airline#extensions#branch#format = 2
|
||||
|
||||
" if a string is provided, it should be the name of a function that
|
||||
" takes a string and returns the desired value
|
||||
let g:airline#extensions#branch#format = 'CustomBranchName'
|
||||
function! CustomBranchName(name)
|
||||
return '[' . a:name . ']'
|
||||
endfunction
|
||||
<
|
||||
------------------------------------- *airline-syntastic*
|
||||
syntastic <https://github.com/vim-syntastic/syntastic>
|
||||
syntastic <https://github.com/scrooloose/syntastic>
|
||||
|
||||
* enable/disable syntastic integration >
|
||||
let g:airline#extensions#syntastic#enabled = 1
|
||||
|
||||
Note: The recommendation from syntastic to modify the statusline directly
|
||||
does not apply, if you use vim-airline, since it will take care for you of
|
||||
adjusting the statusline.
|
||||
|
||||
* syntastic error_symbol >
|
||||
let airline#extensions#syntastic#error_symbol = 'E:'
|
||||
<
|
||||
* syntastic warning >
|
||||
let airline#extensions#syntastic#warning_symbol = 'W:'
|
||||
<
|
||||
------------------------------------- *airline-tagbar*
|
||||
tagbar <https://github.com/majutsushi/tagbar>
|
||||
@@ -479,7 +323,6 @@ csv.vim <https://github.com/chrisbra/csv.vim>
|
||||
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
|
||||
vim-signify <https://github.com/mhinz/vim-signify>
|
||||
changesPlugin <https://github.com/chrisbra/changesPlugin>
|
||||
quickfixsigns <https://github.com/tomtom/quickfixsigns_vim>
|
||||
|
||||
* enable/disable showing a summary of changed hunks under source control. >
|
||||
let g:airline#extensions#hunks#enabled = 1
|
||||
@@ -490,12 +333,6 @@ quickfixsigns <https://github.com/tomtom/quickfixsigns_vim>
|
||||
* set hunk count symbols. >
|
||||
let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-']
|
||||
<
|
||||
------------------------------------- *airline-vimagit*
|
||||
vimagit <https://github.com/jreybert/vimagit>
|
||||
|
||||
* enable/disable vimagit integration >
|
||||
let g:airline#extensions#vimagit#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-ctrlp*
|
||||
ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
|
||||
@@ -524,42 +361,10 @@ eclim <https://eclim.org>
|
||||
|airline-syntastic| extension. >
|
||||
let g:airline#extensions#eclim#enabled = 1
|
||||
|
||||
------------------------------------- *airline-wordcount*
|
||||
* enable/disable word counting. >
|
||||
let g:airline#extensions#wordcount#enabled = 1
|
||||
<
|
||||
* regex of filetypes to enable word counting. >
|
||||
" the default value matches filetypes typically used for documentation
|
||||
" such as markdown and help files.
|
||||
let g:airline#extensions#wordcount#filetypes = ...
|
||||
(default: markdown,rst,org,help,text,tex,mail)
|
||||
|
||||
* defines the name of a formatter for word count will be displayed: >
|
||||
" The default will try to guess LC_NUMERIC and format number accordingly
|
||||
" e.g. 1,042 in English and 1.042 in German locale
|
||||
let g:airline#extensions#wordcount#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
" create a file in the dir autoload/airline/extensions/wordcount/formatters/
|
||||
" called foo.vim
|
||||
" this example needs at least Vim > 7.4.1042
|
||||
function! airline#extensions#wordcount#formatters#foo#format()
|
||||
return (wordcount()['words'] == 0 ? 'NONE' :
|
||||
\ wordcount()['words'] > 100 ? 'okay' : 'not enough')
|
||||
endfunction
|
||||
let g:airline#extensions#wordline#formatter = 'foo'
|
||||
|
||||
* defines how to display the wordcount statistics: >
|
||||
let g:airline#extensions#wordcount#format = '%d words'
|
||||
<
|
||||
------------------------------------- *airline-whitespace*
|
||||
* enable/disable detection of whitespace errors. >
|
||||
let g:airline#extensions#whitespace#enabled = 1
|
||||
<
|
||||
* disable detection of whitespace errors. >
|
||||
" useful to call for particular file types (e.g., in "ftplugin/*")
|
||||
silent! call airline#extensions#whitespace#disable()
|
||||
<
|
||||
* customize the type of mixed indent checking to perform. >
|
||||
" must be all spaces or all tabs before the first non-whitespace character
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 0 (default)
|
||||
@@ -567,24 +372,12 @@ eclim <https://eclim.org>
|
||||
" certain number of spaces are allowed after tabs, but not in between
|
||||
" this algorithm works well for /** */ style comments in a tab-indented file
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 1
|
||||
|
||||
" spaces are allowed after tabs, but not in between
|
||||
" this algorithm works well with programming styles that use tabs for
|
||||
" indentation and spaces for alignment
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 2
|
||||
<
|
||||
* customize the whitespace symbol. >
|
||||
let g:airline#extensions#whitespace#symbol = '!'
|
||||
<
|
||||
* configure which whitespace checks to enable. >
|
||||
" indent: mixed indent within a line
|
||||
" long: overlong lines
|
||||
" trailing: trailing whitespace
|
||||
" mixed-indent-file: different indentation in different lines
|
||||
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing', 'long', 'mixed-indent-file' ]
|
||||
|
||||
" this can also be configured for an individual buffer
|
||||
let b:airline_whitespace_checks = [ 'indent', 'trailing', 'long', 'mixed-indent-file' ]
|
||||
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ]
|
||||
<
|
||||
* configure the maximum number of lines where whitespace checking is enabled. >
|
||||
let g:airline#extensions#whitespace#max_lines = 20000
|
||||
@@ -595,81 +388,35 @@ eclim <https://eclim.org>
|
||||
* configure the formatting of the warning messages. >
|
||||
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
|
||||
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
|
||||
let g:airline#extensions#whitespace#long_format = 'long[%s]'
|
||||
let g:airline#extensions#whitespace#mixed_indent_file_format = 'mix-indent-file[%s]'
|
||||
|
||||
* configure custom trailing whitespace regexp rule >
|
||||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
|
||||
* configure, which filetypes have special treatment of /* */ comments,
|
||||
matters for mix-indent-file algorithm: >
|
||||
let airline#extensions#c_like_langs = ['c', 'cpp', 'cuda', 'go', 'javascript', 'ld', 'php']
|
||||
<
|
||||
* disable whitespace checking for an individual buffer >
|
||||
" Checking is enabled by default because b:airline_whitespace_disabled
|
||||
" is by default not defined:
|
||||
unlet b:airline_whitespace_disabled
|
||||
|
||||
" If b:airline_whitespace_disabled is defined and is non-zero for a buffer,
|
||||
" then whitespace checking will be disabled for that buffer; for example:
|
||||
" let b:airline_whitespace_disabled = 1
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
Note: If you're using the ctrlspace tabline only the option marked with (c)
|
||||
are supported!
|
||||
|
||||
* enable/disable enhanced tabline. (c)
|
||||
* enable/disable enhanced tabline. >
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
|
||||
* enable/disable displaying open splits per tab (only when tabs are opened). >
|
||||
let g:airline#extensions#tabline#show_splits = 1
|
||||
*
|
||||
* switch position of buffers and tabs on splited tabline (c)
|
||||
(only supported for ctrlspace plugin). >
|
||||
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. (c)
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
|
||||
Note: If you are using neovim (has('tablineat') = 1), then you can click
|
||||
on the tabline with the left mouse button to switch to that buffer, and
|
||||
with the middle mouse button to delete that buffer.
|
||||
|
||||
* enable/disable displaying tabs, regardless of number. (c)
|
||||
* enable/disable displaying tabs, regardless of number. >
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
let g:airline#extensions#tabline#excludes = []
|
||||
|
||||
* enable/disable display preview window buffer in the tabline. >
|
||||
let g:airline#extensions#tabline#exclude_preview = 1
|
||||
|
||||
* configure how numbers are displayed in tab mode. >
|
||||
<
|
||||
* configure how numbers are calculated in tab mode. >
|
||||
let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default)
|
||||
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
|
||||
let g:airline#extensions#tabline#tab_nr_type = 2 " splits and tab number
|
||||
<
|
||||
* enable/disable displaying tab number in tabs mode. >
|
||||
let g:airline#extensions#tabline#show_tab_nr = 1
|
||||
|
||||
* enable/disable displaying tab type (far right) >
|
||||
* enable/disable displaying tab type (far right)
|
||||
let g:airline#extensions#tabline#show_tab_type = 1
|
||||
|
||||
Note: The tab-type will only be displayed in tab-mode,
|
||||
if there are no splits shown. (See: g:airline#extensions#tabline#show_splits)
|
||||
|
||||
* rename label for buffers (default: 'buffers') (c)
|
||||
let g:airline#extensions#tabline#buffers_label = 'b'
|
||||
|
||||
* rename label for tabs (default: 'tabs') (c)
|
||||
let g:airline#extensions#tabline#tabs_label = 't'
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
exposed. >
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
exposed.
|
||||
|
||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||
nmap <leader>1 <Plug>AirlineSelectTab1
|
||||
@@ -681,52 +428,24 @@ with the middle mouse button to delete that buffer.
|
||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||
nmap <leader>- <Plug>AirlineSelectPrevTab
|
||||
nmap <leader>+ <Plug>AirlineSelectNextTab
|
||||
|
||||
Note: Mappings will be ignored within a NERDTree buffer.
|
||||
|
||||
Note: In buffer_idx_mode these mappings won't change the
|
||||
current tab, but switch to the buffer visible in that tab.
|
||||
Use |gt| for switching tabs.
|
||||
In tabmode, those mappings will switch to the specified tab.
|
||||
|
||||
* change the display format of the buffer index >
|
||||
let g:airline#extensions#tabline#buffer_idx_format = {
|
||||
\ '0': '0 ',
|
||||
\ '1': '1 ',
|
||||
\ '2': '2 ',
|
||||
\ '3': '3 ',
|
||||
\ '4': '4 ',
|
||||
\ '5': '5 ',
|
||||
\ '6': '6 ',
|
||||
\ '7': '7 ',
|
||||
\ '8': '8 ',
|
||||
\ '9': '9 '
|
||||
\}
|
||||
<
|
||||
|
||||
* defines the name of a formatter for how buffer names are displayed. (c)
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
" create a file in the dir autoload/airline/extensions/tabline/formatters/
|
||||
" called foo.vim >
|
||||
function! airline#extensions#tabline#formatters#foo#format(bufnr, buffers)
|
||||
function! airline#extensions#tabline#foo#format(bufnr, buffers)
|
||||
return fnamemodify(bufname(a:bufnr), ':t')
|
||||
endfunction
|
||||
let g:airline#extensions#tabline#formatter = 'foo'
|
||||
<
|
||||
|
||||
Note: the following variables are only used by the 'default' formatter.
|
||||
When no disambiguation is needed, both 'unique_tail_improved' and
|
||||
'unique_tail' delegate formatting to 'default', so these variables also
|
||||
control rendering of unique filenames when using these formatters.
|
||||
|
||||
* configure whether buffer numbers should be shown. >
|
||||
let g:airline#extensions#tabline#buffer_nr_show = 0
|
||||
<
|
||||
* configure how buffer numbers should be formatted with |printf()|. >
|
||||
* configure how buffer numbers should be formatted with |printf|. >
|
||||
let g:airline#extensions#tabline#buffer_nr_format = '%s: '
|
||||
<
|
||||
* configure the formatting of filenames (see |filename-modifiers|). >
|
||||
@@ -734,9 +453,6 @@ with the middle mouse button to delete that buffer.
|
||||
<
|
||||
* configure collapsing parent directories in buffer name. >
|
||||
let g:airline#extensions#tabline#fnamecollapse = 1
|
||||
<
|
||||
* configure truncating non-active buffer names to specified length. >
|
||||
let g:airline#extensions#tabline#fnametruncate = 0
|
||||
|
||||
" The `unique_tail` algorithm will display the tail of the filename, unless
|
||||
" there is another file of the same name, in which it will display it along
|
||||
@@ -764,28 +480,15 @@ with the middle mouse button to delete that buffer.
|
||||
let g:airline#extensions#tabline#right_sep = ''
|
||||
let g:airline#extensions#tabline#right_alt_sep = ''
|
||||
|
||||
* configure whether close button should be shown: >
|
||||
* configure whether close button should be shown
|
||||
let g:airline#extensions#tabline#show_close_button = 1
|
||||
|
||||
* configure symbol used to represent close button >
|
||||
* configure symbol used to represent close button
|
||||
let g:airline#extensions#tabline#close_symbol = 'X'
|
||||
|
||||
* configure pattern to be ignored on BufAdd autocommand >
|
||||
" fixes unneccessary redraw, when e.g. opening Gundo window
|
||||
let airline#extensions#tabline#ignore_bufadd_pat =
|
||||
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree'
|
||||
|
||||
<
|
||||
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
|
||||
|
||||
* enable Refresh of tabline buffers on |BufAdd| autocommands
|
||||
(set this to one, if you note 'AirlineTablineRefresh', however, this
|
||||
won't update airline on |:badd| commands) >
|
||||
let airline#extensions#tabline#disable_refresh = 0
|
||||
|
||||
* preserve windows when closing a buffer from the bufferline (default: 0) >
|
||||
|
||||
let airline#extensions#tabline#middle_click_preserves_windows = 1
|
||||
<
|
||||
------------------------------------- *airline-tmuxline*
|
||||
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
||||
|
||||
@@ -823,31 +526,19 @@ promptline <https://github.com/edkolev/promptline.vim>
|
||||
let airline#extensions#promptline#color_template = 'visual'
|
||||
let airline#extensions#promptline#color_template = 'replace'
|
||||
<
|
||||
------------------------------------- *airline-nrrwrgn*
|
||||
------------------------------------- *airline-nrrwrgn*
|
||||
NrrwRgn <https://github.com/chrisbra/NrrwRgn>
|
||||
|
||||
* enable/disable NrrwRgn integration >
|
||||
let g:airline#extensions#nrrwrgn#enabled = 1
|
||||
|
||||
------------------------------------- *airline-capslock*
|
||||
------------------------------------- *airline-capslock*
|
||||
vim-capslock <https://github.com/tpope/vim-capslock>
|
||||
|
||||
* enable/disable vim-capslock integration >
|
||||
let g:airline#extensions#capslock#enabled = 1
|
||||
|
||||
------------------------------------- *airline-xkblayout*
|
||||
vim-xkblayout
|
||||
|
||||
* enable/disable vim-xkblayout extension >
|
||||
let g:airline#extensions#xkblayout#enabled = 1
|
||||
|
||||
* define path to the backend switcher library
|
||||
Linux (Install https://github.com/ierton/xkb-switch):
|
||||
let g:XkbSwitchLib = '/usr/local/lib/libxkbswitch.so'
|
||||
macOS (Install https://github.com/vovkasm/input-source-switcher):
|
||||
let g:XkbSwitchLib = '/usr/local/lib/libInputSourceSwitcher.dylib'
|
||||
|
||||
------------------------------------- *airline-windowswap*
|
||||
------------------------------------- *airline-windowswap*
|
||||
vim-windowswap <https://github.com/wesQ3/vim-windowswap>
|
||||
|
||||
* enable/disable vim-windowswap integration >
|
||||
@@ -856,118 +547,10 @@ vim-windowswap <https://github.com/wesQ3/vim-windowswap>
|
||||
* set marked window indicator string >
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
<
|
||||
------------------------------------- *airline-obsession*
|
||||
vim-obsession <https://github.com/tpope/vim-obsession>
|
||||
|
||||
* enable/disable vim-obsession integration >
|
||||
let g:airline#extensions#obsession#enabled = 1
|
||||
|
||||
* set marked window indicator string >
|
||||
let g:airline#extensions#obsession#indicator_text = '$'
|
||||
<
|
||||
------------------------------------- *airline-taboo*
|
||||
taboo.vim <https://github.com/gcmt/taboo.vim>
|
||||
|
||||
* enable/disable taboo.vim integration >
|
||||
let g:airline#extensions#taboo#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-ctrlspace*
|
||||
vim-ctrlspace <https://github.com/szw/vim-ctrlspace>
|
||||
|
||||
* enable/disable vim-ctrlspace integration >
|
||||
let g:airline#extensions#ctrlspace#enabled = 1
|
||||
<
|
||||
To make the vim-ctrlspace integration work you will need to make the
|
||||
ctrlspace statusline function call the correct airline function. Therefore
|
||||
add the following line into your .vimrc: >
|
||||
|
||||
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
|
||||
<
|
||||
------------------------------------- *airline-ycm*
|
||||
YouCompleteMe <https://github.com/Valloric/YouCompleteMe>
|
||||
|
||||
Shows number of errors and warnings in the current file detected by YCM.
|
||||
|
||||
* enable/disable YCM integration >
|
||||
let g:airline#extensions#ycm#enabled = 1
|
||||
|
||||
* set error count prefix >
|
||||
let g:airline#extensions#ycm#error_symbol = 'E:'
|
||||
|
||||
* set warning count prefix >
|
||||
let g:airline#extensions#ycm#warning_symbol = 'W:'
|
||||
<
|
||||
------------------------------------- *airline-po*
|
||||
po.vim <http://www.vim.org/scripts/script.php?script_id=2530>
|
||||
|
||||
* enable/disable po integration >
|
||||
let g:airline#extensions#po#enabled = 1
|
||||
<
|
||||
* truncate width names to a fixed length >
|
||||
let g:airline#extensions#po#displayed_limit = 0
|
||||
|
||||
------------------------------------- *airline-vimtex*
|
||||
vimtex <https://github.com/lervag/vimtex>
|
||||
|
||||
Shows the current file's vimtex related info.
|
||||
|
||||
* enable/disable vimtex integration >
|
||||
let g:airline#extensions#vimtex#enabled = 1
|
||||
<
|
||||
* left and right delimiters (shown only when status string is not empty)
|
||||
let g:airline#extensions#vimtex#left = "{"
|
||||
let g:airline#extensions#vimtex#right = "}"
|
||||
|
||||
State indicators:
|
||||
|
||||
* the current tex file is the main project file (nothing is shown by default)
|
||||
let g:airline#extensions#vimtex#main = ""
|
||||
|
||||
* the current tex file is a subfile of the project
|
||||
and the compilation is set for the main file
|
||||
let g:airline#extensions#vimtex#sub_main = "m"
|
||||
|
||||
* the current tex file is a subfile of the project
|
||||
and the compilation is set for this subfile
|
||||
let g:airline#extensions#vimtex#sub_local = "l"
|
||||
|
||||
* single compilation is running
|
||||
let g:airline#extensions#vimtex#compiled = "c₁"
|
||||
|
||||
* continuousr compilation is running
|
||||
let g:airline#extensions#vimtex#continuous = "c"
|
||||
|
||||
* viewer is opened
|
||||
let g:airline#extensions#vimtex#viewer = "v"
|
||||
|
||||
------------------------------------- *airline-ale*
|
||||
ale <https://github.com/w0rp/ale>
|
||||
|
||||
* enable/disable ale integration >
|
||||
let g:airline#extensions#ale#enabled = 1
|
||||
|
||||
* ale error_symbol >
|
||||
let airline#extensions#ale#error_symbol = 'E:'
|
||||
<
|
||||
* ale warning >
|
||||
let airline#extensions#ale#warning_symbol = 'W:'
|
||||
<
|
||||
------------------------------------- *airline-neomake*
|
||||
neomake <https://github.com/neomake/neomake>
|
||||
|
||||
* enable/disable neomake integration >
|
||||
let g:airline#extensions#neomake#enabled = 1
|
||||
|
||||
* neomake error_symbol >
|
||||
let airline#extensions#neomake#error_symbol = 'E:'
|
||||
<
|
||||
* neomake warning >
|
||||
let airline#extensions#neomake#warning_symbol = 'W:'
|
||||
<
|
||||
==============================================================================
|
||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||
|
||||
The defaults will accommodate the mass majority of users with minimal
|
||||
The defaults will accomodate the mass majority of users with minimal
|
||||
configuration. However, if you want to reposition sections or contents you can
|
||||
do so with built-in helper functions, which makes it possible to create
|
||||
sections in a more declarative style.
|
||||
@@ -988,10 +571,6 @@ greater than a minimum width. >
|
||||
Parts can be configured to be visible conditionally. >
|
||||
call airline#parts#define_condition('foo', 'getcwd() =~ "work_dir"')
|
||||
<
|
||||
|
||||
Now add part "foo" to section section airline_section_y: >
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc','foo'])
|
||||
<
|
||||
Note: Part definitions are combinative; e.g. the two examples above modify the
|
||||
same `foo` part.
|
||||
|
||||
@@ -1003,22 +582,14 @@ Before is a list of parts that are predefined by vim-airline.
|
||||
* `mode` displays the current mode
|
||||
* `iminsert` displays the current insert method
|
||||
* `paste` displays the paste indicator
|
||||
* `crypt` displays the crypted indicator
|
||||
* `spell` displays the spell indicator
|
||||
* `filetype` displays the file type
|
||||
* `readonly` displays the read only indicator
|
||||
* `file` displays the filename and modified indicator
|
||||
* `path` displays the filename (absolute path) and modifier indicator
|
||||
* `linenr` displays the current line number
|
||||
* `maxlinenr` dispalys the number of lines in the buffer
|
||||
* `ffenc` displays the file format and encoding
|
||||
|
||||
And the following are defined for their respective extensions:
|
||||
|
||||
`ale_error_count` `ale_warning_count` `branch` `eclim` `hunks`
|
||||
`neomake_error_count` `neomake_warning_count` `obsession`
|
||||
`syntastic-warn` `syntastic-err` `tagbar` `whitespace`
|
||||
`windowswap` `ycm_error_count` `ycm_warning_count`
|
||||
`hunks`, `branch`, `tagbar`, `syntastic`, `whitespace`
|
||||
|
||||
------------------------------------- *airline-accents*
|
||||
Accents can be defined on any part, like so: >
|
||||
@@ -1031,19 +602,11 @@ colors instead of the section's default foreground color.
|
||||
|
||||
The following accents are defined by default. Themes can define their variants
|
||||
of the colors, but defaults will be provided if missing. >
|
||||
bold, italic, red, green, blue, yellow, orange, purple, none
|
||||
bold, italic, red, green, blue, yellow, orange, purple
|
||||
<
|
||||
The defaults configure the mode and line number parts to be bold, and the
|
||||
readonly part to be red.
|
||||
|
||||
"none" is special. This can be used, to remove a bold accent from an existing
|
||||
theme. For example, usually the mode part of the statusline is usually defined
|
||||
to be bold. However, it can be hard to remove an existing bold accent from the
|
||||
default configuration. Therefore, you can use the none accent to remove
|
||||
existing accents, so if you put >
|
||||
call airline#parts#define_accent('mode', 'none')
|
||||
the mode section will be set to non-bold font style.
|
||||
|
||||
------------------------------------- *airline-sections*
|
||||
Once a part is defined, you can use helper functions to generate the
|
||||
statuslines for each section. For example, to use the part above, we could
|
||||
@@ -1053,7 +616,7 @@ define a section like this: >
|
||||
let g:airline_section_b = airline#section#create_left(['ffenc','file'])
|
||||
let g:airline_section_c = airline#section#create(['%{getcwd()}'])
|
||||
endfunction
|
||||
autocmd User AirlineAfterInit call AirlineInit()
|
||||
autocmd VimEnter * call AirlineInit()
|
||||
<
|
||||
This will create a section with the `mode`, followed by a space, and our `foo`
|
||||
part in section `a`. Section `b` will have two parts with a left-side
|
||||
@@ -1062,10 +625,9 @@ the space and cwd are not defined parts. For convenience, if a part of that
|
||||
key does not exist, it will be inserted as is. The unit tests will be a good
|
||||
resource for possibilities.
|
||||
|
||||
Note: The use of |User| is important, because most extensions are lazily
|
||||
Note: The use of |VimEnter| is important, because most extensions are lazily
|
||||
loaded, so we must give them a chance to define their parts before we can use
|
||||
them. Also this autocommand is only triggered, after the airline functions are
|
||||
actually available on startup.
|
||||
them.
|
||||
|
||||
Note: The `airline#section#create` function and friends will do its best to
|
||||
create a section with the appropriate separators, but it only works for
|
||||
@@ -1082,7 +644,7 @@ the most powerful way to customize the statusline, and sometimes it may be
|
||||
easier to go this route than the above methods.
|
||||
|
||||
Every section can have two values. The default value is the global `g:`
|
||||
variable which is used in the absence of a `w:` value. This makes it very easy
|
||||
variable which is used in the absense of a `w:` value. This makes it very easy
|
||||
to override only certain parts of the statusline by only defining window-local
|
||||
variables for a subset of all sections.
|
||||
|
||||
@@ -1107,6 +669,7 @@ You can also remove a function as well, which is useful for when you want a
|
||||
temporary override. >
|
||||
call airline#remove_statusline_func('MyPlugin')
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
PIPELINE *airline-pipeline*
|
||||
|
||||
@@ -1186,12 +749,9 @@ VimL syntax to write a theme, but if you've written in any programming
|
||||
language before it will be easy to pick up.
|
||||
|
||||
The |dark.vim| theme fully documents this procedure and will guide you through
|
||||
the process.
|
||||
|
||||
For other examples, you can visit the official themes repository at
|
||||
<https://github.com/vim-airline/vim-airline-themes>. It also includes
|
||||
examples such as |jellybeans.vim| which define colors by extracting highlight
|
||||
groups from the underlying colorscheme.
|
||||
the process. The |jellybeans.vim| theme is another example of how to write a
|
||||
theme, but instead of manually declaring colors, it extracts the values from
|
||||
highlight groups.
|
||||
|
||||
==============================================================================
|
||||
TROUBLESHOOTING *airline-troubleshooting*
|
||||
@@ -1223,14 +783,9 @@ A. Certain themes are derived from the active colorscheme by extracting colors
|
||||
their intended matching colorschemes, but will be hit or miss when loaded
|
||||
with other colorschemes.
|
||||
|
||||
Q. Themes are missing
|
||||
A. Themes have been extracted into the vim-airlines-themes repository. Simply
|
||||
clone https://github.com/vim-airline/vim-airline-themes and everything
|
||||
should work again.
|
||||
|
||||
|
||||
Solutions to other common problems can be found in the Wiki:
|
||||
<https://github.com/vim-airline/vim-airline/wiki/FAQ>
|
||||
<https://github.com/bling/vim-airline/wiki/FAQ>
|
||||
|
||||
==============================================================================
|
||||
CONTRIBUTIONS *airline-contributions*
|
||||
@@ -1240,6 +795,7 @@ Contributions and pull requests are welcome.
|
||||
==============================================================================
|
||||
LICENSE *airline-license*
|
||||
|
||||
MIT License. Copyright © 2013-2017 Bailey Ling, Christian Brabandt
|
||||
MIT License. Copyright © 2013-2015 Bailey Ling.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,72 +1,52 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||
finish
|
||||
endif
|
||||
let g:loaded_airline = 1
|
||||
|
||||
autocmd VimEnter * call airline#deprecation#check()
|
||||
|
||||
let s:airline_initialized = 0
|
||||
let s:airline_theme_defined = 0
|
||||
function! s:init()
|
||||
if s:airline_initialized
|
||||
return
|
||||
if !s:airline_initialized
|
||||
let s:airline_initialized = 1
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call airline#extensions#load()
|
||||
call airline#init#sections()
|
||||
|
||||
let s:airline_theme_defined = exists('g:airline_theme')
|
||||
if s:airline_theme_defined || !airline#switch_matching_theme()
|
||||
let g:airline_theme = get(g:, 'airline_theme', 'dark')
|
||||
call airline#switch_theme(g:airline_theme)
|
||||
endif
|
||||
endif
|
||||
let s:airline_initialized = 1
|
||||
|
||||
call airline#extensions#load()
|
||||
call airline#init#sections()
|
||||
|
||||
let s:theme_in_vimrc = exists('g:airline_theme')
|
||||
if s:theme_in_vimrc
|
||||
try
|
||||
let palette = g:airline#themes#{g:airline_theme}#palette
|
||||
catch
|
||||
echom 'Could not resolve airline theme "' . g:airline_theme . '". Themes have been migrated to github.com/vim-airline/vim-airline-themes.'
|
||||
let g:airline_theme = 'dark'
|
||||
endtry
|
||||
silent call airline#switch_theme(g:airline_theme)
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
silent call s:on_colorscheme_changed()
|
||||
endif
|
||||
|
||||
silent doautocmd User AirlineAfterInit
|
||||
endfunction
|
||||
|
||||
function! s:on_window_changed()
|
||||
if pumvisible() && (!&previewwindow || g:airline_exclude_preview)
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
" Handle each window only once, since we might come here several times for
|
||||
" different autocommands.
|
||||
let l:key = [bufnr('%'), winnr(), winnr('$'), tabpagenr(), &ft]
|
||||
if get(g:, 'airline_last_window_changed', []) == l:key
|
||||
\ && &stl is# '%!airline#statusline('.winnr().')'
|
||||
\ && &ft !~? 'gitcommit'
|
||||
" fugitive is special, it changes names and filetypes several times,
|
||||
" make sure the caching does not get into its way
|
||||
return
|
||||
endif
|
||||
let g:airline_last_window_changed = l:key
|
||||
call s:init()
|
||||
call <sid>init()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! s:on_colorscheme_changed()
|
||||
call s:init()
|
||||
unlet! g:airline#highlighter#normal_fg_hi
|
||||
let g:airline_gui_mode = airline#init#gui_mode()
|
||||
if !s:theme_in_vimrc
|
||||
call airline#switch_matching_theme()
|
||||
call <sid>init()
|
||||
if !s:airline_theme_defined
|
||||
if airline#switch_matching_theme()
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" couldn't find a match, or theme was defined, just refresh
|
||||
call airline#load_theme()
|
||||
endfunction
|
||||
|
||||
function! airline#cmdwinenter(...)
|
||||
function airline#cmdwinenter(...)
|
||||
call airline#extensions#apply_left_override('Command Line', '')
|
||||
endfunction
|
||||
|
||||
@@ -92,25 +72,20 @@ function! s:airline_toggle()
|
||||
\ | call <sid>on_window_changed()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd GUIEnter,ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload *
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ call <sid>on_window_changed()
|
||||
if exists('#CompleteDone')
|
||||
autocmd CompleteDone * call <sid>on_window_changed()
|
||||
endif
|
||||
|
||||
autocmd VimResized * unlet! w:airline_lastmode | :call <sid>airline_refresh()
|
||||
autocmd TabEnter * :unlet! w:airline_lastmode | let w:airline_active=1
|
||||
autocmd BufWritePost */autoload/airline/themes/*.vim
|
||||
\ exec 'source '.split(globpath(&rtp, 'autoload/airline/themes/'.g:airline_theme.'.vim', 1), "\n")[0]
|
||||
\ | call airline#load_theme()
|
||||
augroup END
|
||||
|
||||
if s:airline_initialized
|
||||
call s:on_window_changed()
|
||||
endif
|
||||
|
||||
silent doautocmd User AirlineToggledOn
|
||||
|
||||
if s:airline_initialized
|
||||
call <sid>on_window_changed()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -118,7 +93,6 @@ function! s:get_airline_themes(a, l, p)
|
||||
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:a.'*'), "\n")
|
||||
return map(files, 'fnamemodify(v:val, ":t:r")')
|
||||
endfunction
|
||||
|
||||
function! s:airline_theme(...)
|
||||
if a:0
|
||||
call airline#switch_theme(a:1)
|
||||
@@ -126,25 +100,10 @@ function! s:airline_theme(...)
|
||||
echo g:airline_theme
|
||||
endif
|
||||
endfunction
|
||||
command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
||||
command! AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
|
||||
command! AirlineToggle call <sid>airline_toggle()
|
||||
command! AirlineRefresh call airline#load_theme() | call airline#update_statusline()
|
||||
|
||||
function! s:airline_refresh()
|
||||
if !exists("#airline")
|
||||
" disabled
|
||||
return
|
||||
endif
|
||||
let nomodeline=''
|
||||
if v:version > 703 || v:version == 703 && has("patch438")
|
||||
let nomodeline = '<nomodeline>'
|
||||
endif
|
||||
exe printf("silent doautocmd %s User AirlineBeforeRefresh", nomodeline)
|
||||
call airline#load_theme()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
call <sid>airline_toggle()
|
||||
|
||||
command! -bar -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
||||
command! -bar AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
|
||||
command! -bar AirlineToggle call s:airline_toggle()
|
||||
command! -bar AirlineRefresh call s:airline_refresh()
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call s:airline_toggle()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
let g:airline_theme = 'dark'
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
function! MyFuncref(...)
|
||||
call a:1.add_raw('hello world')
|
||||
|
||||
@@ -15,7 +15,7 @@ describe 'active builder'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal#hello%#Normal_to_Search#%#Search#world'
|
||||
Expect stl =~ '%#Normal#hello%#Normal_to_Search#>%#Search#world'
|
||||
end
|
||||
|
||||
it 'should reuse highlight group if background colors match'
|
||||
@@ -24,7 +24,7 @@ describe 'active builder'
|
||||
call s:builder.add_section('Foo1', 'hello')
|
||||
call s:builder.add_section('Foo2', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Foo1#helloworld'
|
||||
Expect stl =~ '%#Foo1#hello>world'
|
||||
end
|
||||
|
||||
it 'should switch highlight groups if foreground colors differ'
|
||||
@@ -33,7 +33,7 @@ describe 'active builder'
|
||||
call s:builder.add_section('Foo1', 'hello')
|
||||
call s:builder.add_section('Foo2', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Foo1#hello%#Foo1_to_Foo2#%#Foo2#world'
|
||||
Expect stl =~ '%#Foo1#hello%#Foo1_to_Foo2#>%#Foo2#world'
|
||||
end
|
||||
|
||||
it 'should split left/right sections'
|
||||
@@ -47,14 +47,14 @@ describe 'active builder'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'hello%#Normal_to_Search#%#Search#world'
|
||||
Expect stl =~ 'hello%#Normal_to_Search#<%#Search#world'
|
||||
end
|
||||
|
||||
it 'should not repeat the same highlight group'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
let stl = s:builder.build()
|
||||
Expect stl == '%#Normal#hellohello'
|
||||
Expect stl == '%#Normal#hello>hello'
|
||||
end
|
||||
|
||||
it 'should replace accent groups with the specified group'
|
||||
@@ -94,7 +94,7 @@ describe 'inactive builder'
|
||||
call s:builder.add_section('Normal', 'hello')
|
||||
call s:builder.add_section('Search', 'world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal_inactive#hello%#Normal_to_Search_inactive#%#Search_inactive#world'
|
||||
Expect stl =~ '%#Normal_inactive#hello%#Normal_to_Search_inactive#>%#Search_inactive#world'
|
||||
end
|
||||
|
||||
it 'should not render accents'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
|
||||
describe 'commands'
|
||||
it 'should toggle off and on'
|
||||
@@ -22,10 +24,6 @@ describe 'commands'
|
||||
Expect g:airline_theme == 'simple'
|
||||
execute 'AirlineTheme dark'
|
||||
Expect g:airline_theme == 'dark'
|
||||
execute 'AirlineTheme doesnotexist'
|
||||
Expect g:airline_theme == 'dark'
|
||||
colors molokai
|
||||
Expect g:airline_theme == 'molokai'
|
||||
end
|
||||
|
||||
it 'should have a refresh command'
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
|
||||
let g:airline_theme = 'dark'
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
source plugin/airline.vim
|
||||
doautocmd VimEnter
|
||||
call airline#load_theme()
|
||||
|
||||
describe 'default'
|
||||
before
|
||||
@@ -12,6 +10,10 @@ describe 'default'
|
||||
end
|
||||
|
||||
it 'should use the layout'
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'c', 'a', 'b', 'warning' ],
|
||||
\ [ 'x', 'z', 'y' ]
|
||||
\ ]
|
||||
call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 })
|
||||
let stl = s:builder.build()
|
||||
Expect stl =~ 'airline_c_to_airline_a'
|
||||
|
||||
16
t/init.vim
16
t/init.vim
@@ -18,10 +18,9 @@ describe 'init sections'
|
||||
call s:clear()
|
||||
end
|
||||
|
||||
it 'section a should have mode, paste, spell, iminsert'
|
||||
it 'section a should have mode, paste, iminsert'
|
||||
Expect g:airline_section_a =~ 'mode'
|
||||
Expect g:airline_section_a =~ 'paste'
|
||||
Expect g:airline_section_a =~ 'spell'
|
||||
Expect g:airline_section_a =~ 'iminsert'
|
||||
end
|
||||
|
||||
@@ -59,21 +58,12 @@ describe 'init sections'
|
||||
end
|
||||
|
||||
it 'all default statusline extensions should be blank'
|
||||
Expect airline#parts#get('ale_error_count').raw == ''
|
||||
Expect airline#parts#get('ale_warning_count').raw == ''
|
||||
Expect airline#parts#get('hunks').raw == ''
|
||||
Expect airline#parts#get('branch').raw == ''
|
||||
Expect airline#parts#get('eclim').raw == ''
|
||||
Expect airline#parts#get('neomake_error_count').raw == ''
|
||||
Expect airline#parts#get('neomake_warning_count').raw == ''
|
||||
Expect airline#parts#get('obsession').raw == ''
|
||||
Expect airline#parts#get('syntastic-err').raw == ''
|
||||
Expect airline#parts#get('syntastic-warn').raw == ''
|
||||
Expect airline#parts#get('tagbar').raw == ''
|
||||
Expect airline#parts#get('syntastic').raw == ''
|
||||
Expect airline#parts#get('eclim').raw == ''
|
||||
Expect airline#parts#get('whitespace').raw == ''
|
||||
Expect airline#parts#get('windowswap').raw == ''
|
||||
Expect airline#parts#get('ycm_error_count').raw == ''
|
||||
Expect airline#parts#get('ycm_warning_count').raw == ''
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -57,13 +57,13 @@ describe 'section'
|
||||
|
||||
it 'should force add separators for raw and missing keys'
|
||||
let s = airline#section#create_left(['asdf', 'raw'])
|
||||
Expect s == 'asdf raw'
|
||||
Expect s == 'asdf > raw'
|
||||
let s = airline#section#create_left(['asdf', 'aaaa', 'raw'])
|
||||
Expect s == 'asdf aaaa raw'
|
||||
Expect s == 'asdf > aaaa > raw'
|
||||
let s = airline#section#create_right(['raw', '%f'])
|
||||
Expect s == 'raw %f'
|
||||
Expect s == 'raw < %f'
|
||||
let s = airline#section#create_right(['%t', 'asdf', '%{getcwd()}'])
|
||||
Expect s == '%t asdf %{getcwd()}'
|
||||
Expect s == '%t < asdf < %{getcwd()}'
|
||||
end
|
||||
|
||||
it 'should empty out parts that do not pass their condition'
|
||||
@@ -72,10 +72,5 @@ describe 'section'
|
||||
let s = airline#section#create(['conditional'])
|
||||
Expect s == '%{0 ? airline#util#wrap("conditional",0) : ""}'
|
||||
end
|
||||
|
||||
it 'should not draw two separators after another'
|
||||
let s = airline#section#create_right(['ffenc','%{strftime("%H:%M")}'])
|
||||
Expect s == '%{airline#util#prepend(airline#parts#ffenc(),0)}%{strftime("%H:%M")}'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ describe 'themes'
|
||||
|
||||
it 'should pass args through correctly'
|
||||
let hl = airline#themes#get_highlight('Foo', 'bold', 'italic')
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic']
|
||||
Expect hl == ['', '', 0, 1, 'bold,italic']
|
||||
|
||||
let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold')
|
||||
Expect hl == ['', '', 'NONE', 'NONE', 'italic,bold']
|
||||
Expect hl == ['', '', 1, 0, 'italic,bold']
|
||||
end
|
||||
|
||||
it 'should generate color map with mirroring'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user