dblume commited on 2023-11-22 16:24:19
Showing 90 changed files, with 1 additions and 9028 deletions.
... | ... |
@@ -1,8 +0,0 @@ |
1 |
-language: ruby |
|
2 |
-before_install: |
|
3 |
- - curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim |
|
4 |
- - curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/molokai.vim" -o autoload/airline/themes/molokai.vim |
|
5 |
- - mkdir colors && curl -f -L 'https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim' -o colors/molokai.vim |
|
6 |
-rvm: |
|
7 |
- - 1.9.3 |
|
8 |
-script: rake ci |
... | ... |
@@ -1,165 +0,0 @@ |
1 |
-# Change Log |
|
2 |
- |
|
3 |
-This is the Changelog for the vim-airline project. |
|
4 |
- |
|
5 |
-## [Unreleased] |
|
6 |
- |
|
7 |
-## [0.9] - 2018-01-15 |
|
8 |
-- Changes |
|
9 |
- - Look of default Airline Symbols has been improved [#1397](https://github.com/vim-airline/vim-airline/issues/1397) |
|
10 |
- - Airline does now set `laststatus=2` if needed |
|
11 |
- - Syntastic extension now displays warnings and errors separately |
|
12 |
- - Updates on Resize and SessionLoad events |
|
13 |
- - Add `maxlinenr` symbol to `airline_section_z` |
|
14 |
- - Add quickfix title to inactive windows |
|
15 |
-- Improvements |
|
16 |
- - Many performance improvements (using caching and async feature when possible) |
|
17 |
- - Cache changes to highlighting groups if `g:airline_highlighting_cache = 1` is set |
|
18 |
- - Allow to skip empty sections by setting `g:airline_skip_empty_sections` variable |
|
19 |
- - Make use of improved Vim Script API, if available (e.g. getwininfo()) |
|
20 |
- - Support for Vims terminal feature (very experimental since it hasn't been stabilized yet) |
|
21 |
- - More configuration for the tabline extension (with clickable buffers for Neovim) |
|
22 |
- - Works better on smaller window sizes |
|
23 |
- - Make airline aware of git worktrees |
|
24 |
- - Improvements to the fugitive extension [#1603](https://github.com/vim-airline/vim-airline/issues/1603) |
|
25 |
- - Allows for configurable fileformat output if `g:airline#parts#ffenc#skip_expected_string` is set |
|
26 |
- - Improvements to the documentation |
|
27 |
-- New features |
|
28 |
- - Full async support for Vim 8 and Neovim |
|
29 |
- - Extensions: |
|
30 |
- - [vim-bufmru](https://github.com/mildred/vim-bufmru) |
|
31 |
- - [xkb-switch](https://github.com/ierton/xkb-switch) |
|
32 |
- - [input-source-switcher](https://github.com/vovkasm/input-source-switcher) |
|
33 |
- - [vimagit](https://github.com/jreybert/vimagit) |
|
34 |
- - [denite](https://github.com/Shougo/denite.nvim) |
|
35 |
- - [dein](https://github.com/Shougo/dein.vim) |
|
36 |
- - [vimtex](https://github.com/lervag/vimtex) |
|
37 |
- - [minpac](https://github.com/k-takata/minpac/) |
|
38 |
- - [vim-cursormode](https://github.com/vheon/vim-cursormode) |
|
39 |
- - [Neomake](https://github.com/neomake/neomake) |
|
40 |
- - [Ale](https://github.com/w0rp/ale) |
|
41 |
- - [vim-obsession](https://github.com/tpope/vim-obsession) |
|
42 |
- - spell (can also display Spell language) |
|
43 |
- - keymap |
|
44 |
- - Formatters: |
|
45 |
- - Formatters for JavaScript [#1617](https://github.com/vim-airline/vim-airline/issues/1617) |
|
46 |
- - Tabline: Allow for custom formatter for `tab_nr_type` [#1418](https://github.com/vim-airline/vim-airline/issues/1418) |
|
47 |
- - Customizable wordcount formatter [#1584](https://github.com/vim-airline/vim-airline/issues/1584) |
|
48 |
- - Add User autocommand for Theme changing [#1226](https://github.com/vim-airline/vim-airline/issues/1226) |
|
49 |
- - Shows mercurial mq status if hg mq extension is enabled |
|
50 |
- |
|
51 |
-## [0.8] - 2016-03-09 |
|
52 |
-- Changes |
|
53 |
- - Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline) |
|
54 |
- - Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes) |
|
55 |
-- Improvements |
|
56 |
- - Extensions |
|
57 |
- - branch: support Git and Mercurial simultaneously, untracked files |
|
58 |
- - whitespace: new mixed-indent rule |
|
59 |
- - Windows support |
|
60 |
- - Many bug fixes |
|
61 |
- - Support for Neovim |
|
62 |
-- New features |
|
63 |
- - Many new themes |
|
64 |
- - Extensions/integration |
|
65 |
- - [taboo](https://github.com/gcmt/taboo.vim) |
|
66 |
- - [vim-ctrlspace](https://github.com/szw/vim-ctrlspace) |
|
67 |
- - [quickfixsigns](https://github.com/tomtom/quickfixsigns_vim) |
|
68 |
- - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) |
|
69 |
- - [po.vim](http://www.vim.org/scripts/script.php?script_id=695) |
|
70 |
- - [unicode.vim](https://github.com/chrisbra/unicode.vim) |
|
71 |
- - wordcount |
|
72 |
- - crypt indicator |
|
73 |
- - byte order mark indicator |
|
74 |
- - Tabline's tab mode can display splits simultaneously |
|
75 |
- |
|
76 |
-## [0.7] - 2014-12-10 |
|
77 |
-- New features |
|
78 |
- - accents support; allowing multiple colors/styles in the same section |
|
79 |
- - extensions: eclim |
|
80 |
- - themes: understated, monochrome, murmur, sol, lucius |
|
81 |
-- Improvements |
|
82 |
- - solarized theme; support for 8 color terminals |
|
83 |
- - tabline resizes dynamically based on number of open buffers |
|
84 |
- - miscellaneous bug fixes |
|
85 |
- |
|
86 |
-## [0.6] - 2013-10-08 |
|
87 |
- |
|
88 |
-- New features |
|
89 |
- - accents support; allowing multiple colors/styles in the same section |
|
90 |
- - extensions: eclim |
|
91 |
- - themes: understated, monochrome, murmur, sol, lucius |
|
92 |
-- Improvements |
|
93 |
- - solarized theme; support for 8 color terminals |
|
94 |
- - tabline resizes dynamically based on number of open buffers |
|
95 |
- - miscellaneous bug fixes |
|
96 |
- |
|
97 |
-## [0.5] - 2013-09-13 |
|
98 |
- |
|
99 |
-- New features |
|
100 |
- - smart tabline extension which displays all buffers when only one tab is visible |
|
101 |
- - automatic section truncation when the window resizes |
|
102 |
- - support for a declarative style of configuration, allowing parts to contain metadata such as minimum window width or conditional visibility |
|
103 |
- - themes: zenburn, serene |
|
104 |
-- Other |
|
105 |
- - a sizable chunk of vim-airline is now running through a unit testing suite, automated via Travis CI |
|
106 |
- |
|
107 |
-## [0.4] - 2013-08-26 |
|
108 |
- |
|
109 |
- - New features |
|
110 |
- - integration with csv.vim and vim-virtualenv |
|
111 |
- - hunks extension for vim-gitgutter and vim-signify |
|
112 |
- - automatic theme switching with matching colorschemes |
|
113 |
- - commands: AirlineToggle |
|
114 |
- - themes: base16 (all variants) |
|
115 |
- - Improvements |
|
116 |
- - integration with undotree, tagbar, and unite |
|
117 |
- - Other |
|
118 |
- - refactored core and exposed statusline builder and pipeline |
|
119 |
- - all extension related g:airline_variables have been deprecated in favor of g:airline#extensions# variables |
|
120 |
- - extensions found in the runtimepath outside of the default distribution will be automatically loaded |
|
121 |
- |
|
122 |
-## [0.3] - 2013-08-12 |
|
123 |
- |
|
124 |
-- New features |
|
125 |
- - first-class integration with tagbar |
|
126 |
- - white space detection for trailing spaces and mixed indentation |
|
127 |
- - introduced warning section for syntastic and white space detection |
|
128 |
- - improved ctrlp integration: colors are automatically selected based on the current airline theme |
|
129 |
- - new themes: molokai, bubblegum, jellybeans, tomorrow |
|
130 |
-- Bug fixes |
|
131 |
- - improved handling of eventignore used by other plugins |
|
132 |
-- Other |
|
133 |
- - code cleaned up for clearer separation between core functionality and extensions |
|
134 |
- - introduced color extraction from highlight groups, allowing themes to be generated off of the active colorscheme (e.g. jellybeans and tomorrow) |
|
135 |
- - License changed to MIT |
|
136 |
- |
|
137 |
-## [0.2] - 2013-07-28 |
|
138 |
- |
|
139 |
-- New features |
|
140 |
- - iminsert detection |
|
141 |
- - integration with vimshell, vimfiler, commandt, lawrencium |
|
142 |
- - enhanced bufferline theming |
|
143 |
- - support for ctrlp theming |
|
144 |
- - support for custom window excludes |
|
145 |
-- New themes |
|
146 |
- - luna and wombat |
|
147 |
-- Bug fixes |
|
148 |
- - refresh branch name after switching with a shell command |
|
149 |
- |
|
150 |
-## [0.1] - 2013-07-17 |
|
151 |
- |
|
152 |
-- Initial release |
|
153 |
- - integration with other plugins: netrw, unite, nerdtree, undotree, gundo, tagbar, minibufexplr, ctrlp |
|
154 |
- - support for themes: 8 included |
|
155 |
- |
|
156 |
-[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.9...HEAD |
|
157 |
-[0.9]: https://github.com/vim-airline/vim-airline/compare/v0.8...v0.9 |
|
158 |
-[0.8]: https://github.com/vim-airline/vim-airline/compare/v0.7...v0.8 |
|
159 |
-[0.7]: https://github.com/vim-airline/vim-airline/compare/v0.6...v0.7 |
|
160 |
-[0.6]: https://github.com/vim-airline/vim-airline/compare/v0.5...v0.6 |
|
161 |
-[0.5]: https://github.com/vim-airline/vim-airline/compare/v0.4...v0.5 |
|
162 |
-[0.4]: https://github.com/vim-airline/vim-airline/compare/v0.3...v0.4 |
|
163 |
-[0.3]: https://github.com/vim-airline/vim-airline/compare/v0.2...v0.3 |
|
164 |
-[0.2]: https://github.com/vim-airline/vim-airline/compare/v0.1...v0.2 |
|
165 |
-[0.1]: https://github.com/vim-airline/vim-airline/releases/tag/v0.1 |
... | ... |
@@ -1,32 +0,0 @@ |
1 |
-# Contributions |
|
2 |
- |
|
3 |
-Contributions and pull requests are welcome. Please take note of the following guidelines: |
|
4 |
- |
|
5 |
-* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords. |
|
6 |
-* Keep the history clean! Squash your branches before you submit a pull request. `pull --rebase` is your friend. |
|
7 |
-* Any changes to the core should be tested against Vim 7.2. |
|
8 |
- |
|
9 |
-# Bugs |
|
10 |
- |
|
11 |
-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: |
|
12 |
- |
|
13 |
-* 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]. |
|
14 |
-* And to make it easier to reproduce, please supply the following: |
|
15 |
- * the `:version` of vim |
|
16 |
- * the commit of vim-airline you're using |
|
17 |
- * the OS that you're using, including terminal emulator, GUI vs non-GUI |
|
18 |
- |
|
19 |
-# Themes |
|
20 |
- |
|
21 |
-* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14]. |
|
22 |
-* 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. |
|
23 |
- |
|
24 |
-# Maintenance |
|
25 |
- |
|
26 |
-If you would like to take a more active role in improving vim-airline, please consider [becoming a maintainer][43]. |
|
27 |
- |
|
28 |
- |
|
29 |
-[7]: https://github.com/bling/minivimrc |
|
30 |
-[11]: https://github.com/tpope/vim-pathogen |
|
31 |
-[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots |
|
32 |
-[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer |
... | ... |
@@ -1,21 +0,0 @@ |
1 |
-#### environment |
|
2 |
- |
|
3 |
-- vim: ???? |
|
4 |
-- vim-airline: ???? |
|
5 |
-- OS: ???? |
|
6 |
-- Have you reproduced with a minimal vimrc: ??? |
|
7 |
-- What is your airline configuration: ??? |
|
8 |
-if you are using terminal: |
|
9 |
-- terminal: ???? |
|
10 |
-- $TERM variable: ??? |
|
11 |
-- color configuration (:set t_Co?): |
|
12 |
-if you are using Neovim: |
|
13 |
-- does it happen in Vim: ??? |
|
14 |
- |
|
15 |
-#### actual behavior |
|
16 |
- |
|
17 |
-???? |
|
18 |
- |
|
19 |
-#### expected behavior |
|
20 |
- |
|
21 |
-???? |
... | ... |
@@ -1,21 +0,0 @@ |
1 |
-The MIT License (MIT) |
|
2 |
- |
|
3 |
-Copyright (C) 2013-2016 Bailey Ling |
|
4 |
- |
|
5 |
-Permission is hereby granted, free of charge, to any person obtaining |
|
6 |
-a copy of this software and associated documentation files (the "Software"), |
|
7 |
-to deal in the Software without restriction, including without limitation |
|
8 |
-the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
9 |
-and/or sell copies of the Software, and to permit persons to whom the |
|
10 |
-Software is furnished to do so, subject to the following conditions: |
|
11 |
- |
|
12 |
-The above copyright notice and this permission notice shall be included |
|
13 |
-in all copies or substantial portions of the Software. |
|
14 |
- |
|
15 |
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
16 |
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
17 |
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
18 |
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
19 |
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
20 |
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
|
21 |
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
... | ... |
@@ -1,342 +0,0 @@ |
1 |
-# vim-airline [![Build Status](https://travis-ci.org/vim-airline/vim-airline.png)](https://travis-ci.org/vim-airline/vim-airline) |
|
2 |
- |
|
3 |
-Lean & mean status/tabline for vim that's light as air. |
|
4 |
- |
|
5 |
-![img](https://github.com/vim-airline/vim-airline/wiki/screenshots/demo.gif) |
|
6 |
- |
|
7 |
-When the plugin is correctly loaded, Vim will draw a nice statusline at the |
|
8 |
-bottom of each window. |
|
9 |
- |
|
10 |
-That line consists of several sections, each one displaying some piece of |
|
11 |
-information. By default (without configuration) this line will look like this: |
|
12 |
- |
|
13 |
-``` |
|
14 |
-+-----------------------------------------------------------------------------+ |
|
15 |
-|~ | |
|
16 |
-|~ | |
|
17 |
-|~ VIM - Vi IMproved | |
|
18 |
-|~ | |
|
19 |
-|~ version 8.0 | |
|
20 |
-|~ by Bram Moolenaar et al. | |
|
21 |
-|~ Vim is open source and freely distributable | |
|
22 |
-|~ | |
|
23 |
-|~ type :h :q<Enter> to exit | |
|
24 |
-|~ type :help<Enter> or <F1> for on-line help | |
|
25 |
-|~ type :help version8<Enter> for version info | |
|
26 |
-|~ | |
|
27 |
-|~ | |
|
28 |
-+-----------------------------------------------------------------------------+ |
|
29 |
-| A | B | C X | Y | Z | [...] | |
|
30 |
-+-----------------------------------------------------------------------------+ |
|
31 |
-``` |
|
32 |
- |
|
33 |
-The statusline is the colored line at the bottom, which contains the sections |
|
34 |
-(possibly in different colors): |
|
35 |
- |
|
36 |
-section|meaning (example) |
|
37 |
--------|------------------ |
|
38 |
- A | displays the mode + additional flags like crypt/spell/paste (INSERT) |
|
39 |
- B | VCS information (branch, hunk summary) (master) |
|
40 |
- C | filename + read-only flag (~/.vim/vimrc RO) |
|
41 |
- X | filetype (vim) |
|
42 |
- Y | file encoding[fileformat] (utf-8[unix]) |
|
43 |
- Z | current position in the file |
|
44 |
- [...] | additional sections (warning/errors/statistics) from external plugins (e.g. YCM, syntastic, ...) |
|
45 |
- |
|
46 |
-The information in Section Z looks like this: |
|
47 |
- |
|
48 |
-`10% ☰ 10/100 ln : 20` |
|
49 |
- |
|
50 |
-This means: |
|
51 |
-``` |
|
52 |
-10% - 10 percent down the top of the file |
|
53 |
-☰ 10 - current line 10 |
|
54 |
-/100 ln - of 100 lines |
|
55 |
-: 20 - current column 20 |
|
56 |
-``` |
|
57 |
- |
|
58 |
-For a better look, those sections can be colored differently, depending on various conditions |
|
59 |
-(e.g. the mode or whether the current file is 'modified') |
|
60 |
- |
|
61 |
-# Features |
|
62 |
- |
|
63 |
-* Tiny core written with extensibility in mind ([open/closed principle][8]). |
|
64 |
-* Integrates with a variety of plugins, including: [vim-bufferline][6], |
|
65 |
- [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], |
|
66 |
- [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], |
|
67 |
- [vim-signify][30], [quickfixsigns][39], [syntastic][5], [eclim][34], |
|
68 |
- [lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37], |
|
69 |
- [ctrlspace][38], [vim-bufmru][47], [vimagit][50], [denite][51] and more. |
|
70 |
-* Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols. |
|
71 |
-* Optimized for speed; it loads in under a millisecond. |
|
72 |
-* 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. |
|
73 |
- Note these are now external to this plugin. See [below][46] for detail. |
|
74 |
-* Supports 7.2 as the minimum Vim version. |
|
75 |
-* 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]. |
|
76 |
-* Unit testing suite. |
|
77 |
- |
|
78 |
-## Straightforward customization |
|
79 |
- |
|
80 |
-If you don't like the defaults, you can replace all sections with standard `statusline` syntax. Give your statusline that you've built over the years a face lift. |
|
81 |
- |
|
82 |
-![image](https://f.cloud.github.com/assets/306502/1009429/d69306da-0b38-11e3-94bf-7c6e3eef41e9.png) |
|
83 |
- |
|
84 |
-## Themes |
|
85 |
- |
|
86 |
-Themes have moved to |
|
87 |
-another repository as of [this commit][45]. |
|
88 |
- |
|
89 |
-Install the themes as you would this plugin (Vundle example): |
|
90 |
- |
|
91 |
-```vim |
|
92 |
-Plugin 'vim-airline/vim-airline' |
|
93 |
-Plugin 'vim-airline/vim-airline-themes' |
|
94 |
-``` |
|
95 |
- |
|
96 |
-See https://github.com/vim-airline/vim-airline-themes for more. |
|
97 |
- |
|
98 |
-## Automatic truncation |
|
99 |
- |
|
100 |
-Sections and parts within sections can be configured to automatically hide when the window size shrinks. |
|
101 |
- |
|
102 |
-![image](https://f.cloud.github.com/assets/306502/1060831/05c08aac-11bc-11e3-8470-a506a3037f45.png) |
|
103 |
- |
|
104 |
-## Smarter tab line |
|
105 |
- |
|
106 |
-Automatically displays all buffers when there's only one tab open. |
|
107 |
- |
|
108 |
-![tabline](https://f.cloud.github.com/assets/306502/1072623/44c292a0-1495-11e3-9ce6-dcada3f1c536.gif) |
|
109 |
- |
|
110 |
-This is disabled by default; add the following to your vimrc to enable the extension: |
|
111 |
- |
|
112 |
- let g:airline#extensions#tabline#enabled = 1 |
|
113 |
- |
|
114 |
-Separators can be configured independently for the tabline, so here is how you can define "straight" tabs: |
|
115 |
- |
|
116 |
- let g:airline#extensions#tabline#left_sep = ' ' |
|
117 |
- let g:airline#extensions#tabline#left_alt_sep = '|' |
|
118 |
- |
|
119 |
-In addition, you can also choose which path formatter airline uses. This affects how file paths are |
|
120 |
-displayed in each individual tab as well as the current buffer indicator in the upper right. |
|
121 |
-To do so, set the `formatter` field with: |
|
122 |
- |
|
123 |
- let g:airline#extensions#tabline#formatter = 'default' |
|
124 |
- |
|
125 |
-Here is a complete list of formatters with screenshots: |
|
126 |
- |
|
127 |
-#### `default` |
|
128 |
-![image](https://user-images.githubusercontent.com/2652762/34422844-1d005efa-ebe6-11e7-8053-c784c0da7ba7.png) |
|
129 |
- |
|
130 |
-#### `jsformatter` |
|
131 |
-![image](https://user-images.githubusercontent.com/2652762/34422843-1cf6a4d2-ebe6-11e7-810a-07e6eb08de24.png) |
|
132 |
- |
|
133 |
-#### `unique_tail` |
|
134 |
-![image](https://user-images.githubusercontent.com/2652762/34422841-1ce5b4ec-ebe6-11e7-86e9-3d45c876068b.png) |
|
135 |
- |
|
136 |
-#### `unique_tail_improved` |
|
137 |
-![image](https://user-images.githubusercontent.com/2652762/34422842-1cee23f2-ebe6-11e7-962d-97e068873077.png) |
|
138 |
- |
|
139 |
-## Seamless integration |
|
140 |
- |
|
141 |
-vim-airline integrates with a variety of plugins out of the box. These extensions will be lazily loaded if and only if you have the other plugins installed (and of course you can turn them off). |
|
142 |
- |
|
143 |
-#### [ctrlp.vim][10] |
|
144 |
-![image](https://f.cloud.github.com/assets/306502/962258/7345a224-04ec-11e3-8b5a-f11724a47437.png) |
|
145 |
- |
|
146 |
-#### [unite.vim][9] |
|
147 |
-![image](https://f.cloud.github.com/assets/306502/962319/4d7d3a7e-04ed-11e3-9d59-ab29cb310ff8.png) |
|
148 |
- |
|
149 |
-#### [denite.nvim][51] |
|
150 |
-![image](https://cloud.githubusercontent.com/assets/246230/23939717/f65bce6e-099c-11e7-85c3-918dbc839392.png) |
|
151 |
- |
|
152 |
-#### [tagbar][19] |
|
153 |
-![image](https://f.cloud.github.com/assets/306502/962150/7e7bfae6-04ea-11e3-9e28-32af206aed80.png) |
|
154 |
- |
|
155 |
-#### [csv.vim][28] |
|
156 |
-![image](https://f.cloud.github.com/assets/306502/962204/cfc1210a-04eb-11e3-8a93-42e6bcd21efa.png) |
|
157 |
- |
|
158 |
-#### [syntastic][5] |
|
159 |
-![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png) |
|
160 |
- |
|
161 |
-#### hunks ([vim-gitgutter][29] & [vim-signify][30]) |
|
162 |
-![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png) |
|
163 |
- |
|
164 |
-#### [vimagit][50] |
|
165 |
-![vim-airline-vimagit-demo](https://cloud.githubusercontent.com/assets/533068/22107273/2ea85ba0-de4d-11e6-9fa8-331103b88df4.gif) |
|
166 |
- |
|
167 |
-#### [virtualenv][31] |
|
168 |
-![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png) |
|
169 |
- |
|
170 |
-#### [tmuxline][35] |
|
171 |
-![image](https://f.cloud.github.com/assets/1532071/1559276/4c28fbac-4fc7-11e3-90ef-7e833d980f98.gif) |
|
172 |
- |
|
173 |
-#### [promptline][36] |
|
174 |
-![airline-promptline-sc](https://f.cloud.github.com/assets/1532071/1871900/7d4b28a0-789d-11e3-90e4-16f37269981b.gif) |
|
175 |
- |
|
176 |
-#### [ctrlspace][38] |
|
177 |
-![papercolor_with_ctrlspace](https://cloud.githubusercontent.com/assets/493242/12912041/7fc3c6ec-cf16-11e5-8775-8492b9c64ebf.png) |
|
178 |
- |
|
179 |
-#### [xkb-switch][48]/[xkb-layout][49] |
|
180 |
-![image](https://cloud.githubusercontent.com/assets/5715281/22061422/347e7842-ddb8-11e6-8bdb-7abbd418653c.gif) |
|
181 |
- |
|
182 |
-#### [vimtex][53] |
|
183 |
-![image](https://cloud.githubusercontent.com/assets/1798172/25799740/e77d5c2e-33ee-11e7-8660-d34ce4c5f13f.png) |
|
184 |
- |
|
185 |
-#### [localsearch][54] |
|
186 |
-![image](https://raw.githubusercontent.com/mox-mox/vim-localsearch/master/vim-airline-localsearch-indicator.png) |
|
187 |
- |
|
188 |
-## Extras |
|
189 |
- |
|
190 |
-vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: |
|
191 |
- |
|
192 |
-#### whitespace |
|
193 |
-![image](https://f.cloud.github.com/assets/306502/962401/2a75385e-04ef-11e3-935c-e3b9f0e954cc.png) |
|
194 |
- |
|
195 |
-## Configurable and extensible |
|
196 |
- |
|
197 |
-#### Fine-tuned configuration |
|
198 |
- |
|
199 |
-Every section is composed of parts, and you can reorder and reconfigure them at will. |
|
200 |
- |
|
201 |
-![image](https://f.cloud.github.com/assets/306502/1073278/f291dd4c-14a3-11e3-8a83-268e2753f97d.png) |
|
202 |
- |
|
203 |
-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)). |
|
204 |
- |
|
205 |
-![image](https://f.cloud.github.com/assets/306502/1195815/4bfa38d0-249d-11e3-823e-773cfc2ca894.png) |
|
206 |
- |
|
207 |
-#### Extensible pipeline |
|
208 |
- |
|
209 |
-Completely transform the statusline to your liking. Build out the statusline as you see fit by extracting colors from the current colorscheme's highlight groups. |
|
210 |
- |
|
211 |
-![allyourbase](https://f.cloud.github.com/assets/306502/1022714/e150034a-0da7-11e3-94a5-ca9d58a297e8.png) |
|
212 |
- |
|
213 |
-# Rationale |
|
214 |
- |
|
215 |
-There's already [powerline][2], why yet another statusline? |
|
216 |
- |
|
217 |
-* 100% vimscript; no python needed. |
|
218 |
- |
|
219 |
-What about [vim-powerline][1]? |
|
220 |
- |
|
221 |
-* vim-powerline has been deprecated in favor of the newer, unifying powerline, which is under active development; the new version is written in python at the core and exposes various bindings such that it can style statuslines not only in vim, but also tmux, bash, zsh, and others. |
|
222 |
- |
|
223 |
-# Where did the name come from? |
|
224 |
- |
|
225 |
-I wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. Thanks for flying vim! |
|
226 |
- |
|
227 |
-# Installation |
|
228 |
- |
|
229 |
-This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers: |
|
230 |
- |
|
231 |
-| Plugin Manager | Install with... | |
|
232 |
-| ------------- | ------------- | |
|
233 |
-| [Pathogen][11] | `git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline`<br/>Remember to run `:Helptags` to generate help tags | |
|
234 |
-| [NeoBundle][12] | `NeoBundle 'vim-airline/vim-airline'` | |
|
235 |
-| [Vundle][13] | `Plugin 'vim-airline/vim-airline'` | |
|
236 |
-| [Plug][40] | `Plug 'vim-airline/vim-airline'` | |
|
237 |
-| [VAM][22] | `call vam#ActivateAddons([ 'vim-airline' ])` | |
|
238 |
-| [Dein][52] | `call dein#add('vim-airline/vim-airline')` | |
|
239 |
-| [minpac][55] | `call minpac#add('vim-airline/vim-airline')` | |
|
240 |
-| pack feature (native Vim 8 package feature)| `git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/dist/start/vim-airline`<br/>Remember to run `:helptags` to generate help tags | |
|
241 |
-| manual | copy all of the files into your `~/.vim` directory | |
|
242 |
- |
|
243 |
-# Documentation |
|
244 |
- |
|
245 |
-`:help airline` |
|
246 |
- |
|
247 |
-# Integrating with powerline fonts |
|
248 |
- |
|
249 |
-For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][20]. Prepatched fonts can be found in the [powerline-fonts][3] repository. |
|
250 |
- |
|
251 |
-Finally, you can add the convenience variable `let g:airline_powerline_fonts = 1` to your vimrc which will automatically populate the `g:airline_symbols` dictionary with the powerline symbols. |
|
252 |
- |
|
253 |
-# FAQ |
|
254 |
- |
|
255 |
-Solutions to common problems can be found in the [Wiki][27]. |
|
256 |
- |
|
257 |
-# Performance |
|
258 |
- |
|
259 |
-Whoa! Everything got slow all of a sudden... |
|
260 |
- |
|
261 |
-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. |
|
262 |
- |
|
263 |
-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. |
|
264 |
- |
|
265 |
-The [minivimrc][7] project has some helper mappings to troubleshoot performance related issues. |
|
266 |
- |
|
267 |
-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 (e.g. `:let g:airline_extensions = []`). |
|
268 |
- |
|
269 |
-Also, you can enable caching of the various syntax highlighting groups. This will try to prevent some of the more expensive `:hi` calls in Vim, which seem to be expensive in the Vim core at the expense of possibly not being hunderet percent correct all the times (especially if you often change highlighting groups yourself using `:hi` commands). To set this up do `:let g:airline_highlighting_cache = 1`. A `:AirlineRefresh` will however clear the cache. |
|
270 |
- |
|
271 |
-In addition you might want to check out the [dark_minimal theme][56], which does not change highlighting groups once they are defined. Also please check the [FAQ][27] for more information on how to diagnose and fix the problem. |
|
272 |
- |
|
273 |
-# Screenshots |
|
274 |
- |
|
275 |
-A full list of screenshots for various themes can be found in the [Wiki][14]. |
|
276 |
- |
|
277 |
-# Maintainers |
|
278 |
- |
|
279 |
-The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44]. |
|
280 |
- |
|
281 |
-If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43]. |
|
282 |
- |
|
283 |
-# License |
|
284 |
- |
|
285 |
-MIT License. Copyright (c) 2013-2017 Bailey Ling & Contributors. |
|
286 |
- |
|
287 |
-[1]: https://github.com/Lokaltog/vim-powerline |
|
288 |
-[2]: https://github.com/Lokaltog/powerline |
|
289 |
-[3]: https://github.com/Lokaltog/powerline-fonts |
|
290 |
-[4]: https://github.com/tpope/vim-fugitive |
|
291 |
-[5]: https://github.com/scrooloose/syntastic |
|
292 |
-[6]: https://github.com/bling/vim-bufferline |
|
293 |
-[7]: https://github.com/bling/minivimrc |
|
294 |
-[8]: http://en.wikipedia.org/wiki/Open/closed_principle |
|
295 |
-[9]: https://github.com/Shougo/unite.vim |
|
296 |
-[10]: https://github.com/ctrlpvim/ctrlp.vim |
|
297 |
-[11]: https://github.com/tpope/vim-pathogen |
|
298 |
-[12]: https://github.com/Shougo/neobundle.vim |
|
299 |
-[13]: https://github.com/VundleVim/Vundle.vim |
|
300 |
-[14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots |
|
301 |
-[15]: https://github.com/techlivezheng/vim-plugin-minibufexpl |
|
302 |
-[16]: https://github.com/sjl/gundo.vim |
|
303 |
-[17]: https://github.com/mbbill/undotree |
|
304 |
-[18]: https://github.com/scrooloose/nerdtree |
|
305 |
-[19]: https://github.com/majutsushi/tagbar |
|
306 |
-[20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts |
|
307 |
-[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium |
|
308 |
-[22]: https://github.com/MarcWeber/vim-addon-manager |
|
309 |
-[23]: https://github.com/altercation/solarized |
|
310 |
-[24]: https://github.com/chriskempson/tomorrow-theme |
|
311 |
-[25]: https://github.com/tomasr/molokai |
|
312 |
-[26]: https://github.com/nanotech/jellybeans.vim |
|
313 |
-[27]: https://github.com/vim-airline/vim-airline/wiki/FAQ |
|
314 |
-[28]: https://github.com/chrisbra/csv.vim |
|
315 |
-[29]: https://github.com/airblade/vim-gitgutter |
|
316 |
-[30]: https://github.com/mhinz/vim-signify |
|
317 |
-[31]: https://github.com/jmcantrell/vim-virtualenv |
|
318 |
-[32]: https://github.com/chriskempson/base16-vim |
|
319 |
-[33]: https://github.com/vim-airline/vim-airline/wiki/Test-Plan |
|
320 |
-[34]: http://eclim.org |
|
321 |
-[35]: https://github.com/edkolev/tmuxline.vim |
|
322 |
-[36]: https://github.com/edkolev/promptline.vim |
|
323 |
-[37]: https://github.com/gcmt/taboo.vim |
|
324 |
-[38]: https://github.com/szw/vim-ctrlspace |
|
325 |
-[39]: https://github.com/tomtom/quickfixsigns_vim |
|
326 |
-[40]: https://github.com/junegunn/vim-plug |
|
327 |
-[41]: https://github.com/bling |
|
328 |
-[42]: https://github.com/chrisbra |
|
329 |
-[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer |
|
330 |
-[44]: https://github.com/mhartington |
|
331 |
-[45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b |
|
332 |
-[46]: https://github.com/vim-airline/vim-airline#themes |
|
333 |
-[47]: https://github.com/mildred/vim-bufmru |
|
334 |
-[48]: https://github.com/ierton/xkb-switch |
|
335 |
-[49]: https://github.com/vovkasm/input-source-switcher |
|
336 |
-[50]: https://github.com/jreybert/vimagit |
|
337 |
-[51]: https://github.com/Shougo/denite.nvim |
|
338 |
-[52]: https://github.com/Shougo/dein.vim |
|
339 |
-[53]: https://github.com/lervag/vimtex |
|
340 |
-[54]: https://github.com/mox-mox/vim-localsearch |
|
341 |
-[55]: https://github.com/k-takata/minpac/ |
|
342 |
-[56]: https://github.com/vim-airline/vim-airline-themes/blob/master/autoload/airline/themes/dark_minimal.vim |
... | ... |
@@ -1,196 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 Bailey Ling et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', []) |
|
7 |
- |
|
8 |
-let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning'] |
|
9 |
-let s:inactive_funcrefs = [] |
|
10 |
- |
|
11 |
-function! airline#add_statusline_func(name) |
|
12 |
- call airline#add_statusline_funcref(function(a:name)) |
|
13 |
-endfunction |
|
14 |
- |
|
15 |
-function! airline#add_statusline_funcref(function) |
|
16 |
- if index(g:airline_statusline_funcrefs, a:function) >= 0 |
|
17 |
- echohl WarningMsg |
|
18 |
- echo 'The airline statusline funcref '.string(a:function).' has already been added.' |
|
19 |
- echohl NONE |
|
20 |
- return |
|
21 |
- endif |
|
22 |
- call add(g:airline_statusline_funcrefs, a:function) |
|
23 |
-endfunction |
|
24 |
- |
|
25 |
-function! airline#remove_statusline_func(name) |
|
26 |
- let i = index(g:airline_statusline_funcrefs, function(a:name)) |
|
27 |
- if i > -1 |
|
28 |
- call remove(g:airline_statusline_funcrefs, i) |
|
29 |
- endif |
|
30 |
-endfunction |
|
31 |
- |
|
32 |
-function! airline#add_inactive_statusline_func(name) |
|
33 |
- call add(s:inactive_funcrefs, function(a:name)) |
|
34 |
-endfunction |
|
35 |
- |
|
36 |
-function! airline#load_theme() |
|
37 |
- let g:airline_theme = get(g:, 'airline_theme', 'dark') |
|
38 |
- if exists('*airline#themes#{g:airline_theme}#refresh') |
|
39 |
- call airline#themes#{g:airline_theme}#refresh() |
|
40 |
- endif |
|
41 |
- |
|
42 |
- let palette = g:airline#themes#{g:airline_theme}#palette |
|
43 |
- call airline#themes#patch(palette) |
|
44 |
- |
|
45 |
- if exists('g:airline_theme_patch_func') |
|
46 |
- let Fn = function(g:airline_theme_patch_func) |
|
47 |
- call Fn(palette) |
|
48 |
- endif |
|
49 |
- |
|
50 |
- call airline#highlighter#load_theme() |
|
51 |
- call airline#extensions#load_theme() |
|
52 |
- call airline#update_statusline() |
|
53 |
-endfunction |
|
54 |
- |
|
55 |
-function! airline#switch_theme(name) |
|
56 |
- try |
|
57 |
- let palette = g:airline#themes#{a:name}#palette "also lazy loads the theme |
|
58 |
- let g:airline_theme = a:name |
|
59 |
- catch |
|
60 |
- echohl WarningMsg | echo 'The specified theme cannot be found.' | echohl NONE |
|
61 |
- if exists('g:airline_theme') |
|
62 |
- return |
|
63 |
- else |
|
64 |
- let g:airline_theme = 'dark' |
|
65 |
- endif |
|
66 |
- endtry |
|
67 |
- |
|
68 |
- let w:airline_lastmode = '' |
|
69 |
- call airline#load_theme() |
|
70 |
- |
|
71 |
- silent doautocmd User AirlineAfterTheme |
|
72 |
- |
|
73 |
- " this is required to prevent clobbering the startup info message, i don't know why... |
|
74 |
- call airline#check_mode(winnr()) |
|
75 |
-endfunction |
|
76 |
- |
|
77 |
-function! airline#switch_matching_theme() |
|
78 |
- if exists('g:colors_name') |
|
79 |
- let existing = g:airline_theme |
|
80 |
- let theme = substitute(tolower(g:colors_name), '-', '_', 'g') |
|
81 |
- try |
|
82 |
- let palette = g:airline#themes#{theme}#palette |
|
83 |
- call airline#switch_theme(theme) |
|
84 |
- return 1 |
|
85 |
- catch |
|
86 |
- for map in items(g:airline_theme_map) |
|
87 |
- if match(g:colors_name, map[0]) > -1 |
|
88 |
- try |
|
89 |
- let palette = g:airline#themes#{map[1]}#palette |
|
90 |
- call airline#switch_theme(map[1]) |
|
91 |
- catch |
|
92 |
- call airline#switch_theme(existing) |
|
93 |
- endtry |
|
94 |
- return 1 |
|
95 |
- endif |
|
96 |
- endfor |
|
97 |
- endtry |
|
98 |
- endif |
|
99 |
- return 0 |
|
100 |
-endfunction |
|
101 |
- |
|
102 |
-function! airline#update_statusline() |
|
103 |
- if airline#util#getwinvar(winnr(), 'airline_disabled', 0) |
|
104 |
- return |
|
105 |
- endif |
|
106 |
- for nr in filter(range(1, winnr('$')), 'v:val != winnr()') |
|
107 |
- if airline#util#getwinvar(nr, 'airline_disabled', 0) |
|
108 |
- continue |
|
109 |
- endif |
|
110 |
- call setwinvar(nr, 'airline_active', 0) |
|
111 |
- let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) } |
|
112 |
- call s:invoke_funcrefs(context, s:inactive_funcrefs) |
|
113 |
- endfor |
|
114 |
- |
|
115 |
- unlet! w:airline_render_left w:airline_render_right |
|
116 |
- exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_') |
|
117 |
- |
|
118 |
- let w:airline_active = 1 |
|
119 |
- let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } |
|
120 |
- call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) |
|
121 |
-endfunction |
|
122 |
- |
|
123 |
-let s:contexts = {} |
|
124 |
-let s:core_funcrefs = [ |
|
125 |
- \ function('airline#extensions#apply'), |
|
126 |
- \ function('airline#extensions#default#apply') ] |
|
127 |
-function! s:invoke_funcrefs(context, funcrefs) |
|
128 |
- let builder = airline#builder#new(a:context) |
|
129 |
- let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context) |
|
130 |
- if err == 1 |
|
131 |
- let a:context.line = builder.build() |
|
132 |
- let s:contexts[a:context.winnr] = a:context |
|
133 |
- call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')') |
|
134 |
- endif |
|
135 |
-endfunction |
|
136 |
- |
|
137 |
-function! airline#statusline(winnr) |
|
138 |
- if has_key(s:contexts, a:winnr) |
|
139 |
- return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line |
|
140 |
- endif |
|
141 |
- |
|
142 |
- " in rare circumstances this happens...see #276 |
|
143 |
- return '' |
|
144 |
-endfunction |
|
145 |
- |
|
146 |
-function! airline#check_mode(winnr) |
|
147 |
- let context = s:contexts[a:winnr] |
|
148 |
- |
|
149 |
- if get(w:, 'airline_active', 1) |
|
150 |
- let l:m = mode() |
|
151 |
- if l:m ==# "i" |
|
152 |
- let l:mode = ['insert'] |
|
153 |
- elseif l:m ==# "R" |
|
154 |
- let l:mode = ['replace'] |
|
155 |
- elseif l:m =~# '\v(v|V||s|S|)' |
|
156 |
- let l:mode = ['visual'] |
|
157 |
- elseif l:m ==# "t" |
|
158 |
- let l:mode = ['terminal'] |
|
159 |
- else |
|
160 |
- let l:mode = ['normal'] |
|
161 |
- endif |
|
162 |
- let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) |
|
163 |
- else |
|
164 |
- let l:mode = ['inactive'] |
|
165 |
- let w:airline_current_mode = get(g:airline_mode_map, '__') |
|
166 |
- endif |
|
167 |
- |
|
168 |
- if g:airline_detect_modified && &modified |
|
169 |
- call add(l:mode, 'modified') |
|
170 |
- endif |
|
171 |
- |
|
172 |
- if g:airline_detect_paste && &paste |
|
173 |
- call add(l:mode, 'paste') |
|
174 |
- endif |
|
175 |
- |
|
176 |
- if g:airline_detect_crypt && exists("+key") && !empty(&key) |
|
177 |
- call add(l:mode, 'crypt') |
|
178 |
- endif |
|
179 |
- |
|
180 |
- if g:airline_detect_spell && &spell |
|
181 |
- call add(l:mode, 'spell') |
|
182 |
- endif |
|
183 |
- |
|
184 |
- if &readonly || ! &modifiable |
|
185 |
- call add(l:mode, 'readonly') |
|
186 |
- endif |
|
187 |
- |
|
188 |
- let mode_string = join(l:mode) |
|
189 |
- if get(w:, 'airline_lastmode', '') != mode_string |
|
190 |
- call airline#highlighter#highlight_modified_inactive(context.bufnr) |
|
191 |
- call airline#highlighter#highlight(l:mode, context.bufnr) |
|
192 |
- let w:airline_lastmode = mode_string |
|
193 |
- endif |
|
194 |
- |
|
195 |
- return '' |
|
196 |
-endfunction |
... | ... |
@@ -1,259 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 C.Brabandt et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-let s:untracked_jobs = {} |
|
7 |
-let s:mq_jobs = {} |
|
8 |
-let s:po_jobs = {} |
|
9 |
- |
|
10 |
-" Generic functions handling on exit event of the various async functions |
|
11 |
-function! s:untracked_output(dict, buf) |
|
12 |
- if a:buf =~? ('^'. a:dict.cfg['untracked_mark']) |
|
13 |
- let a:dict.cfg.untracked[a:dict.file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists) |
|
14 |
- else |
|
15 |
- let a:dict.cfg.untracked[a:dict.file] = '' |
|
16 |
- endif |
|
17 |
-endfunction |
|
18 |
- |
|
19 |
-" also called from branch extension (for non-async vims) |
|
20 |
-function! airline#async#mq_output(buf, file) |
|
21 |
- let buf=a:buf |
|
22 |
- if !empty(a:buf) |
|
23 |
- if a:buf =~# 'no patches applied' || |
|
24 |
- \ a:buf =~# "unknown command 'qtop'" || |
|
25 |
- \ a:buf =~# "abort" |
|
26 |
- let buf = '' |
|
27 |
- elseif exists("b:mq") && b:mq isnot# buf |
|
28 |
- " make sure, statusline is updated |
|
29 |
- unlet! b:airline_head |
|
30 |
- endif |
|
31 |
- let b:mq = buf |
|
32 |
- endif |
|
33 |
- if has_key(s:mq_jobs, a:file) |
|
34 |
- call remove(s:mq_jobs, a:file) |
|
35 |
- endif |
|
36 |
-endfunction |
|
37 |
- |
|
38 |
-function! s:po_output(buf, file) |
|
39 |
- if !empty(a:buf) |
|
40 |
- let b:airline_po_stats = printf("[%s]", a:buf) |
|
41 |
- else |
|
42 |
- let b:airline_po_stats = '' |
|
43 |
- endif |
|
44 |
- if has_key(s:po_jobs, a:file) |
|
45 |
- call remove(s:po_jobs, a:file) |
|
46 |
- endif |
|
47 |
-endfunction |
|
48 |
- |
|
49 |
-function! s:valid_dir(dir) |
|
50 |
- if empty(a:dir) || !isdirectory(a:dir) |
|
51 |
- return getcwd() |
|
52 |
- endif |
|
53 |
- return a:dir |
|
54 |
-endfunction |
|
55 |
- |
|
56 |
-if v:version >= 800 && has("job") |
|
57 |
- " Vim 8.0 with Job feature |
|
58 |
- " TODO: Check if we need the cwd option for the job_start() functions |
|
59 |
- " (only works starting with Vim 8.0.0902) |
|
60 |
- |
|
61 |
- function! s:on_stdout(channel, msg) dict abort |
|
62 |
- let self.buf .= a:msg |
|
63 |
- endfunction |
|
64 |
- |
|
65 |
- function! s:on_exit_mq(channel) dict abort |
|
66 |
- call airline#async#mq_output(self.buf, self.file) |
|
67 |
- endfunction |
|
68 |
- |
|
69 |
- function! s:on_exit_untracked(channel) dict abort |
|
70 |
- call s:untracked_output(self, self.buf) |
|
71 |
- if has_key(s:untracked_jobs, self.file) |
|
72 |
- call remove(s:untracked_jobs, self.file) |
|
73 |
- endif |
|
74 |
- endfunction |
|
75 |
- |
|
76 |
- function! s:on_exit_po(channel) dict abort |
|
77 |
- call s:po_output(self.buf, self.file) |
|
78 |
- call airline#extensions#po#shorten() |
|
79 |
- endfunction |
|
80 |
- |
|
81 |
- function! airline#async#get_mq_async(cmd, file) |
|
82 |
- if g:airline#init#is_windows && &shell =~ 'cmd' |
|
83 |
- let cmd = a:cmd |
|
84 |
- else |
|
85 |
- let cmd = ['sh', '-c', a:cmd] |
|
86 |
- endif |
|
87 |
- |
|
88 |
- let options = {'cmd': a:cmd, 'buf': '', 'file': a:file} |
|
89 |
- if has_key(s:mq_jobs, a:file) |
|
90 |
- if job_status(get(s:mq_jobs, a:file)) == 'run' |
|
91 |
- return |
|
92 |
- elseif has_key(s:mq_jobs, a:file) |
|
93 |
- call remove(s:mq_jobs, a:file) |
|
94 |
- endif |
|
95 |
- endif |
|
96 |
- let id = job_start(cmd, { |
|
97 |
- \ 'err_io': 'out', |
|
98 |
- \ 'out_cb': function('s:on_stdout', options), |
|
99 |
- \ 'close_cb': function('s:on_exit_mq', options)}) |
|
100 |
- let s:mq_jobs[a:file] = id |
|
101 |
- endfunction |
|
102 |
- |
|
103 |
- function! airline#async#get_msgfmt_stat(cmd, file) |
|
104 |
- if g:airline#init#is_windows || !executable('msgfmt') |
|
105 |
- " no msgfmt on windows? |
|
106 |
- return |
|
107 |
- else |
|
108 |
- let cmd = ['sh', '-c', a:cmd. shellescape(a:file)] |
|
109 |
- endif |
|
110 |
- |
|
111 |
- let options = {'buf': '', 'file': a:file} |
|
112 |
- if has_key(s:po_jobs, a:file) |
|
113 |
- if job_status(get(s:po_jobs, a:file)) == 'run' |
|
114 |
- return |
|
115 |
- elseif has_key(s:po_jobs, a:file) |
|
116 |
- call remove(s:po_jobs, a:file) |
|
117 |
- endif |
|
118 |
- endif |
|
119 |
- let id = job_start(cmd, { |
|
120 |
- \ 'err_io': 'out', |
|
121 |
- \ 'out_cb': function('s:on_stdout', options), |
|
122 |
- \ 'close_cb': function('s:on_exit_po', options)}) |
|
123 |
- let s:po_jobs[a:file] = id |
|
124 |
- endfunction |
|
125 |
- |
|
126 |
- function airline#async#vim_vcs_untracked(config, file) |
|
127 |
- if g:airline#init#is_windows && &shell =~ 'cmd' |
|
128 |
- let cmd = a:config['cmd'] . shellescape(a:file) |
|
129 |
- else |
|
130 |
- let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)] |
|
131 |
- endif |
|
132 |
- |
|
133 |
- let options = {'cfg': a:config, 'buf': '', 'file': a:file} |
|
134 |
- if has_key(s:untracked_jobs, a:file) |
|
135 |
- if job_status(get(s:untracked_jobs, a:file)) == 'run' |
|
136 |
- return |
|
137 |
- elseif has_key(s:untracked_jobs, a:file) |
|
138 |
- call remove(s:untracked_jobs, a:file) |
|
139 |
- endif |
|
140 |
- endif |
|
141 |
- let id = job_start(cmd, { |
|
142 |
- \ 'err_io': 'out', |
|
143 |
- \ 'out_cb': function('s:on_stdout', options), |
|
144 |
- \ 'close_cb': function('s:on_exit_untracked', options)}) |
|
145 |
- let s:untracked_jobs[a:file] = id |
|
146 |
- endfunction |
|
147 |
- |
|
148 |
-elseif has("nvim") |
|
149 |
- " NVim specific functions |
|
150 |
- |
|
151 |
- function! s:nvim_output_handler(job_id, data, event) dict |
|
152 |
- if a:event == 'stdout' || a:event == 'stderr' |
|
153 |
- let self.buf .= join(a:data) |
|
154 |
- endif |
|
155 |
- endfunction |
|
156 |
- |
|
157 |
- function! s:nvim_untracked_job_handler(job_id, data, event) dict |
|
158 |
- if a:event == 'exit' |
|
159 |
- call s:untracked_output(self, self.buf) |
|
160 |
- if has_key(s:untracked_jobs, self.file) |
|
161 |
- call remove(s:untracked_jobs, self.file) |
|
162 |
- endif |
|
163 |
- endif |
|
164 |
- endfunction |
|
165 |
- |
|
166 |
- function! s:nvim_mq_job_handler(job_id, data, event) dict |
|
167 |
- if a:event == 'exit' |
|
168 |
- call airline#async#mq_output(self.buf, self.file) |
|
169 |
- endif |
|
170 |
- endfunction |
|
171 |
- |
|
172 |
- function! s:nvim_po_job_handler(job_id, data, event) dict |
|
173 |
- if a:event == 'exit' |
|
174 |
- call s:po_output(self.buf, self.file) |
|
175 |
- call airline#extensions#po#shorten() |
|
176 |
- endif |
|
177 |
- endfunction |
|
178 |
- |
|
179 |
- function! airline#async#nvim_get_mq_async(cmd, file) |
|
180 |
- let config = { |
|
181 |
- \ 'buf': '', |
|
182 |
- \ 'file': a:file, |
|
183 |
- \ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')), |
|
184 |
- \ 'on_stdout': function('s:nvim_output_handler'), |
|
185 |
- \ 'on_stderr': function('s:nvim_output_handler'), |
|
186 |
- \ 'on_exit': function('s:nvim_mq_job_handler') |
|
187 |
- \ } |
|
188 |
- if g:airline#init#is_windows && &shell =~ 'cmd' |
|
189 |
- let cmd = a:cmd |
|
190 |
- else |
|
191 |
- let cmd = ['sh', '-c', a:cmd] |
|
192 |
- endif |
|
193 |
- |
|
194 |
- if has_key(s:mq_jobs, a:file) |
|
195 |
- call remove(s:mq_jobs, a:file) |
|
196 |
- endif |
|
197 |
- let id = jobstart(cmd, config) |
|
198 |
- let s:mq_jobs[a:file] = id |
|
199 |
- endfunction |
|
200 |
- |
|
201 |
- function! airline#async#nvim_get_msgfmt_stat(cmd, file) |
|
202 |
- let config = { |
|
203 |
- \ 'buf': '', |
|
204 |
- \ 'file': a:file, |
|
205 |
- \ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')), |
|
206 |
- \ 'on_stdout': function('s:nvim_output_handler'), |
|
207 |
- \ 'on_stderr': function('s:nvim_output_handler'), |
|
208 |
- \ 'on_exit': function('s:nvim_po_job_handler') |
|
209 |
- \ } |
|
210 |
- if g:airline#init#is_windows && &shell =~ 'cmd' |
|
211 |
- " no msgfmt on windows? |
|
212 |
- return |
|
213 |
- else |
|
214 |
- let cmd = ['sh', '-c', a:cmd. shellescape(a:file)] |
|
215 |
- endif |
|
216 |
- |
|
217 |
- if has_key(s:po_jobs, a:file) |
|
218 |
- call remove(s:po_jobs, a:file) |
|
219 |
- endif |
|
220 |
- let id = jobstart(cmd, config) |
|
221 |
- let s:po_jobs[a:file] = id |
|
222 |
- endfunction |
|
223 |
- |
|
224 |
-endif |
|
225 |
- |
|
226 |
-" Should work in either Vim pre 8 or Nvim |
|
227 |
-function! airline#async#nvim_vcs_untracked(cfg, file, vcs) |
|
228 |
- let cmd = a:cfg.cmd . shellescape(a:file) |
|
229 |
- let id = -1 |
|
230 |
- let config = { |
|
231 |
- \ 'buf': '', |
|
232 |
- \ 'vcs': a:vcs, |
|
233 |
- \ 'cfg': a:cfg, |
|
234 |
- \ 'file': a:file, |
|
235 |
- \ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')) |
|
236 |
- \ } |
|
237 |
- if has("nvim") |
|
238 |
- call extend(config, { |
|
239 |
- \ 'on_stdout': function('s:nvim_output_handler'), |
|
240 |
- \ 'on_exit': function('s:nvim_untracked_job_handler')}) |
|
241 |
- if has_key(s:untracked_jobs, config.file) |
|
242 |
- " still running |
|
243 |
- return |
|
244 |
- endif |
|
245 |
- try |
|
246 |
- let id = jobstart(cmd, config) |
|
247 |
- catch |
|
248 |
- " catch-all, jobstart() failed, fall back to system() |
|
249 |
- let id=-1 |
|
250 |
- endtry |
|
251 |
- let s:untracked_jobs[a:file] = id |
|
252 |
- endif |
|
253 |
- " vim without job feature or nvim jobstart failed |
|
254 |
- if id < 1 |
|
255 |
- let output=system(cmd) |
|
256 |
- call s:untracked_output(config, output) |
|
257 |
- call airline#extensions#branch#update_untracked_config(a:file, a:vcs) |
|
258 |
- endif |
|
259 |
-endfunction |
... | ... |
@@ -1,243 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 Bailey Ling et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-let s:prototype = {} |
|
7 |
- |
|
8 |
-function! s:prototype.split(...) dict |
|
9 |
- call add(self._sections, ['|', a:0 ? a:1 : '%=']) |
|
10 |
-endfunction |
|
11 |
- |
|
12 |
-function! s:prototype.add_section_spaced(group, contents) dict |
|
13 |
- let spc = empty(a:contents) ? '' : g:airline_symbols.space |
|
14 |
- call self.add_section(a:group, spc.a:contents.spc) |
|
15 |
-endfunction |
|
16 |
- |
|
17 |
-function! s:prototype.add_section(group, contents) dict |
|
18 |
- call add(self._sections, [a:group, a:contents]) |
|
19 |
-endfunction |
|
20 |
- |
|
21 |
-function! s:prototype.add_raw(text) dict |
|
22 |
- call add(self._sections, ['', a:text]) |
|
23 |
-endfunction |
|
24 |
- |
|
25 |
-function! s:prototype.insert_section(group, contents, position) dict |
|
26 |
- call insert(self._sections, [a:group, a:contents], a:position) |
|
27 |
-endfunction |
|
28 |
- |
|
29 |
-function! s:prototype.insert_raw(text, position) dict |
|
30 |
- call insert(self._sections, ['', a:text], a:position) |
|
31 |
-endfunction |
|
32 |
- |
|
33 |
-function! s:prototype.get_position() dict |
|
34 |
- return len(self._sections) |
|
35 |
-endfunction |
|
36 |
- |
|
37 |
-function! airline#builder#get_prev_group(sections, i) |
|
38 |
- let x = a:i - 1 |
|
39 |
- while x >= 0 |
|
40 |
- let group = a:sections[x][0] |
|
41 |
- if group != '' && group != '|' |
|
42 |
- return group |
|
43 |
- endif |
|
44 |
- let x = x - 1 |
|
45 |
- endwhile |
|
46 |
- return '' |
|
47 |
-endfunction |
|
48 |
- |
|
49 |
-function! airline#builder#get_next_group(sections, i) |
|
50 |
- let x = a:i + 1 |
|
51 |
- let l = len(a:sections) |
|
52 |
- while x < l |
|
53 |
- let group = a:sections[x][0] |
|
54 |
- if group != '' && group != '|' |
|
55 |
- return group |
|
56 |
- endif |
|
57 |
- let x = x + 1 |
|
58 |
- endwhile |
|
59 |
- return '' |
|
60 |
-endfunction |
|
61 |
- |
|
62 |
-function! s:prototype.build() dict |
|
63 |
- let side = 1 |
|
64 |
- let line = '' |
|
65 |
- let i = 0 |
|
66 |
- let length = len(self._sections) |
|
67 |
- let split = 0 |
|
68 |
- let is_empty = 0 |
|
69 |
- let prev_group = '' |
|
70 |
- |
|
71 |
- while i < length |
|
72 |
- let section = self._sections[i] |
|
73 |
- let group = section[0] |
|
74 |
- let contents = section[1] |
|
75 |
- let pgroup = prev_group |
|
76 |
- let prev_group = airline#builder#get_prev_group(self._sections, i) |
|
77 |
- if group ==# 'airline_c' && &buftype ==# 'terminal' && self._context.active |
|
78 |
- let group = 'airline_term' |
|
79 |
- elseif group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') |
|
80 |
- let group = 'airline_c'. self._context.bufnr |
|
81 |
- elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') |
|
82 |
- let prev_group = 'airline_c'. self._context.bufnr |
|
83 |
- endif |
|
84 |
- if is_empty |
|
85 |
- let prev_group = pgroup |
|
86 |
- endif |
|
87 |
- let is_empty = s:section_is_empty(self, contents) |
|
88 |
- |
|
89 |
- if is_empty |
|
90 |
- " need to fix highlighting groups, since we |
|
91 |
- " have skipped a section, we actually need |
|
92 |
- " the previous previous group and so the |
|
93 |
- " seperator goes from the previous previous group |
|
94 |
- " to the current group |
|
95 |
- let pgroup = group |
|
96 |
- endif |
|
97 |
- |
|
98 |
- if group == '' |
|
99 |
- let line .= contents |
|
100 |
- elseif group == '|' |
|
101 |
- let side = 0 |
|
102 |
- let line .= contents |
|
103 |
- let split = 1 |
|
104 |
- else |
|
105 |
- if prev_group == '' |
|
106 |
- let line .= '%#'.group.'#' |
|
107 |
- elseif split |
|
108 |
- if !is_empty |
|
109 |
- let line .= s:get_transitioned_seperator(self, prev_group, group, side) |
|
110 |
- endif |
|
111 |
- let split = 0 |
|
112 |
- else |
|
113 |
- if !is_empty |
|
114 |
- let line .= s:get_seperator(self, prev_group, group, side) |
|
115 |
- endif |
|
116 |
- endif |
|
117 |
- let line .= is_empty ? '' : s:get_accented_line(self, group, contents) |
|
118 |
- endif |
|
119 |
- |
|
120 |
- let i = i + 1 |
|
121 |
- endwhile |
|
122 |
- |
|
123 |
- if !self._context.active |
|
124 |
- "let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '') |
|
125 |
- let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g') |
|
126 |
- endif |
|
127 |
- return line |
|
128 |
-endfunction |
|
129 |
- |
|
130 |
-function! airline#builder#should_change_group(group1, group2) |
|
131 |
- if a:group1 == a:group2 |
|
132 |
- return 0 |
|
133 |
- endif |
|
134 |
- let color1 = airline#highlighter#get_highlight(a:group1) |
|
135 |
- let color2 = airline#highlighter#get_highlight(a:group2) |
|
136 |
- if g:airline_gui_mode ==# 'gui' |
|
137 |
- return color1[1] != color2[1] || color1[0] != color2[0] |
|
138 |
- else |
|
139 |
- return color1[3] != color2[3] || color1[2] != color2[2] |
|
140 |
- endif |
|
141 |
-endfunction |
|
142 |
- |
|
143 |
-function! s:get_transitioned_seperator(self, prev_group, group, side) |
|
144 |
- let line = '' |
|
145 |
- call airline#highlighter#add_separator(a:prev_group, a:group, a:side) |
|
146 |
- if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side |
|
147 |
- call airline#highlighter#add_separator(a:prev_group, a:group, 0) |
|
148 |
- let line .= '%#'.a:prev_group.'_to_'.a:group.'#' |
|
149 |
- let line .= a:self._context.right_sep.'%#'.a:group.'#' |
|
150 |
- else |
|
151 |
- call airline#highlighter#add_separator(a:prev_group, a:group, a:side) |
|
152 |
- let line .= '%#'.a:prev_group.'_to_'.a:group.'#' |
|
153 |
- let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep |
|
154 |
- let line .= '%#'.a:group.'#' |
|
155 |
- endif |
|
156 |
- return line |
|
157 |
-endfunction |
|
158 |
- |
|
159 |
-function! s:get_seperator(self, prev_group, group, side) |
|
160 |
- if airline#builder#should_change_group(a:prev_group, a:group) |
|
161 |
- return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side) |
|
162 |
- else |
|
163 |
- return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep |
|
164 |
- endif |
|
165 |
-endfunction |
|
166 |
- |
|
167 |
-function! s:get_accented_line(self, group, contents) |
|
168 |
- if a:self._context.active |
|
169 |
- let contents = [] |
|
170 |
- let content_parts = split(a:contents, '__accent') |
|
171 |
- for cpart in content_parts |
|
172 |
- let accent = matchstr(cpart, '_\zs[^#]*\ze') |
|
173 |
- call add(contents, cpart) |
|
174 |
- endfor |
|
175 |
- let line = join(contents, a:group) |
|
176 |
- let line = substitute(line, '__restore__', a:group, 'g') |
|
177 |
- else |
|
178 |
- let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g') |
|
179 |
- let line = substitute(line, '%#__restore__#', '', 'g') |
|
180 |
- endif |
|
181 |
- return line |
|
182 |
-endfunction |
|
183 |
- |
|
184 |
-function! s:section_is_empty(self, content) |
|
185 |
- let start=1 |
|
186 |
- |
|
187 |
- " do not check for inactive windows or the tabline |
|
188 |
- if a:self._context.active == 0 |
|
189 |
- return 0 |
|
190 |
- elseif get(a:self._context, 'tabline', 0) |
|
191 |
- return 0 |
|
192 |
- endif |
|
193 |
- |
|
194 |
- " only check, if airline#skip_empty_sections == 1 |
|
195 |
- if get(g:, 'airline_skip_empty_sections', 0) == 0 |
|
196 |
- return 0 |
|
197 |
- endif |
|
198 |
- |
|
199 |
- " only check, if airline#skip_empty_sections == 1 |
|
200 |
- if get(w:, 'airline_skip_empty_sections', -1) == 0 |
|
201 |
- return 0 |
|
202 |
- endif |
|
203 |
- " assume accents sections to be never empty |
|
204 |
- " (avoides, that on startup the mode message becomes empty) |
|
205 |
- if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1 |
|
206 |
- return 0 |
|
207 |
- endif |
|
208 |
- if empty(a:content) |
|
209 |
- return 1 |
|
210 |
- endif |
|
211 |
- let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) |
|
212 |
- if empty(list) |
|
213 |
- return 0 " no function in statusline text |
|
214 |
- endif |
|
215 |
- while len(list) > 0 |
|
216 |
- let expr = list[0] |
|
217 |
- try |
|
218 |
- " catch all exceptions, just in case |
|
219 |
- if !empty(eval(expr)) |
|
220 |
- return 0 |
|
221 |
- endif |
|
222 |
- catch |
|
223 |
- return 0 |
|
224 |
- endtry |
|
225 |
- let start += 1 |
|
226 |
- let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) |
|
227 |
- endw |
|
228 |
- return 1 |
|
229 |
-endfunction |
|
230 |
- |
|
231 |
-function! airline#builder#new(context) |
|
232 |
- let builder = copy(s:prototype) |
|
233 |
- let builder._context = a:context |
|
234 |
- let builder._sections = [] |
|
235 |
- |
|
236 |
- call extend(builder._context, { |
|
237 |
- \ 'left_sep': g:airline_left_sep, |
|
238 |
- \ 'left_alt_sep': g:airline_left_alt_sep, |
|
239 |
- \ 'right_sep': g:airline_right_sep, |
|
240 |
- \ 'right_alt_sep': g:airline_right_alt_sep, |
|
241 |
- \ }, 'keep') |
|
242 |
- return builder |
|
243 |
-endfunction |
... | ... |
@@ -1,51 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 Bailey Ling et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-function! airline#debug#profile1() |
|
7 |
- profile start airline-profile-switch.log |
|
8 |
- profile func * |
|
9 |
- profile file * |
|
10 |
- split |
|
11 |
- for i in range(1, 1000) |
|
12 |
- wincmd w |
|
13 |
- redrawstatus |
|
14 |
- endfor |
|
15 |
- profile pause |
|
16 |
- noautocmd qall! |
|
17 |
-endfunction |
|
18 |
- |
|
19 |
-function! airline#debug#profile2() |
|
20 |
- profile start airline-profile-cursor.log |
|
21 |
- profile func * |
|
22 |
- profile file * |
|
23 |
- edit blank |
|
24 |
- call setline(1, 'all your base are belong to us') |
|
25 |
- call setline(2, 'all your base are belong to us') |
|
26 |
- let positions = [[1,2], [2,2], [1,2], [1,1]] |
|
27 |
- for i in range(1, 1000) |
|
28 |
- for pos in positions |
|
29 |
- call cursor(pos[0], pos[1]) |
|
30 |
- redrawstatus |
|
31 |
- endfor |
|
32 |
- endfor |
|
33 |
- profile pause |
|
34 |
- noautocmd qall! |
|
35 |
-endfunction |
|
36 |
- |
|
37 |
-function! airline#debug#profile3() |
|
38 |
- profile start airline-profile-mode.log |
|
39 |
- profile func * |
|
40 |
- profile file * |
|
41 |
- |
|
42 |
- for i in range(1000) |
|
43 |
- startinsert |
|
44 |
- redrawstatus |
|
45 |
- stopinsert |
|
46 |
- redrawstatus |
|
47 |
- endfor |
|
48 |
- |
|
49 |
- profile pause |
|
50 |
- noautocmd qall! |
|
51 |
-endfunction |
... | ... |
@@ -1,371 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 Bailey Ling et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-let s:ext = {} |
|
7 |
-let s:ext._theme_funcrefs = [] |
|
8 |
- |
|
9 |
-function! s:ext.add_statusline_func(name) dict |
|
10 |
- call airline#add_statusline_func(a:name) |
|
11 |
-endfunction |
|
12 |
-function! s:ext.add_statusline_funcref(function) dict |
|
13 |
- call airline#add_statusline_funcref(a:function) |
|
14 |
-endfunction |
|
15 |
-function! s:ext.add_inactive_statusline_func(name) dict |
|
16 |
- call airline#add_inactive_statusline_func(a:name) |
|
17 |
-endfunction |
|
18 |
-function! s:ext.add_theme_func(name) dict |
|
19 |
- call add(self._theme_funcrefs, function(a:name)) |
|
20 |
-endfunction |
|
21 |
- |
|
22 |
-let s:script_path = tolower(resolve(expand('<sfile>:p:h'))) |
|
23 |
- |
|
24 |
-let s:filetype_overrides = { |
|
25 |
- \ 'nerdtree': [ get(g:, 'NERDTreeStatusline', 'NERD'), '' ], |
|
26 |
- \ 'gundo': [ 'Gundo', '' ], |
|
27 |
- \ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ], |
|
28 |
- \ 'minibufexpl': [ 'MiniBufExplorer', '' ], |
|
29 |
- \ 'startify': [ 'startify', '' ], |
|
30 |
- \ 'vim-plug': [ 'Plugins', '' ], |
|
31 |
- \ } |
|
32 |
- |
|
33 |
-let s:filetype_regex_overrides = {} |
|
34 |
- |
|
35 |
-function! s:check_defined_section(name) |
|
36 |
- if !exists('w:airline_section_{a:name}') |
|
37 |
- let w:airline_section_{a:name} = g:airline_section_{a:name} |
|
38 |
- endif |
|
39 |
-endfunction |
|
40 |
- |
|
41 |
-function! airline#extensions#append_to_section(name, value) |
|
42 |
- call <sid>check_defined_section(a:name) |
|
43 |
- let w:airline_section_{a:name} .= a:value |
|
44 |
-endfunction |
|
45 |
- |
|
46 |
-function! airline#extensions#prepend_to_section(name, value) |
|
47 |
- call <sid>check_defined_section(a:name) |
|
48 |
- let w:airline_section_{a:name} = a:value . w:airline_section_{a:name} |
|
49 |
-endfunction |
|
50 |
- |
|
51 |
-function! airline#extensions#apply_left_override(section1, section2) |
|
52 |
- let w:airline_section_a = a:section1 |
|
53 |
- let w:airline_section_b = a:section2 |
|
54 |
- let w:airline_section_c = airline#section#create(['readonly']) |
|
55 |
- let w:airline_render_left = 1 |
|
56 |
- let w:airline_render_right = 0 |
|
57 |
-endfunction |
|
58 |
- |
|
59 |
-let s:active_winnr = -1 |
|
60 |
-function! airline#extensions#apply(...) |
|
61 |
- let s:active_winnr = winnr() |
|
62 |
- |
|
63 |
- if s:is_excluded_window() |
|
64 |
- return -1 |
|
65 |
- endif |
|
66 |
- |
|
67 |
- if &buftype == 'help' |
|
68 |
- call airline#extensions#apply_left_override('Help', '%f') |
|
69 |
- let w:airline_section_x = '' |
|
70 |
- let w:airline_section_y = '' |
|
71 |
- let w:airline_render_right = 1 |
|
72 |
- endif |
|
73 |
- |
|
74 |
- if &previewwindow |
|
75 |
- let w:airline_section_a = 'Preview' |
|
76 |
- let w:airline_section_b = '' |
|
77 |
- let w:airline_section_c = bufname(winbufnr(winnr())) |
|
78 |
- endif |
|
79 |
- |
|
80 |
- if has_key(s:filetype_overrides, &ft) |
|
81 |
- let args = s:filetype_overrides[&ft] |
|
82 |
- call airline#extensions#apply_left_override(args[0], args[1]) |
|
83 |
- endif |
|
84 |
- |
|
85 |
- for item in items(s:filetype_regex_overrides) |
|
86 |
- if match(&ft, item[0]) >= 0 |
|
87 |
- call airline#extensions#apply_left_override(item[1][0], item[1][1]) |
|
88 |
- endif |
|
89 |
- endfor |
|
90 |
-endfunction |
|
91 |
- |
|
92 |
-function! s:is_excluded_window() |
|
93 |
- for matchft in g:airline_exclude_filetypes |
|
94 |
- if matchft ==# &ft |
|
95 |
- return 1 |
|
96 |
- endif |
|
97 |
- endfor |
|
98 |
- |
|
99 |
- for matchw in g:airline_exclude_filenames |
|
100 |
- if matchstr(expand('%'), matchw) ==# matchw |
|
101 |
- return 1 |
|
102 |
- endif |
|
103 |
- endfor |
|
104 |
- |
|
105 |
- if g:airline_exclude_preview && &previewwindow |
|
106 |
- return 1 |
|
107 |
- endif |
|
108 |
- |
|
109 |
- return 0 |
|
110 |
-endfunction |
|
111 |
- |
|
112 |
-function! airline#extensions#load_theme() |
|
113 |
- call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette) |
|
114 |
-endfunction |
|
115 |
- |
|
116 |
-function! s:sync_active_winnr() |
|
117 |
- if exists('#airline') && winnr() != s:active_winnr |
|
118 |
- call airline#update_statusline() |
|
119 |
- endif |
|
120 |
-endfunction |
|
121 |
- |
|
122 |
-function! airline#extensions#load() |
|
123 |
- let loaded_ext = [] |
|
124 |
- " non-trivial number of external plugins use eventignore=all, so we need to account for that |
|
125 |
- autocmd CursorMoved * call <sid>sync_active_winnr() |
|
126 |
- |
|
127 |
- if exists('g:airline_extensions') |
|
128 |
- for ext in g:airline_extensions |
|
129 |
- try |
|
130 |
- call airline#extensions#{ext}#init(s:ext) |
|
131 |
- catch /^Vim\%((\a\+)\)\=:E117/ " E117, function does not exist |
|
132 |
- call airline#util#warning("Extension '".ext."' not installed, ignoring!") |
|
133 |
- endtry |
|
134 |
- endfor |
|
135 |
- return |
|
136 |
- endif |
|
137 |
- |
|
138 |
- call airline#extensions#quickfix#init(s:ext) |
|
139 |
- call add(loaded_ext, 'quickfix') |
|
140 |
- |
|
141 |
- if get(g:, 'loaded_unite', 0) |
|
142 |
- call airline#extensions#unite#init(s:ext) |
|
143 |
- call add(loaded_ext, 'unite') |
|
144 |
- endif |
|
145 |
- |
|
146 |
- if get(g:, 'loaded_denite', 0) |
|
147 |
- call airline#extensions#denite#init(s:ext) |
|
148 |
- call add(loaded_ext, 'denite') |
|
149 |
- endif |
|
150 |
- |
|
151 |
- if exists(':NetrwSettings') |
|
152 |
- call airline#extensions#netrw#init(s:ext) |
|
153 |
- call add(loaded_ext, 'netrw') |
|
154 |
- endif |
|
155 |
- |
|
156 |
- if has("terminal") |
|
157 |
- call airline#extensions#term#init(s:ext) |
|
158 |
- call add(loaded_ext, 'term') |
|
159 |
- endif |
|
160 |
- |
|
161 |
- if get(g:, 'airline#extensions#ycm#enabled', 0) |
|
162 |
- call airline#extensions#ycm#init(s:ext) |
|
163 |
- call add(loaded_ext, 'ycm') |
|
164 |
- endif |
|
165 |
- |
|
166 |
- if get(g:, 'loaded_vimfiler', 0) |
|
167 |
- let g:vimfiler_force_overwrite_statusline = 0 |
|
168 |
- endif |
|
169 |
- |
|
170 |
- if get(g:, 'loaded_ctrlp', 0) |
|
171 |
- call airline#extensions#ctrlp#init(s:ext) |
|
172 |
- call add(loaded_ext, 'ctrlp') |
|
173 |
- endif |
|
174 |
- |
|
175 |
- if get(g:, 'loaded_localsearch', 0) |
|
176 |
- call airline#extensions#localsearch#init(s:ext) |
|
177 |
- call add(loaded_ext, 'localsearch') |
|
178 |
- endif |
|
179 |
- |
|
180 |
- if get(g:, 'CtrlSpaceLoaded', 0) |
|
181 |
- call airline#extensions#ctrlspace#init(s:ext) |
|
182 |
- call add(loaded_ext, 'ctrlspace') |
|
183 |
- endif |
|
184 |
- |
|
185 |
- if get(g:, 'command_t_loaded', 0) |
|
186 |
- call airline#extensions#commandt#init(s:ext) |
|
187 |
- call add(loaded_ext, 'commandt') |
|
188 |
- endif |
|
189 |
- |
|
190 |
- if exists(':UndotreeToggle') |
|
191 |
- call airline#extensions#undotree#init(s:ext) |
|
192 |
- call add(loaded_ext, 'undotree') |
|
193 |
- endif |
|
194 |
- |
|
195 |
- if get(g:, 'airline#extensions#hunks#enabled', 1) |
|
196 |
- \ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes') || exists('g:loaded_quickfixsigns')) |
|
197 |
- call airline#extensions#hunks#init(s:ext) |
|
198 |
- call add(loaded_ext, 'hunks') |
|
199 |
- endif |
|
200 |
- |
|
201 |
- if get(g:, 'airline#extensions#vimagit#enabled', 1) |
|
202 |
- \ && (exists('g:loaded_magit')) |
|
203 |
- call airline#extensions#vimagit#init(s:ext) |
|
204 |
- call add(loaded_ext, 'vimagit') |
|
205 |
- endif |
|
206 |
- |
|
207 |
- if get(g:, 'airline#extensions#tagbar#enabled', 1) |
|
208 |
- \ && exists(':TagbarToggle') |
|
209 |
- call airline#extensions#tagbar#init(s:ext) |
|
210 |
- call add(loaded_ext, 'tagbar') |
|
211 |
- endif |
|
212 |
- |
|
213 |
- if get(g:, 'airline#extensions#csv#enabled', 1) |
|
214 |
- \ && (get(g:, 'loaded_csv', 0) || exists(':Table')) |
|
215 |
- call airline#extensions#csv#init(s:ext) |
|
216 |
- call add(loaded_ext, 'csv') |
|
217 |
- endif |
|
218 |
- |
|
219 |
- if exists(':VimShell') |
|
220 |
- let s:filetype_overrides['vimshell'] = ['vimshell','%{vimshell#get_status_string()}'] |
|
221 |
- let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}'] |
|
222 |
- endif |
|
223 |
- |
|
224 |
- if get(g:, 'airline#extensions#branch#enabled', 1) |
|
225 |
- \ && (exists('*fugitive#head') || exists('*lawrencium#statusline') || |
|
226 |
- \ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine'))) |
|
227 |
- call airline#extensions#branch#init(s:ext) |
|
228 |
- call add(loaded_ext, 'branch') |
|
229 |
- endif |
|
230 |
- |
|
231 |
- if get(g:, 'airline#extensions#bufferline#enabled', 1) |
|
232 |
- \ && exists('*bufferline#get_status_string') |
|
233 |
- call airline#extensions#bufferline#init(s:ext) |
|
234 |
- call add(loaded_ext, 'bufferline') |
|
235 |
- endif |
|
236 |
- |
|
237 |
- if get(g:, 'airline#extensions#fugitiveline#enabled', 1) |
|
238 |
- \ && exists('*fugitive#head') |
|
239 |
- \ && index(loaded_ext, 'bufferline') == -1 |
|
240 |
- call airline#extensions#fugitiveline#init(s:ext) |
|
241 |
- call add(loaded_ext, 'fugitiveline') |
|
242 |
- endif |
|
243 |
- |
|
244 |
- if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV))) |
|
245 |
- call airline#extensions#virtualenv#init(s:ext) |
|
246 |
- call add(loaded_ext, 'virtualenv') |
|
247 |
- endif |
|
248 |
- |
|
249 |
- if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate')) |
|
250 |
- call airline#extensions#eclim#init(s:ext) |
|
251 |
- call add(loaded_ext, 'eclim') |
|
252 |
- endif |
|
253 |
- |
|
254 |
- if get(g:, 'airline#extensions#syntastic#enabled', 1) |
|
255 |
- \ && exists(':SyntasticCheck') |
|
256 |
- call airline#extensions#syntastic#init(s:ext) |
|
257 |
- call add(loaded_ext, 'syntastic') |
|
258 |
- endif |
|
259 |
- |
|
260 |
- if (get(g:, 'airline#extensions#ale#enabled', 1) && exists(':ALELint')) |
|
261 |
- call airline#extensions#ale#init(s:ext) |
|
262 |
- call add(loaded_ext, 'ale') |
|
263 |
- endif |
|
264 |
- |
|
265 |
- if get(g:, 'airline#extensions#whitespace#enabled', 1) |
|
266 |
- call airline#extensions#whitespace#init(s:ext) |
|
267 |
- call add(loaded_ext, 'whitespace') |
|
268 |
- endif |
|
269 |
- |
|
270 |
- if (get(g:, 'airline#extensions#neomake#enabled', 1) && exists(':Neomake')) |
|
271 |
- call airline#extensions#neomake#init(s:ext) |
|
272 |
- call add(loaded_ext, 'neomake') |
|
273 |
- endif |
|
274 |
- |
|
275 |
- if get(g:, 'airline#extensions#po#enabled', 1) && executable('msgfmt') |
|
276 |
- call airline#extensions#po#init(s:ext) |
|
277 |
- call add(loaded_ext, 'po') |
|
278 |
- endif |
|
279 |
- |
|
280 |
- if get(g:, 'airline#extensions#wordcount#enabled', 1) |
|
281 |
- call airline#extensions#wordcount#init(s:ext) |
|
282 |
- call add(loaded_ext, 'wordcount') |
|
283 |
- endif |
|
284 |
- |
|
285 |
- if get(g:, 'airline#extensions#tabline#enabled', 0) |
|
286 |
- call airline#extensions#tabline#init(s:ext) |
|
287 |
- call add(loaded_ext, 'tabline') |
|
288 |
- endif |
|
289 |
- |
|
290 |
- if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline') |
|
291 |
- call airline#extensions#tmuxline#init(s:ext) |
|
292 |
- call add(loaded_ext, 'tmuxline') |
|
293 |
- endif |
|
294 |
- |
|
295 |
- if get(g:, 'airline#extensions#promptline#enabled', 1) && exists(':PromptlineSnapshot') && len(get(g:, 'airline#extensions#promptline#snapshot_file', '')) |
|
296 |
- call airline#extensions#promptline#init(s:ext) |
|
297 |
- call add(loaded_ext, 'promptline') |
|
298 |
- endif |
|
299 |
- |
|
300 |
- if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2 |
|
301 |
- call airline#extensions#nrrwrgn#init(s:ext) |
|
302 |
- call add(loaded_ext, 'nrrwrgn') |
|
303 |
- endif |
|
304 |
- |
|
305 |
- if get(g:, 'airline#extensions#unicode#enabled', 1) && exists(':UnicodeTable') == 2 |
|
306 |
- call airline#extensions#unicode#init(s:ext) |
|
307 |
- call add(loaded_ext, 'nrrwrgn') |
|
308 |
- endif |
|
309 |
- |
|
310 |
- if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline')) |
|
311 |
- call airline#extensions#capslock#init(s:ext) |
|
312 |
- call add(loaded_ext, 'capslock') |
|
313 |
- endif |
|
314 |
- |
|
315 |
- if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0)) |
|
316 |
- call airline#extensions#gutentags#init(s:ext) |
|
317 |
- call add(loaded_ext, 'gutentags') |
|
318 |
- endif |
|
319 |
- |
|
320 |
- if (get(g:, 'airline#extensions#xkblayout#enabled', 1) && exists('g:XkbSwitchLib')) |
|
321 |
- call airline#extensions#xkblayout#init(s:ext) |
|
322 |
- call add(loaded_ext, 'xkblayout') |
|
323 |
- endif |
|
324 |
- |
|
325 |
- if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap')) |
|
326 |
- call airline#extensions#keymap#init(s:ext) |
|
327 |
- call add(loaded_ext, 'keymap') |
|
328 |
- endif |
|
329 |
- |
|
330 |
- if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0)) |
|
331 |
- call airline#extensions#windowswap#init(s:ext) |
|
332 |
- call add(loaded_ext, 'windowswap') |
|
333 |
- endif |
|
334 |
- |
|
335 |
- if (get(g:, 'airline#extensions#obsession#enabled', 1) && exists('*ObsessionStatus')) |
|
336 |
- call airline#extensions#obsession#init(s:ext) |
|
337 |
- call add(loaded_ext, 'obsession') |
|
338 |
- endif |
|
339 |
- |
|
340 |
- runtime autoload/vimtex.vim |
|
341 |
- if (get(g:, 'airline#extensions#vimtex#enabled', 1)) && exists('*vimtex#init') |
|
342 |
- call airline#extensions#vimtex#init(s:ext) |
|
343 |
- call add(loaded_ext, 'vimtex') |
|
344 |
- endif |
|
345 |
- |
|
346 |
- if (get(g:, 'airline#extensions#cursormode#enabled', 0)) |
|
347 |
- call airline#extensions#cursormode#init(s:ext) |
|
348 |
- call add(loaded_ext, 'cursormode') |
|
349 |
- endif |
|
350 |
- |
|
351 |
- if !get(g:, 'airline#extensions#disable_rtp_load', 0) |
|
352 |
- " load all other extensions, which are not part of the default distribution. |
|
353 |
- " (autoload/airline/extensions/*.vim outside of our s:script_path). |
|
354 |
- for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") |
|
355 |
- " we have to check both resolved and unresolved paths, since it's possible |
|
356 |
- " that they might not get resolved properly (see #187) |
|
357 |
- if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 |
|
358 |
- \ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0 |
|
359 |
- let name = fnamemodify(file, ':t:r') |
|
360 |
- if !get(g:, 'airline#extensions#'.name.'#enabled', 1) || |
|
361 |
- \ index(loaded_ext, name) > -1 |
|
362 |
- continue |
|
363 |
- endif |
|
364 |
- try |
|
365 |
- call airline#extensions#{name}#init(s:ext) |
|
366 |
- catch |
|
367 |
- endtry |
|
368 |
- endif |
|
369 |
- endfor |
|
370 |
- endif |
|
371 |
-endfunction |
... | ... |
@@ -1,84 +0,0 @@ |
1 |
-" MIT License. Copyright (c) 2013-2018 Bjorn Neergaard, w0rp et al. |
|
2 |
-" vim: et ts=2 sts=2 sw=2 |
|
3 |
- |
|
4 |
-scriptencoding utf-8 |
|
5 |
- |
|
6 |
-let s:error_symbol = get(g:, 'airline#extensions#ale#error_symbol', 'E:') |
|
7 |
-let s:warning_symbol = get(g:, 'airline#extensions#ale#warning_symbol', 'W:') |
|
8 |
-let s:show_line_numbers = get(g:, 'airline#extensions#ale#show_line_numbers', 1) |
|
9 |
- |
|
10 |
-function! s:airline_ale_count(cnt, symbol) |
|
11 |
- return a:cnt ? a:symbol. a:cnt : '' |
|
12 |
-endfunction |
|
13 |
- |
|
14 |
-function! s:airline_ale_get_line_number(cnt, type) abort |
|
15 |
- if a:cnt == 0 |
|
16 |
- return '' |
|
17 |
- endif |
|
18 |
- |
|
19 |
- let buffer = bufnr('') |
|
20 |
- let problem_type = (a:type ==# 'error') ? 'E' : 'W' |
|
21 |
- let problems = copy(ale#engine#GetLoclist(buffer)) |
|
22 |
- |
|
23 |
- call filter(problems, 'v:val.bufnr is buffer && v:val.type is# problem_type') |
|
24 |
- |
|
25 |
- if empty(problems) |
|
26 |
- return '' |
|
27 |
- endif |
|
28 |
- |
|
29 |
- let open_lnum_symbol = get(g:, 'airline#extensions#ale#open_lnum_symbol', '(L') |
|
30 |
- let close_lnum_symbol = get(g:, 'airline#extensions#ale#close_lnum_symbol', ')') |
|
31 |
- |
|
32 |
- return open_lnum_symbol . problems[0].lnum . close_lnum_symbol |
|
33 |
-endfunction |
|
34 |
- |
|
35 |
-function! airline#extensions#ale#get(type) |
|
36 |
- if !exists(':ALELint') |
|
37 |
- return '' |
|
38 |
- endif |
|
39 |
- |
|
40 |
- let is_err = a:type ==# 'error' |
|
41 |