613 Commits

Author SHA1 Message Date
IK
eec6ea3875 Merge f083d765d8 into 81eca99486 2024-09-17 02:29:56 +09:00
IK
81eca99486 Merge pull request #2688 from vim-airline/fix-test
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
chore: update test
2024-09-11 02:39:31 +09:00
IK
f706e7c486 Merge pull request #2689 from vim-airline/update-ci
chore: update ci
2024-09-11 02:38:35 +09:00
get-me-power
d7edaf8fd0 chore: update ci 2024-09-11 02:31:50 +09:00
get-me-power
3cb60641e7 chore: update test 2024-09-11 02:28:20 +09:00
wzy
d25c049e61 xkblayout: support ime.nvim (#2682)
Improve document
2024-07-23 16:10:19 +02:00
wzy
02894b6ef4 xkblayout: support fcitx5-ui.nvim (#2680)
https://github.com/black-desk/fcitx5-ui.nvim
2024-06-16 16:57:43 +02:00
Dionisio E Alonso
16c1638f93 nvimlsp: Correct deprecation warning on nvimlsp plugin (#2678)
Also correct regression introduced in #2676 with #2677
2024-05-20 13:51:17 +02:00
Christian Brabandt
6cc2c5c9e9 nvimlsp: Use vim.lsp.buf_get_clients() for Neovim < 0.11
closes: #2676

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-19 21:47:31 +02:00
Dionisio E Alonso
c3d1d13b72 lsp: Correct deprecation warning on nvimlsp plugin (#2675)
As of version 0.12 of Neovim, the replaced API call is being deprecated.  From 0.11.0 there is already a “deprecation warning” in place.

This patch corrects that by using the new API call.
2024-05-19 17:40:51 +02:00
wzy
ff0f9a45a5 xkblayout: use FcitxCurrentIMwithRime() when available (#2670)
latest version of fcitx.vim add FcitxCurrentIMwithRime()
to display input method information in detail
2024-04-24 23:11:48 +02:00
Christian Brabandt
d9f42cb467 parts: error when unsing non-utf8 encoding
use exprission string "\u2026" instead of literal …

fixes #2666
2024-02-17 15:29:08 +01:00
Lars Hansen
20a49bd494 doc: Make tabline#show_buffers more prominent in documentation (#2663) 2024-02-10 11:35:56 +01:00
Nobuhiro MIKI
ff7352e4bf doc: Unify notation of variables (#2659)
There were roughly the following notational shakes:

- arline...
- let airline...
- let g:airline...

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2023-12-26 15:47:01 +01:00
Christian Brabandt
3b9e149e19 ci: run on ubuntu 20.04 instead of ubuntu 22.04
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11 13:32:00 +02:00
Christian Brabandt
ec74913b94 ci: fix failing test
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11 13:27:32 +02:00
Ingo Meyer
3854429d99 plugin: Add extension for codeium
closes #2653
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11 13:21:00 +02:00
Christian Brabandt
0adefd0c42 vimodoro: fix style according to reviewdog
Mainly, add the `abort` attribute and make the == comparison case
sensitive

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11 13:13:58 +02:00
Billy Chamberlain
4757756ae0 plugin: Add extension for vimodoro plugin (#2652)
* Adds integration with vimodoro information.

---------
Co-authored-by: Rowan <rowan.douglas@vimabc.xyz>
Co-authored-by: Eddy <eddy_c@novellpharm.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-10 10:12:40 +01:00
Christian Brabandt
f1ba5a03db branch: --no-optional-locks arg needs to be given to git
The special argument --no-optional-lock applies to the main git command,
and not to the git subcommand `git status`. So move it there, to prevent
an error with git.

closes #2651

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 21:01:39 +02:00
Christian Brabandt
e6bb8427dc Merge pull request #2648 from idbrii/git-nolock
Don't lock git repo when checking status
2023-07-19 20:33:02 +02:00
David Briscoe
65e77b970d Don't lock repo when checking status
Fix "fatal: Unable to create '.git/index.lock': File exists." when doing
fugitive commands.

Since upgrading fugitive from fugitive@7c1f2ed to 5f0d280, I
occasionally hit this lock error when using `ZZ` to save and close the
fugitive rebase window.

I have no other windows or tabs open (nothing that might be invoking
git). I get the error around 1 in 5 attempts on a larger git repo and
less often on small repos (like vim-fugitive's repo).

However, I have airline and have the git branch name and dirty status in
my **statusline**. A minimal repro of just sensible, fugitive, and
vim-airline with no custom airline configuration produces the issue. If
I use `:AirlineToggle` to turn off the statusline, it seems to go away.

Airline uses fugitive to get the branch name (with `FugitiveHead()`) and
strip the `fugitive://` name from buffers (with `FugitiveReal()`).

I tried removing ShellCmdPost fugitiveline.vim and that *seems* to fix
it, but I don't understand why.

What makes more sense is that the dirty check is asynchronous and is
trying to check status when fugitive is trying to rebase. Because the
repo is large, it takes longer to get status (true for just running `git
status` too).

I have async enabled:
    :echo g:airline#init#vim_async
    1

tpope suggests using --no-optional-locks to solve:
https://github.com/tpope/vim-fugitive/issues/1624

That also appears to fix the issue.

This flag was introduced to git in 2017 which would make airline fail on
older gits:
27344d6a6c
There's also GIT_OPTIONAL_LOCKS=0 environment variable, but that
requires more infra work.
2023-07-19 11:14:10 -07:00
Christian Brabandt
cead8efb48 term: allow to customize section_a and section_z
closes: #2647
2023-07-13 16:48:04 +02:00
get-me-power
f083d765d8 debug 2023-06-03 23:51:47 +09:00
get-me-power
45b6334faf test: add branch extensions test 2023-06-03 23:46:37 +09:00
Christian Brabandt
423fe9e2ac Merge pull request #2643 from Omcsesz/patch-1
Update README.md
2023-05-25 11:14:50 +02:00
Sweidan Omár
3776947590 Update README.md
Added the option for installing via vim-plug
2023-05-24 18:49:23 +02:00
Christian Brabandt
5891a3f7be Merge pull request #2635 from 3ximus/master
Fix the number of splits in a tab displayed in the tabline
2023-04-17 10:05:28 +02:00
Christian Brabandt
4eea2b7e3c Fix check for vim9 script
closes #2636
2023-04-17 09:53:26 +02:00
eximus
515d4cbbec fix tabline tabnr formatter - nr of splits 2023-04-14 14:18:03 -04:00
Christian Brabandt
a532fed72a fix saythank.io link 2023-03-16 08:08:20 +01:00
IK
038e3a6ca5 Merge pull request #2627 from vim-airline/update-ci-yml
chore: Pin actions's version main branch
2023-02-03 04:29:11 +09:00
get-me-power
1828172717 chore: Pin actions-checkout's version main branch 2023-02-03 04:26:34 +09:00
Christian Brabandt
18b85395d3 wordcount: skip updating wordcount for vimtex#misc#wordcount() in visual mode
closes #2624
2023-01-29 22:07:36 +01:00
Christian Brabandt
c7460aa883 Merge pull request #2621 from bobbleclank/hunk-gitgutter-selection
Prevent selecting GitGutter when its loaded but not enabled
2023-01-22 15:10:40 +01:00
Simon Truscott
8fd91eaca9 hunks: prevent selecting GitGutter when its loaded but not enabled 2023-01-22 09:03:56 +11:00
Christian Brabandt
31e01612f3 tagbar: do not load, if file size is too large
closes: #2578
2023-01-19 21:46:36 +01:00
Christian Brabandt
dc1b607f56 tagbar: break too long line 2023-01-19 21:45:37 +01:00
Christian Brabandt
08cfcf9408 tagbar: move s:flags to inside the function
This matters, if the users later changes the
'airline#extensions#tagbar#flags'  variable, so that it will be taken
into account by the tagbar extension
2023-01-19 21:44:21 +01:00
Christian Brabandt
50a936608c tagbar: prevent error on initial load
Tagbar plugin expects a printf() formatting string, so use one
2023-01-19 21:25:23 +01:00
Christian Brabandt
9252c11d37 tabnr_formatter: get correct name for tabpage 2023-01-19 20:57:47 +01:00
Christian Brabandt
e4a57d0be4 Merge pull request #2618 from artemvmin/short-path-improved
Add improved short path tabline formatter
2023-01-19 20:19:13 +01:00
Christian Brabandt
1d9ae3f972 tabnr formmatter: return tabpagebuflist for tab_nr==0 2023-01-18 09:32:51 +01:00
Artem Minyaylov
9eb4aa47a3 Add improved short path tabline formatter 2023-01-17 09:44:33 -08:00
Christian Brabandt
f46792ebcb Merge pull request #2619 from artemvmin/mode-truncation
Use mode minwidth to configure truncation
2023-01-17 08:10:46 +01:00
Artem Minyaylov
04f95183e2 Use mode minwidth to configure truncation 2023-01-16 17:01:00 -08:00
Christian Brabandt
82aeea1276 extensions: fix tabnr formatter
related #2616
2023-01-16 22:58:54 +01:00
Christian Brabandt
1ecbc76682 extensions: correctly check for external extensions
fixes #2594
2023-01-11 16:45:28 +01:00
Christian Brabandt
1028c6ea12 tabnr: replace by a new naive function
This function simply returns the current tabnumber followed by the
number of buffers in the current tabpage.

The previous one either was broken long ago or did not work as expected.

fixes #2616
2023-01-11 16:41:08 +01:00
Christian Brabandt
4f5b641710 formatter: tabnr expects a number bot got List
Make sure, that the second argument is actually a number and not a list.
Note: even when fixing this, the tabpage still shows some strange output
e.g. currently
 1   1.%{len(tabpagebuflist(1))} 

In a vim window. Not sure, why Vim does no longer evaluate those %{..}
sections. Perhaps some change in Vim?

closes #2616
2023-01-09 14:55:11 +01:00
Christian Brabandt
9007d19ab7 Merge pull request #2617 from bobbleclank/use-gitsigns-status-dict
Use gitsigns_status_dict instead of gitsigns_status
2023-01-09 14:39:11 +01:00
Simon Truscott
029797db1c hunks: use gitsigns_status_dict instead of gitsigns_status
- Gitsigns also provides status as a dictionary. Use that rather than
  parsing a decorated string

- Fix indentation
2023-01-08 15:37:43 +11:00
Christian Brabandt
0913c0a3b6 Merge pull request #2613 from bobbleclank/searchcount-config
Add search-count configuration
2023-01-02 17:39:49 +01:00
Simon Truscott
e9c09a2e66 searchcount: add configuration
- Allow disabling displaying the search term.
- Allow setting the length for truncating the search term.

- Fix inconsistent status format for timed out:
  No space between search term and counts.
2023-01-02 11:42:54 +11:00
Christian Brabandt
785dbbe504 Merge pull request #2614 from bobbleclank/hunks-gitsigns
Add support for gitsigns.nvim in hunks extension
2023-01-01 10:18:35 +01:00
Simon Truscott
46f0a12bae hunks: add support for gitsigns.nvim
Refactor s:get_hunks_coc() so that parsing the hunk status can be reused
by s:get_hunks_gitsigns().

Reorder s:get_hunks_coc() for consistent ordering with related code.

Give gitsigns.nvim priority over coc-git when selecting b:source_func in
hunks#get_raw_hunks().
2023-01-01 11:46:28 +11:00
Christian Brabandt
9e2d021fc6 Merge pull request #2611 from uridium/master
Allow to define own path for short_path formatter
2022-12-23 10:42:10 +01:00
Radar
4e552414d4 Allow to define own path for short_path formatter
let g:airline#extensions#tabline#formatter = 'short_path'
let g:airline#extensions#tabline#fnamemod = ':h'

Update short_path documentation
2022-12-23 09:54:52 +01:00
Christian Brabandt
6a4c82c950 Merge pull request #2610 from pinicarus/master
only set laststatus when airline is not on top
2022-12-16 09:25:36 +01:00
Pierre-Nicolas Clauss
46e517e8c2 only set laststatus when airline is not on top
When airline is configured to show on top (`let g:airline_statusline_ontop = 1`)
and vim's `laststatus` option is configured to be hidden (`set laststatus=0`)
then there is no need to override its setting.
2022-12-16 08:28:29 +01:00
Christian Brabandt
994cfd80eb Powerline: Mention alternative to notexists symbol
I noticed, that in some environments the default
g:airline_symbols[notexists] just does not show up, even when the same
font in the gui works. So let's at least mention a possible alternative,
that you can easily use in your vimrc:

```vim
  if !exists("g:airline_symbols")
    let g:airline_symbols = {}
  endif
  let g:airline_symbols.notexists = "\u2204"
```
2022-12-15 17:15:15 +01:00
Christian Brabandt
1cdb8824a0 Merge pull request #2609 from thomasmerz/fix_node12_deprecation
🩹 fix deprecation warning: Node.js 12 actions are deprecated.
2022-12-14 16:23:50 +01:00
Thomas Merz
13f3478b61 🩹 fix deprecation warning:
Node.js 12 actions are deprecated.
   For more information see:
   https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
   Please update the following actions to use Node.js 16: actions/checkout@master

   Using version v3, latest or master: actions/checkout#689
2022-12-14 16:09:57 +01:00
Christian Brabandt
5f5e00faad Merge pull request #2605 from igbanam/theme/vim9-variable-arguments
Bring Vim9 Variable Arguments to airline/themes
2022-12-07 08:30:49 +01:00
Igbanam Ogbuluijah
2ae1475d0d add variardic arguments to generate_color_map 2022-12-07 02:28:40 +00:00
Igbanam Ogbuluijah
62847a8cc9 add variardic arguments to get_highlight functions 2022-12-07 02:28:19 +00:00
Christian Brabandt
25d53a80f4 Merge pull request #2602 from hezhizhen/typo
fix typo
2022-11-28 08:33:13 +01:00
Zhizhen He
3c9c2ba5d4 fix typo 2022-11-24 11:47:41 +08:00
Christian Brabandt
2654f838ae Merge pull request #2598 from limakzi/fix/add-missing-hyperlink
Fix missing hyperlink in docs
2022-11-17 16:33:30 +01:00
Christian Brabandt
f65f27b9eb Merge pull request #2600 from Freed-Wu/fcitx
Add support for fcitx.vim
2022-11-17 16:18:44 +01:00
Wu Zhenyu
1e491727b2 Add support for fcitx.vim
<https://github.com/lilydjwg/fcitx.vim/issues/32>
2022-11-15 17:29:36 +08:00
Kamil Zabielski
a84ae5e069 Fix missing hyperlink in docs
Signed-off-by: Kamil Zabielski <kamil@zabielscy.com>
2022-11-09 10:51:40 +01:00
Christian Brabandt
29ef9e1f64 Merge pull request #2595 from 3ximus/master
Improve coc error/warning status format to include count
2022-11-06 14:09:39 +01:00
eximus
b86e5e09b2 Improve coc error/warning status format to include count 2022-11-04 16:37:31 -04:00
Christian Brabandt
d734be8cd3 Merge pull request #2590 from 0Magenta0/master
Typo: Add Missing Quotation Mark In Docs
2022-11-04 13:51:42 +01:00
Christian Brabandt
364ffba120 Merge pull request #2592 from 3ximus/master
Use the coc status variable to format error/warning text
2022-11-04 13:51:08 +01:00
Christian Brabandt
009ba4e9d0 Merge pull request #2593 from indelog/indelog-vim9-lsp
Fix: [vim9lsp] ErrorCount method updated
2022-11-04 13:46:55 +01:00
DEMAREST Maxime
5c682e7bd3 Fix vim9lsp ErrorCount method name change 2022-10-31 19:10:37 +01:00
eximus
d56f199405 Use the coc status variable to format error/warning line number 2022-10-28 14:34:11 -04:00
0Magenta0
92d3e90110 Typo: Add Missing Quotation Mark 2022-10-22 22:17:01 +03:00
Christian Brabandt
0ed7b8bb2e doc: fix typo 2022-10-13 16:56:32 +02:00
amarakon
84823e5e7d Treat R Markdown the same as Markdown 2022-10-13 16:53:42 +02:00
Christian Brabandt
8e989201c8 Merge pull request #2580 from amarakon/trailing-whitespace
Remove trailing whitespace
2022-10-11 14:01:21 +02:00
amarakon
3fe71a6ce6 Remove trailing whitespace 2022-09-30 23:25:47 -04:00
Christian Brabandt
46dd872237 Merge pull request #2577 from vim-airline/update-issue-template
Added terminal col/line size in Issue template
2022-09-29 14:24:00 +02:00
kazukazuinaina
838c16a174 [add] terminal col/line size in Issue template 2022-09-27 01:55:46 +09:00
Christian Brabandt
78abec3b83 Merge pull request #2576 from shadowwa/master
Update util.vim
2022-09-26 15:22:48 +02:00
Shad
dba64a910d Update util.vim
using getwinvar directly with 7.3 version of vim display the following error
E118: Too many arguments for function: getwinvar
E15: Invalid expression: getwinvar(a:winnr, '&buftype', '') ==# 'popup'
2022-09-26 15:01:40 +02:00
Christian Brabandt
a71f9a6417 Merge pull request #2575 from sartak/section-y-width
Reduce truncation for section y to 80 chars
2022-09-21 09:09:10 +02:00
Shawn M Moore
e0056ae5b0 Reduce truncation for section y to 80 chars 2022-09-20 23:57:06 -04:00
Christian Brabandt
2cea8346cf plugin: handle sandbox mode gracefully
When the sandbox is active (e.g. while debugging something), certains
commands and expressions are not allowed (see :h sandbox) and may cause
nasty exceptions to be thrown.

So try to catch E48 and handle it gracefully
2022-09-07 09:44:51 +02:00
Christian Brabandt
90c6746311 builder: correctly remember the previous group when switching alignment
When `g:airline_skip_empty_sections' is set, and a section is considered
and after that section comes the alignment separator '%=' than airline
would not correctly render the airline_prevgroup_to_airline_curgroup
simply because the '%=' marker confuses it about which is actually the
previous group.

So consider the '%=' marker to be empty as well.

The case can be observed, when having set
`g:airline_skip_empty_sections' to true and opening a help buffer.
Because in that case, airline_section_c will be considered empty, then
the alignment separator comes and after that airline will (wrongly)
generate a highlighting group `airline_c_to_airline_z`, while it should
actually generate `airline_b_to_airline_z`
2022-09-02 12:44:44 +02:00
Christian Brabandt
f5a6597496 Merge pull request #2569 from BonaBeavis/patch-1
Fix nvimlsp not picking up show_line_number
2022-08-25 16:45:17 +02:00
BonaBeavis
d1f2c13e4f Fix nvimlsp not picking up show_line_number 2022-08-23 16:38:15 +02:00
Christian Brabandt
9d20473e91 fugitiveline: remove outdated calls to fugitive
as per https://github.com/tpope/vim-fugitive/issues/2034

This also fixes an issue that is shown in older Vims (pre 7.4.1711)
since those versions did not correctly catch exceptions while evaluating
the statusline.

closes #2566
2022-08-15 17:30:53 +02:00
Christian Brabandt
61042e3502 fern: enable fern again
fern.vim decided to remove the global variable `g:fern_loaded` in
f9404e8a59b6a74b15a5

So adjust to use the correct variable name `g:loaded_fern`.

fixes #2346
2022-08-09 11:59:19 +02:00
Christian Brabandt
66a6e03a34 doc: adjust documentation for colnr symbol
after aee282c964 we also need to adjust
the documentation properly.
2022-08-08 10:12:57 +02:00
Christian Brabandt
aee282c964 symbols: use proper Column number codepoint
Back when the colnr symbol was first introduced in
8929bc72a1 it included symbol `\ue0a3`
when powerline fonts where supposed to be used by setting
`:let g:airline_powerline_fonts=1`

However, it turns out, that those symbol, may actually not be defined in
the powerline fonts at all, only in the
[powerline-extra-symbols](https://github.com/ryanoasis/powerline-extra-symbols)
and this has caused various issues, because it either did not display at
all, or the symbol caused strange overflowing issues which made the
overall look of the status line not very appealing and already caused
various issues here in the vim-airline repository.

Therefore, fall back to the symbol `\u2105` (℅) which at least is
already defined in the Unicode specification and has therefore a higher
chance of being defined inside a powerline font at all (but it may still
be missing after all).

Also, it is more consistent, because it will now use the same symbol as
when `g:airline_powerline_fonts` is not defined and the default Unicode
symbols are selected.

So if you want to keep on using the old symbol, you need to use:
```
let g:airline_symbols.colnr="\ue0a3:"
```

fixes: #2563
related: #2381
2022-08-08 10:11:44 +02:00
Christian Brabandt
9c7790b030 Merge pull request #2556 from watagashi/follow-interface-change-in-taglist
Follow interface change of Tlist_Get_Filenames() in taglist
2022-08-08 08:55:49 +02:00
Christian Brabandt
b9318d7ac0 Merge pull request #2557 from guydunigo/nvimlsp-linenumber
line numbers for nvimlsp like ale
2022-08-08 08:55:31 +02:00
Christian Brabandt
8e477c192b Merge pull request #2561 from kemonprogrammer/patch-1
Update old link
2022-08-03 17:45:07 +02:00
Michael
e581972997 Update old link
Because the repository owner changed
2022-08-03 17:23:43 +02:00
GONI Guillaume
4933ee0977 add support for line numbers for nvimlsp like ale 2022-07-29 10:37:08 +02:00
WADA Takashi
61dc750149 Follow interface change of Tlist_Get_Filenames() in taglist
fac4055600 (diff-f6bf21c80d33916483d5e6c73613457b588f0c86886ebf84f6a50f242e36d72bL3687)
2022-07-27 11:57:42 +09:00
Christian Brabandt
ebb89a0846 plugin: mention how to disable certain events
E.g. how to disable the FocusGained event by setting the 'eventignore'
option.

Add some boilerplate to skip the focusgained function handler function, if it should be
ignored. (this should in theory stop setting up the autocommands at all
so might be tiny performance optimization).

closes #2421
2022-07-13 20:41:15 +02:00
IK
4a290d16fd Merge pull request #2549 from vim-airline/add-vim9-ci
[add] Vim9's test in CI
2022-07-14 00:02:59 +09:00
kazukazuinaina
39e49cbbe8 [add] Vim9's test in CI 2022-07-14 00:00:28 +09:00
Christian Brabandt
83d853adc7 Merge pull request #2490 from vim-airline/replace-testing-framework
replace testing flamework, Using vim-themis
2022-07-12 22:40:13 +02:00
Christian Brabandt
fd56e87d00 highlighter: always consider terminal to be non-modified
references #2506
2022-07-12 22:38:56 +02:00
Christian Brabandt
b5f2eb418a tabline: properly refresh with ModeChanged autocommand
closes #2539
2022-07-12 21:48:06 +02:00
Tim Pope
e4f586b76b branch: simplify git branch logic slightly 2022-07-12 21:45:52 +02:00
kazukazuinaina
6105d0d74e [update] CONTRIBUTING.md 2022-07-03 17:03:33 +09:00
Christian Brabandt
91b67e3ca2 Merge pull request #2545 from rcasta74/vim9script
vim9: Fix boolean check in tabline#formatters#default
2022-06-28 09:13:48 +02:00
Roberto Castagnola
9bc66119a4 vim9: Fix boolean check in tabline#formatters#default
fixes #2544
2022-06-27 22:34:02 +02:00
kazukazuinaina
219c47ab9f [add] Test section in README 2022-06-12 03:28:51 +09:00
kazukazuinaina
1080056bca [delete] single quote 2022-06-11 02:43:24 +09:00
IK
ee80fd85cd Update .github/workflows/ci.yml
Co-authored-by: uhooi <the_uhooi@yahoo.co.jp>
2022-06-11 02:37:12 +09:00
IK
5b5d940f87 Update .github/workflows/ci.yml
Co-authored-by: uhooi <the_uhooi@yahoo.co.jp>
2022-06-11 02:37:04 +09:00
kazukazuinaina
8cd5dd1f34 [update] CONTRIBUTING.md 2022-06-10 02:26:53 +09:00
Christian Brabandt
1a7d546448 fugitive: remove old fugitive test
As mentioned by @tpope, remove the old test for the autoloaded function
fugitivie#head() and instead use consistently FugitiveHead() everywhere

[delete] %bd command

[add] init.vimspec

[update] init.vimspec

[add] parts.vim

[add] section.vimspec

[add] themes.vimspec

[add] util.vimspec

[delete] vim-vspec
2022-06-10 02:00:00 +09:00
kazukazuinaina
9fad2c3fc4 ci: correctly checkout vim-flavor using https://
Currently, the CI throws:

The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

So update vim-flavor to 4.0.1 which uses https:// links instead of
un-authenticated git protocol. Unfortunately, we have to update ruby to
version 3.0 with that.

Let's see if this works.
2022-06-10 02:00:00 +09:00
kazukazuinaina
8681d4d49e [adopt] vim-themis 2022-06-10 01:59:40 +09:00
Christian Brabandt
97a9aa4bdb Merge pull request #2540 from rionda/master
Show flag when `detect_spelllang` is `'flag'`, do not when it is 0.
2022-06-08 15:02:47 +02:00
Matteo Riondato
ba50f598ee Show flag when detect_spelllang is 'flag', do not when it is 0.
927e142e94 broke the "show the lang flag"
functionality, as the check `if g:airline_detect_spelllang` is always
false when this variable is `'flag'`. Explicitly check whether this
variable is the string `'0'` to detect whether the feature should be
disabled.
2022-06-08 08:54:44 -04:00
Christian Brabandt
5d7e656081 fugitive: remove old fugitive test
As mentioned by @tpope, remove the old test for the autoloaded function
fugitivie#head() and instead use consistently FugitiveHead() everywhere
2022-05-21 21:58:11 +02:00
Christian Brabandt
c465570143 Merge pull request #2534 from svenberkvens/fix-close-button-in-tabline
Mark the end of the close button
2022-05-06 10:57:56 +02:00
Sven Berkvens-Matthijsse
396116b059 Mark the end of the close button
Not marking the end makes the rest of line (after the close button) also clickable and react as if the close button was clicked. That is very confusing and incorrect behavior.
2022-05-06 08:51:14 +02:00
Christian Brabandt
13628d698d scrollbar: allow to customize minimum window width
closes #2531
2022-05-05 23:09:33 +02:00
Christian Brabandt
d421c35f94 Merge pull request #2529 from zoumi/master
make exclude pattern works when there are more than one tabpages
2022-05-05 23:05:30 +02:00
Christian Brabandt
0241bdb804 fugitiveline: leading zeros dropped in buffername
fixes #2533
2022-05-05 20:17:45 +02:00
zoumi
ce0e8d7e82 make exclude pattern works when there are more than one tabpages 2022-04-30 10:44:58 +08:00
Christian Brabandt
be5bda1f1d Merge pull request #2526 from pfernandez/patch-1
Changed bufloaded back to buflisted
2022-04-12 18:02:51 +02:00
Paul Fernandez
04bf4eabca Changed bufloaded back to buflisted
The last PR (#2522) caused some issues for me, and the author @KSR-Yasuda suggested that this change could be the culprit. `__CtrlSF__` and `[No Name]` tabs appearing, and adding them to `airline#extensions#tabline#ignore_bufadd_pat` just made the whole tabline disappear.

I also use the Startify plugin with session saving, and found that when restoring a session, the tabs would no longer appear until I had visited a buffer again, whereas beforehand they would load up a soon as I opened Vim. So I commented out my entire vimrc, and could reproduce this issue by opening an existing session with `vim -S mysession`. Without this fix, only a single buffer from the session is shown in the tabline.

I'm using regular Vim, version 8.2 on MacOS 12.3.1.
2022-04-11 10:54:01 -07:00
Christian Brabandt
904979339c fix ci test for tabline 2022-04-08 14:20:02 +02:00
Christian Brabandt
98027a4680 Merge pull request #2522 from KSR-Yasuda/bugfix/TabLine/WrongTabLabel
tabline: Fix tab label being named wrongly
2022-04-07 18:55:00 +02:00
yasuda
35af3bf37f tabline: Fix tab label being named wrongly
- Manage `nobuflisted` windows together
    - If a tab has no `buflisted` window,
      the tab label is named from default buffer name.
- Fix default buffer name selection from wrong tab
    - It has picked up default buffer name from active tab,
      not from the target tab.
2022-04-07 09:09:45 +09:00
Christian Brabandt
dc65eea5d9 Merge pull request #2521 from foonathan/master
Don't use flags in spell when spelllang disabled
2022-03-30 10:21:59 +02:00
Jonathan Müller
927e142e94 Don't use flags in spell when spelllang disabled
In vimscript, `0 ==? 'foo'` is true, as it converts the string to a
number which results in 0 for non-numeric strings.
2022-03-29 22:50:13 +02:00
Christian Brabandt
a306a7abfd Merge pull request #2514 from patricknraanes/main
Enable display country flag instead of spelllang
2022-03-23 20:58:16 +01:00
Christian Brabandt
1b245800b5 Merge pull request #2516 from brandon-doornbos/master
Fix typo/wording in doc
2022-03-23 20:57:18 +01:00
Christian Brabandt
0f237d8b6b ci: correctly checkout vim-flavor using https://
Currently, the CI throws:

The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

So update vim-flavor to 4.0.1 which uses https:// links instead of
un-authenticated git protocol. Unfortunately, we have to update ruby to
version 3.0 with that.

Let's see if this works.
2022-03-23 20:44:44 +01:00
Christian Brabandt
1d486430cc neovim: support global statusline and do not truncate too early
With Neovims recent merge of a global statusline (e.g. a statusline that
is the same across all windows), make sure that truncation only happens,
by checking the complete terminal window width instead of using the Vim
window width (similar to when using g:airline_statusline_ontop).

related: #2517
2022-03-23 19:40:21 +01:00
Brandon Doornbos
e643f9fa7d Fix typo/wording in doc 2022-03-07 23:05:53 +01:00
patricknraanes
2706bdc949 Enable display country flag instead of spelllang 2022-02-28 17:29:47 +01:00
Christian Brabandt
e2498d72dc taglist: avoid v:true/v:false 2022-02-28 15:47:24 +01:00
Christian Brabandt
24f2878080 mode: add several new modes
fixes #2499 #2498
2022-02-28 15:47:24 +01:00
James Rowe
031e6ee4b2 unicode: Trivial quote change for vint error 2022-02-28 15:47:24 +01:00
James Rowe
21cdbea7e6 unicode: Fix check for :UnicodeTable buffer 2022-02-28 15:47:24 +01:00
Adrian Trunzo
d1f6514cef Test for the correct fern loaded variable. 2022-02-28 15:47:24 +01:00
Jeff Pitman
20d77c3220 builder: bugs in is_empty_section
The current way to parse the statusline content and decide whether a
section is empty, has some flaws:

That is for the following reasons:
- accents are considered to be empty (which they really shouldn't)
- manually parsing the expressions using a
  `:while ... matchlist() ... endwhile` loop is slow and fragile
- grouping items such as %( %) are not considered

So replace the logic by using `substitute('pat', '\=add()', '')` to
capture all single expression groups into a list and then looping over
those to decide whether the section is empty.

fixes #2411
2022-02-28 15:47:24 +01:00
kazukazuinaina
64908db62a [fix] Fix meaningless tests. 2022-02-28 15:47:23 +01:00
Ilia Choly
9a3568b815 nvimlsp: use vim.diagnostic.get() if available 2021-12-10 14:51:19 -05:00
Christian Brabandt
bf5d785932 virtualenv: Enable for additional filetypes beside python
So with https://github.com/jmcantrell/vim-virtualenv you can display the
virtualenv in your statusline section (if you have enabled it). However
it would only become active for python buffers.

Now perhaps you want to show the virtualenv also in other filetypes like
markdown or CI scripts, so allow this by adding a variable
`airline#extensions#virtualenv#ft'` to the list of filetypes you want to
have enabled. So set:

    let g:airline#extensions#virtualenv#enabled = 1
    let g:airline#extensions#virtualenv#ft = ['python', 'markdown']

To allow displaying the virtual environment for python and markdown
buffers (but remember you need to have the plugin
https://github.com/jmcantrell/vim-virtualenv installed as well!)

fixes #2483
2021-12-08 11:23:42 +01:00
Gauravsingh Sisodia
8e36c0a8ed main: ignore popup windows for inactive windows
When openning popup (vim) or floating (neovim) windows,
do not consider those windows for disabled windows. That is, leave the
main window in activate state instead of marking it disabled

closes: #2387
2021-12-05 19:05:15 +01:00
Christian Brabandt
de73a21903 tabline: Give error message, if switching buffers is not possible
When using Neovim and switching to another buffer with the mouse and the
current buffer is modified, Vim refuses to switch buffers rightfully,
if the user has not set 'hidden' or 'autowrite' (because it is going to
unload the buffer from memory).

So catch this case and let the user know.

Note: :b! would be another possibility, but I do not prefer using this
attribute, because it is not clear what happens to the current buffer. I
think it is made hidden, but I prefer to be explicit here

closes #2478
2021-12-05 18:52:27 +01:00
Christian Brabandt
841a355196 Merge pull request #2472 from indelog/indelog_vim9lsp
Add extension for yegappan/lsp
2021-11-26 10:31:26 +01:00
Christian Brabandt
65a4d4dd43 Merge pull request #2464 from TamaMcGlinn/master
Add support for flog with git status summary
2021-11-26 10:27:33 +01:00
Indelog
8df0f3db4b Add extention for yegappan/lsp
Show errors and warnigs with yegappans/lsp plugin.
2021-11-26 10:12:11 +01:00
Tama McGlinn
2ed11e9536 Add support for flog with git status summary 2021-11-25 18:09:40 -05:00
Christian Brabandt
f678b4c53d Merge pull request #2471 from capt8bit/taglist_earlier_check
taglist: load taglist variants only once
2021-11-25 17:30:02 +01:00
Michael Monsivais
6716572b30 taglist: load taglist variants only once
Because Tlist_Get_Filenames() only exists within yegappan/taglist,
TlistUpdate was being envoked on every call when using other taglist
versions.(Like vim-scripts/taglist.) This caused visual artifacts and
slowdowns.

We now check for a function from both taglist variants to see if either
one has been loaded.
2021-11-19 10:15:15 -07:00
Christian Brabandt
4b96f58902 Merge pull request #2462 from KSR-Yasuda/feature/CustomSpellCheckCommand
Custom Spell Check Command Support
2021-11-12 13:06:26 +01:00
Indelog
ec761c2adf taglist: correctly check for right taglist plugin
Avoid the error `Unknown function: taglist#Tlist_Get_Tagname_By_Line`
when using the old tag tlist plugin in a different way.

this means, we have to revert 5841039679
since exists() does not handle autoloaded functions correctly.

We can only check it, after we have used the taglist plugin, so that the
autoloading has happened. That means, move the exists() call after the
`:TListUpdate` call which will correctly autoload taglist and then
exists() can check for the existence of the
`taglist#Tlist_Get_Tagname_By_Line()` function correctly.

closes: #2463
2021-11-12 13:04:45 +01:00
Christian Brabandt
5841039679 taglist: check that correct function exists
So 47bf6b1716 added support for
yegappan/taglist plugin, but unfortunately the old (deprecated)
vim-scripts/taglist.vim repo still exists and this one throws an error
when trying to access taglist#Tlist_Get_Tagname_By_Line

So check, that this function is defined before trying to load the
extension
2021-11-12 09:32:50 +01:00
yasuda
646dd0a1c2 Custom spell check command support
- Add an option `g:airline_spell_check_command`
2021-11-12 11:45:58 +09:00
Christian Brabandt
6e5439126f wordcount: allow to disable vimtex wordcount()
While Commit e542f5e introduced a nice little feature for TeX files to
accurately count words, this unfortunately has the drawback of being
possibly slow, especially since the statusline is often re-evaluated.

Therefore disable this feature by default. You can enable it using:

    :let g:airline#extensions#vimtex#wordcount = 1

fixes #2461
2021-11-11 22:51:02 +01:00
Christian Brabandt
47bf6b1716 Merge pull request #2460 from indelog/indelog_taglist
Add extention to support yegappan/taglist
2021-11-11 15:06:32 +01:00
Indelog
d134ae8c2f Add extention to support yegappan/taglist 2021-11-11 14:26:49 +01:00
Christian Brabandt
70904d7070 Merge pull request #2458 from fritzlolpro/patch-1
Allow user to hide CoC status in the section C
2021-11-10 11:24:50 +01:00
Dood of Distinction
e542f5e9d0 Modifies the wordcount to use the vimtex wordcount function when editing TeX files and the vimtex plugin is loaded.
With help from Karl Lervag's suggestion on how to reliably tell when the
above mentioned conditions are the case for the current buffer

Checked to work with other filetypes that use the wordcount in
vim-airline, and these seem to work as before.

Also checked that if two of these filetypes (one TeX and the other
another type, such as markdown) the two coexist peacefully, with TeX
using Karl's wordcount function, and the other using the (I assume)
native wordcount?

Fixed comment wording
2021-11-09 22:02:15 +01:00
Fedor
69726073ca Add documentation 2021-11-03 23:05:05 +03:00
Christian Brabandt
17f7dff748 Merge pull request #2457 from ytian81/remove_hunks_dependency_on_branch
Remove gitgutter hunks summary dependency on branch
2021-11-03 20:50:19 +01:00
Fedor
f0ee8f193e Allow user to hide CoC status in the section C
Hello.
This PR should solve my pain as CoC user, that CoC status takes too much space in the C section, right after the file path. 
It looks like a waste of space on splitscreen or a small screen.

So I added an option to set
g:airline#extensions#coc#show_coc_status = 0
and the status will be hidden. 

By default it works like usual.
2021-11-03 15:27:47 +03:00
Yang Tian
0dd6f5e711 remove gitgutter dependecy on branch 2021-11-03 00:24:08 -07:00
IK
ddaf69804a Merge pull request #2446 from vim-airline/fix-assertion-roulette
[fix] assertion roulette in test
2021-11-03 16:14:50 +09:00
Christian Brabandt
86a8ac0f96 Merge pull request #2451 from barn/master
Add vim-rufo extension support to section z.
2021-11-02 21:54:24 +01:00
Bea Hughes
6800c9ea7f Add vim-rufo extension support to section z.
Displays whether you have the ruby formatter enabled or not for the
session you are in.

Enable with:
let g:airline#extensions#rufo#enabled = 1

Configure with:
let g:airline#extensions#rufo#symbol = '💎'
2021-11-01 10:36:33 -07:00
kazukazuinaina
2b260aabfe [fix] extensions_default's assertion rulette 2021-10-27 01:11:20 +09:00
kazukazuinaina
c9820b0378 [fix] assertion roulette 2021-10-10 19:52:02 +09:00
Christian Brabandt
26f922753a coc-extension: remove dead code
vim-airline does not use actually use the `g:coc_stl_format` variable
and it also doesn't seem to be used by coc itself. So let's just remove
this code.

closes #2437
2021-09-21 08:43:30 +02:00
Christian Brabandt
0a7e1bc475 style: Remove colon 2021-09-21 08:43:30 +02:00
Christian Brabandt
2e29ab9656 Merge pull request #2424 from Freed-Wu/Freed-Wu-patch-1
Fix bug of g:airline_symbols.spell == ''
2021-09-10 10:03:58 +02:00
wzy
78cb6e6621 Fix bug of g:airline_symbols.spell == '' 2021-08-16 14:41:49 +08:00
Christian Brabandt
0de4c9df21 Merge pull request #2419 from Freed-Wu/fix-typo
Fix #2418
2021-08-11 19:15:58 +02:00
Freed-Wu
c39ec8ef35 Fix #2418 2021-08-11 00:38:46 +08:00
Christian Brabandt
2259e5c93e Merge pull request #2416 from zeertzjq/gina-initialized
Don't show "gina" in diff buffers if `b:gina_initialized` is not set
2021-08-09 20:59:40 +02:00
Christian Brabandt
e519b53cab Merge pull request #2417 from LOTehan/master
Fix "Cannot allocate color none"
2021-08-09 20:59:12 +02:00
LOTehan
cc0d39b528 color name is case-sensitive in the latest gvim 2021-08-08 02:18:04 +08:00
zeertzjq
969c13c716 Don't show "gina" in diff buffers if b:gina_initialized is not set 2021-08-07 19:28:15 +08:00
Christian Brabandt
0cfd829c92 Merge pull request #2414 from vEnhance/master
Allow overriding trailing ws regexp per buffer
2021-08-04 08:11:53 +02:00
Evan Chen
0f3feca572 Allow overriding trailing ws regexp per buffer
For example, in a github repository, you might want to allow trailing
double spaces in a file, but not elsewhere
2021-08-03 21:35:22 -07:00
IK
b861f9d248 Merge pull request #2404 from vim-airline/fix-2388-issue
[fix] issue #2338
2021-07-19 02:41:29 +09:00
kazukazuinaina
ec4bbabe4a [fix] issue #2338
add check airline_stl_path_style's flag and pathshortln api
2021-07-12 02:26:52 +09:00
IK
4807a211cd Merge pull request #2403 from vim-airline/add-new-vim-version-ci
[add] 8.2.2000 in ci
2021-07-12 01:51:29 +09:00
kazukazuinaina
84a04bbd5b [add] 8.2.2000 in ci 2021-07-12 00:41:45 +09:00
Christian Brabandt
a94d8034c3 Merge pull request #2402 from vim-airline/add-patch-1
[refactor] use Ternary operator
2021-07-06 08:49:54 +02:00
kazukazuinaina
9b113a02f5 [refactor] use Ternary operator 2021-07-06 02:37:52 +09:00
Christian Brabandt
49cdcb7b3e vim9: Needs at least version 8.2.22844 2021-06-07 13:44:53 +02:00
Christian Brabandt
82b1b2e876 Merge pull request #2394 from adriantrunzo/master
Correct line number for coc.nvim warnings.
2021-06-04 08:45:17 +02:00
Adrian Trunzo
fdda58861b Correct line number for coc.nvim warnings.
- The line number index is 0 for errors, 1 for warnings.
2021-06-03 14:23:44 -06:00
Christian Brabandt
a8b3c254d0 Merge pull request #2391 from aostruszka/master
Change event for tabline autoshow
2021-05-27 18:53:33 +02:00
Andrzej Ostruszka
3882146c41 Change event for tabline autoshow
Use TabNew/TabClosed for the "autoshow" event when tabline is used only
for tabs (show_buffers==0).  This fixes case of visible tabline when
tab_min_count == 2 and user executes ':tabonly' command - the tabline
should disappear but there is no TabEnter event triggered in this case.

Closes #2389
2021-05-27 08:29:30 +00:00
Christian Brabandt
b6f6cc9312 autoload: fix error with vim74 2021-05-26 13:26:47 +02:00
Aaron Adams
98aea41dc2 Warn if a function is already registered for inactive statusline
closes #2388
2021-05-26 13:09:04 +02:00
Christian Brabandt
05bd105cab Merge pull request #2385 from ReubenM/master
Completely customizable linenr, maxlinenr, colnr symbols and strings
2021-05-26 08:02:03 +02:00
Christian Brabandt
73025ea504 Merge pull request #2390 from ls4154/master
scrollbar: fix first line overwrite
2021-05-26 08:01:43 +02:00
Youngjae Lee
affe12b7e7 scrollbar: fix first line overwrite 2021-05-26 10:48:36 +09:00
Christian Brabandt
4a64fbfc4b scrollbar: disable by default
as per feedback from reddit
2021-05-21 16:10:51 +02:00
ReubenM
ef232cfee1 Update docs 2021-05-19 15:43:23 -05:00
Christian Brabandt
03ec880101 Merge pull request #2386 from vim-airline/add_winwidth_test
[add] winwidth's test
2021-05-18 08:13:00 +02:00
kazukazuinaina
51c79f61f4 [add] winwidth's test 2021-05-14 02:25:14 +09:00
ReubenM
1f94ec1556 Make everything in linenr, maxlinenr, and colnr completely configureable, including spaces and colons. The only thing hard wired anymore is the actual numbers. 2021-05-09 22:12:37 -05:00
Christian Brabandt
ab4962b838 tabline: remove commented out functions, that are not possible in Vim9 2021-05-09 09:20:06 +02:00
Christian Brabandt
4c0c60bbf2 scrollbar: user after variable instead of re-calculating it 2021-05-08 18:50:24 +02:00
Christian Brabandt
ecac148e19 scrollbar: add an ascii scrollbar extension 2021-05-08 18:06:25 +02:00
Christian Brabandt
e7eea7c6e8 vim9: Use correct vim9 lambda functions 2021-05-08 13:55:26 +02:00
Christian Brabandt
a2f298ba8f vim9: Rewrite highlighter in Vim9 Script
This is the one script, that is usually causing the most slow down.
Converting it to Vim9 Script should keep vim responsive and the users
happy. Hopefully that works now.
2021-05-08 13:36:55 +02:00
Christian Brabandt
7e295c859f vim9: finish early for legacy Vims
fixes #2382
2021-05-08 09:20:25 +02:00
Christian Brabandt
19360bac63 themes: remove tabs for indenting 2021-05-08 01:42:10 +02:00
Christian Brabandt
7181950501 vim9: rewrite themes.vim to Vim9 Script 2021-05-08 01:39:55 +02:00
Christian Brabandt
e608a0c016 vim9: Rewrite tabline#formatters#default to Vim9Script 2021-05-08 00:48:18 +02:00
Christian Brabandt
725e881ac9 vim9: Convert tabline.vim to vim9 script 2021-05-08 00:27:11 +02:00
Christian Brabandt
c0c6b0e216 tabline: only remove 'e' flag from guioptions, if it is present 2021-05-07 22:50:29 +02:00
Christian Brabandt
390b243cf3 doc: Allow for experimental features 2021-05-07 22:48:42 +02:00
Christian Brabandt
23e20bfada autoload: handle bufnr as string explicitly
This is some preparational work for evetually merging the vim9 script
feature.

Also while at it, remove those nasty `l:` prefixes
2021-05-07 22:46:57 +02:00
Christian Brabandt
db78454a03 symbols: Use a different Column char in UTF-8
Personally I don't like the extra-wide ㏇ char, so let's make it ℅
2021-05-07 22:29:59 +02:00
Vincenzo Di Massa
f7cbf8c429 glob return results without removing wildignore matches
Ignore 'wildignore' and 'suffixes' when globbing for themes and extensions.

This can be a problem when you have a wildignore containing *.vim.

closes #2375
2021-05-03 08:37:05 +02:00
kazukazuinaina
76e42284e9 tests: add some more tests for g:airline_section vars
closes #2370
2021-05-03 08:33:12 +02:00
Christian Brabandt
76c24d2126 Merge pull request #2374 from ReubenM/master
Section-Z symbols and layout
2021-05-03 08:09:38 +02:00
Christian Brabandt
2d650d2e83 Merge pull request #2378 from flwyd/autocmd-dont-skip-toggle-off
Fire AirlineToggledOff autocmd even if airline is disabled
2021-05-03 08:04:35 +02:00
Trevor Stone
7a87615cbe Fire AirlineToggledOff autocmd even if airline is disabled
Fixes #2377.  This regression was introduced in 2e9df43.
2021-05-02 21:44:45 -06:00
Christian Brabandt
2e9df43962 autocommands: check for existence of airline highlight group
Several extensions trigger custom actions. Make sure, those actions are
only performed, if airline is actually active and not temporarily
disabled using e.g. :AirlineToggle
2021-04-30 13:26:33 +02:00
Christian Brabandt
06134df810 Merge pull request #2372 from vim-airline/add_parts_test
[add] parts's test
2021-04-29 19:49:20 +02:00
ReubenM
9e62ad962a Remove un-needed spaces in section-z when using Ascii variant 2021-04-29 12:09:41 -05:00
ReubenM
8929bc72a1 Fix symbols and layout used in line and column display from section-z. Added column number symbol. 2021-04-29 11:55:25 -05:00
kazukazuinaina
38a90d8801 [add] parts's test 2021-04-28 20:42:48 +09:00
Christian Brabandt
30f8ada1d6 Merge pull request #2371 from vim-airline/add_commands_test_case
[add] AirlineExtensions's test case
2021-04-28 08:12:20 +02:00
kazukazuinaina
4968c6bb18 [add] AirlineExtensions's test case 2021-04-28 00:50:13 +09:00
Christian Brabandt
c9eaf4c5d2 Merge pull request #2366 from vim-airline/add_new_opthon_airline_sectionc_file
[add] airline_sectionc_filename_onlyfilename option
2021-04-27 17:46:00 +02:00
kazukazuinaina
9b2c1e9915 [add] g:airline_section_c_only_filename 2021-04-27 19:39:21 +09:00
Christian Brabandt
2f6471a9e1 Merge pull request #2369 from vim-airline/add_init_test_autochdir
[add] test case for init.vim / When autochdir is enabled
2021-04-27 08:00:48 +02:00
kazukazuinaina
ef5a0b53ef [add] test case for init.vim / When autochdir is enabled 2021-04-27 02:56:54 +09:00
Christian Brabandt
0a87d08dbd whitespace: Skip '===' conflict marker for markdown
fixes: #2014
2021-04-23 08:48:44 +02:00
Christian Brabandt
07ab201a27 Merge pull request #2363 from KSR-Yasuda/feature/ScratchBufName
Set bufname for [Scratch] (buftype = nofile)
2021-04-15 10:06:29 +02:00
Christian Brabandt
70b06be4b0 highlighter: do not error out, if defined hi-color does not exist
if a color definition is being used, that Vim does not seem to
recognize, instead of erroring out fallback to a hard-coded value of
grey. Otherwise we do have potentially a bad user experience for
throwing too many error messages at the user in very short time, which
may prevent him from doing the actual work (as just happened to me)

Grey should always be defined and it should be rather easy to spot
(I hope). Also just mention for what group this happens.

This should give the user a clue, where and when this happens (so he may
be able to adjust the theme).
2021-04-14 12:36:00 +02:00
yasuda
bc5945de65 Set bufname for [Scratch] (buftype = nofile) or [No Name] (otherwise) 2021-04-14 16:54:22 +09:00
Christian Brabandt
ed60e1d369 Merge pull request #2355 from patrick96/coc_current_function
coc: Show the current function in section_x
2021-03-27 17:15:19 +01:00
Christian Brabandt
2e421d3cd6 Merge pull request #2356 from nomasprime/move-airlineaftertheme-autocmd-to-load-theme
Move AirlineAfterTheme to load_theme()
2021-03-27 17:14:20 +01:00
Christian Brabandt
cba392dd7a Merge pull request #2357 from miuirussia/patch-1
Fix error: key not present in dictionary "percentage"
2021-03-27 17:12:04 +01:00
Kirill Kuznetsov
75383ef2e7 Fix error: key not present in dictionary "percentage"
a3b58eb7c4/doc/vim-lsp.txt (L1371)

percentage key is optional
2021-03-21 17:40:33 +03:00
Rick Jones
3d7dfa8ef6 Move AirlineAfterTheme to load_theme()
So it gets called when colorscheme changes.
2021-03-21 11:19:08 +00:00
patrick96
7d6adf9cc5 coc: Show the current function in section_x
coc.nvim exposes the name of the function the cursor is currently in
through b:coc_current_function.

For this to work, the key coc.preferences.currentFunctionSymbolAutoUpdate
must be set to 'true' in the coc config.

The value is only updated on CursorHold, so the value may not always be
accurate when moving around.
2021-03-20 00:42:46 +01:00
Christian Brabandt
09dbd09ed3 highlighter: handle color names when converting into msdos codes
the highlighter code tries to convert the RGB colors into appropriate
color codes for the MSDOS palette. Unfortunately, it does not consider
color names and tries to split those into a list of 3 RGB codes. This
failes for names shorter 6 characters, causing a list index out of
bounds error.

Fix this by making sure, that the color code should start with '#' and
in case it does not, assume it is a color name and simple return the
name in that case.

closes #2350
2021-03-09 13:53:38 +01:00
Christian Brabandt
a262ec6ce4 Merge pull request #2348 from craigemery/patch-1
Fix effecting for affecting.
2021-03-07 18:33:04 +01:00
Craig
639a0038cf Fix effecting for affecting. 2021-03-03 09:38:32 +00:00
Christian Brabandt
df956aa08b Merge pull request #2347 from ls4154/master
tagbar: add missing default search method
2021-03-02 12:41:48 +01:00
Youngjae Lee
0a7c68afb2 tagbar: add missing default search method 2021-03-02 20:27:36 +09:00
Christian Brabandt
fc639c0cf8 Merge pull request #2345 from UtkarshVerma/master
coc: Show line number for warnings and errors.
2021-03-02 10:20:12 +01:00
Utkarsh Verma
32d28421fe coc: Show line number for warnings and errors. 2021-02-28 13:00:17 +05:30
Christian Brabandt
cb1bc19064 Merge pull request #2337 from vim-airline/Functionalization_of_branch_extension
[refactor] Functionalization of branch extension
2021-02-15 16:12:20 +01:00
kazukazuinaina
f107396118 [Refactor] Functionalization of branch extension 2021-02-14 21:22:11 +09:00
Christian Brabandt
c01977d027 Merge pull request #2326 from kdwarn/tagbar-search-method
Add searchmethod setting for tagbar extension
2021-02-05 08:19:55 +01:00
Christian Brabandt
82000c7cfc Merge pull request #2331 from idbrii/fix-nul
Fix NUL file created when opening a .po file
2021-02-05 08:19:25 +01:00
David Briscoe
ecba959f28 Write msgfmt output to /NUL
Fix NUL file created when opening a .po file.

Using -o NUL actually creates a file called NUL in the current
directory. Using /NUL doesn't create one in C:\ (the drive the file is
located on) or any visible drive.

Despite msgfmt being able to create the file NUL (which isn't supposed
to be allowed), it's difficult to delete NUL (windows explorer can't
handle it but WSL's unix rm can remove it).

Test
Open po file and see the same warnings as before, but no NUL file
created.
Using msgfmt.exe provided by git (installed via scoop).
2021-02-04 16:13:07 -08:00
Kris Warner
a6dd1c3887 Add searchmethod setting for tagbar extension
The current implementation of tagbar does not allow for setting the
search-method in the `tagbar#currenttag` function. In
https://github.com/preservim/tagbar/pull/696, tagbar implemented this,
which has three options: nearest, neartest-stl, and scoped-stl.

The reason for adding this - for me, at least - is to use the scoped-stl
option, so that the statusline will display the proper function when
there are nested functions. (Otherwise, once you go past a nested
function, tagbar#currenttag still returns the nested function rather
than the function it was nested in.)
2021-02-04 12:18:02 -05:00
Christian Brabandt
6def2f0a82 Merge pull request #2325 from dutchgecko/fix_2324_neovim
Ensure correct checking of LSP support on neovim
2021-02-04 08:28:24 +01:00
Jan-Willem van der Sijp
b9905f2445 Ensure correct checking of LSP support on neovim
Check for differing neovim versions with different APIs for LSP.

Fixes #2324

Consists of two tests:

1. Before extension load, test if this is neovim and whether this neovim
   supports LSP
2. When getting diagnostic counts, test whether a language server is
   attached to the current buffer
2021-02-03 12:11:53 +01:00
Christian Brabandt
50dfca52ed nvimlsp: correctly call the lua functions for nvimlsp
closes #2324

Note: seems like one needs to call v:lua.vim.lsp.buf_get_clients() and
even then some older neovims do not understand that. So wrap it around
an exists() call and hope this works for all neovims.
2021-02-02 12:25:16 +01:00
Christian Brabandt
bffa7a4d23 nvimlsp: do not check for :LspInstallInfo
nvimlsp removed the :LspInstallInfo command. So instead check explicitly
for neovim for enabling the nvimlsp extension.

In the extension itself check that at least one LSP is attached to the
buffer before returning warning and error messages.

closes #2323
2021-02-02 10:07:51 +01:00
Christian Brabandt
c7a633ce8f Merge pull request #2319 from idbrii/lsp-hide-when-nothing
Return nothing when there is no lsp-progress
2021-01-14 10:17:20 +01:00
David Briscoe
74f1f0d990 Return nothing when there is no lsp-progress
Fix: a literal '0' appears after filename on older versions of vim-lsp.

0c8164b1b3 added support for showing lsp
progress, but didn't always explicitly return a value. Vim uses 0 as a
return value when none are supplied, so when used with an older version
of vim-lsp that doesn't have the progress feature a 0 appeared in the
statusline.
2021-01-13 15:25:45 -08:00
Christian Brabandt
0ca9576331 Merge pull request #2313 from DunZzzz/patch-1
Support Vue.js file extension in jsformatter
2021-01-10 19:36:20 +01:00
Emilien Jégou
36f14c478a Support Vue.js file extension in jsformatter
Included `.vue` extension to jsformatter for supporting Vue.js files. Vue files follows the same path resolution as js files: https://vue-loader.vuejs.org/spec.html#src-imports

Case sensitive comparison for jsformatter
2021-01-10 13:01:41 +01:00
Christian Brabandt
fdfc11f53a Merge pull request #2318 from jsutlovic/patch-1
Modified dark.vim commandline gui colors
2021-01-08 16:13:44 +01:00
Jero Sutlovic
1651762e10 Modified dark.vim commandline gui colors
Update commandline gui colors to match the commandline cterm colors
2021-01-08 15:26:18 +01:00
Christian Brabandt
30bcbb07c3 Merge pull request #2317 from kidonng/patch-1
Update vim-lawrencium link
2021-01-05 10:35:02 +01:00
Kid
c32215e94b Update vim-lawrencium link 2021-01-05 17:17:57 +08:00
Christian Brabandt
0eb2ed4488 Merge pull request #2315 from micchy326/impl_vim_lsp_progress
impl vim-lsp progress
2021-01-04 08:38:43 +01:00
Christian Brabandt
da6b076ee4 doc: mention that searchcount is only enabled when 'hls' is on 2021-01-02 20:35:58 +01:00
Christian Brabandt
4d284a677c searchcount: Add leading space
closes #2314 #2154

Add a leading space before the searchcount statistics. Note, that this
uses a non-breaking space, because it looks like Vim is stripping aways
leading space characters (see vim/vim#1431)
2021-01-02 20:25:00 +01:00
Christian Brabandt
8a60582527 init: section_y includes missing endofline and BOM 2021-01-02 19:26:44 +01:00
micchy326
8a80369227 describe to disabling procedure 2021-01-02 21:16:40 +09:00
micchy326
14c79dd2fe fix test 2021-01-02 17:42:09 +09:00
micchy326
dad2c03cf5 fix vint 2021-01-02 17:01:06 +09:00
micchy326
0c8164b1b3 impl vim-lsp progress 2021-01-02 16:51:16 +09:00
Bailey Ling
5601c0928e Happy new year! 2021-01-01 12:57:00 +00:00
Bailey Ling
60083f35a8 Update maintainers list 2021-01-01 12:54:47 +00:00
Christian Brabandt
17bf22e6fb Merge pull request #2310 from roachsinai/select_tenth_buffer
tabline: add command for skip to tenth buffer.
2020-12-30 11:13:51 +01:00
roachsinai
505a7d75ca tabline: add command for skip to tenth tab/buffer. 2020-12-30 00:21:43 +08:00
Christian Brabandt
59b4826806 plugin: remember 'scroll' option value and reset it after enabling the statusline
fixes #2307
2020-12-23 13:43:30 +01:00
Christian Brabandt
f39208f1a0 Merge pull request #2302 from kazukazuinaina/update_readme_changelog
[update] CI's badge and [update] CHANGELOG.md
2020-12-09 08:58:46 +01:00
kazukazuinaina
c0160d93a8 [update] CI's badge and [update] CHANGELOG.md 2020-12-09 16:56:04 +09:00
Christian Brabandt
c074620bfd Merge pull request #2300 from kazukazuinaina/delete_travis
delete travis.yml
2020-12-09 08:42:23 +01:00
kazukazuinaina
4858046e94 delete travis.yml 2020-12-09 16:39:05 +09:00
Christian Brabandt
6d6afc527e Merge pull request #2299 from kazukazuinaina/add_gha
[add] github-actions
2020-12-09 08:34:52 +01:00
kazukazuinaina
9a3a11f966 [add] github-actions
Note: According to an email from travis-ci, travis-ci.org will be officially closed down completely on December 31st, 2020
2020-12-09 16:19:28 +09:00
Christian Brabandt
2cea83eb88 whitespace: skip trailing ws test for mail filetypes 2020-12-06 09:46:14 +01:00
Christian Brabandt
9ce6f96f60 highlighter: windows terminal uses $WT_SESSION 2020-12-04 09:43:01 +01:00
Christian
06117a61e1 highlighter: windows terminal is not old win_term 2020-11-27 09:49:17 +01:00
Christian Brabandt
79eac1558a Merge pull request #2293 from srinivas32/master
added power support arch ppc64le on yml file.
2020-11-27 08:32:38 +01:00
Christian Brabandt
157af8ad8b tabline: use airline#util#strcharpart instead on relying on stpart() with char index 2020-11-26 14:00:29 +01:00
Christian Brabandt
cbf0a8e69a tabline: use strpart() with chars if possible (fixes #2297) 2020-11-26 10:04:43 +01:00
Christian Brabandt
a168ca7a28 tabline: get rid of s:vars in default formatter 2020-11-26 10:04:43 +01:00
Christian Brabandt
a48f67657f Merge pull request #2295 from nbCloud91/patch-1
coc_status should show with autochdir
2020-11-21 20:03:04 +01:00
nbCloud91
332fff9206 coc_status should show with autochdir
coc_status should be visible even with autochdir setting on.
2020-11-21 20:47:17 +05:30
srinivas32
c378a0aeb7 added power support arch ppc64le on yml file.
Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le.
2020-11-20 13:27:49 +05:30
Christian
91a8ada0f9 doc: document tabline highlighting groups (closes #2285) 2020-11-19 14:17:22 +01:00
Christian
beb20cb49f doc: mention that the tabline mappings are not automatically created
related: #2290
2020-11-19 13:52:08 +01:00
Christian Brabandt
536667191d Merge pull request #2287 from timfeirg/master
buf_diagnostics_count is deprecated. Use 'vim.lsp.diagnostic.get_count'
2020-11-14 12:11:18 +01:00
timfeirg
5eae08609e fix deprecation warning
code is copied from https://github.com/vim-airline/vim-airline/issues/2289
originally contributed by @cmccannbrite
2020-11-14 17:01:19 +08:00
Christian Brabandt
731bdb11d2 Merge pull request #2286 from jan-xyz/patch-1
remove work-around for vista.vim
2020-11-10 08:47:56 +01:00
Jan Steinke
df096e16ae remove unnecessary indirection 2020-11-10 08:40:42 +01:00
Jan Steinke
7091b8a6ff remove work-around for vista.vim 2020-11-09 20:17:05 +01:00
Christian Brabandt
9267cef0f8 Merge pull request #2282 from martskins/handle-lcn-not-running
Check LanguageClient-neovim's status before getting diagnostics
2020-11-09 18:35:51 +01:00
Christian Brabandt
bb760710cc Merge pull request #2283 from Kamilcuk/master
Fix typo in checking if gen_tags plugin is loaded
2020-11-09 18:26:12 +01:00
Kamil Cukrowski
f6f8666533 Fix bug in checking if gen_tags plugin is loaded 2020-11-08 11:01:26 +01:00
Martin Asquino
bd5ae9c584 Check LanguageClient-neovim's status before getting diagnostics 2020-11-07 12:59:13 +00:00
Christian Brabandt
5f2421fa39 Merge pull request #2276 from kazukazuinaina/fix_indent_bookmark_extension
[fix] bookmark extension's indentation and add abort
2020-11-06 09:11:35 +01:00
Christian Brabandt
3f4b811510 Merge pull request #2278 from kazukazuinaina/fix_short_path_space
[fix] short path formatter's space
2020-11-06 09:10:34 +01:00
kazukazuinaina
1ed922265a [fix] short path formatter's space 2020-11-05 23:44:29 +09:00
kazukazuinaina
83804f3c6d [fix] bookmark extension's indentation and add abort 2020-11-05 23:14:13 +09:00
Christian Brabandt
d64e5f8dd7 extensions: fix E715
Make sure, that the get() function returns the correct variable type
2020-11-05 10:36:03 +01:00
Christian Brabandt
dcebc6d2aa Merge pull request #2273 from NFrid/master
add more customization options for keymap extension
2020-11-05 09:23:58 +01:00
Nick Friday
193460137a [add#keymap] more customization
Added more customization for keymap extension
2020-11-04 20:46:00 +03:00
Christian Brabandt
44b7b72938 Merge pull request #2266 from vim-airline/refactor_airline_gui_mode
Get rid of g:airline_gui_mode
2020-10-30 09:18:29 +01:00
Christian Brabandt
c8c0e7d9ff Get rid of g:airline_gui_mode
This is needed for Neovim, because an external UI could be attached to
the same neovim server, so it does not make sense to define highlighting
groups with either only the cterm or the guifg attribute set.

So refactor the code slightly got get rid of this variable (and since
this variable is not needed anymore, we can also get rid of the guienter
and OptionSet autocommand).

fixes: #2261
2020-10-30 08:32:35 +01:00
Christian Brabandt
38c9f9ca3d Merge pull request #2256 from Kamilcuk/master
Add gen_tags.vim plugin support
2020-10-29 13:41:35 +01:00
Kamil Cukrowski
42b31b966b Add gen_tags.vim plugin support
Display a "Gen. gen_tags" text in section x when gen_tags
is generating tags, similar to gutentags support.
2020-10-22 00:16:05 +02:00
Christian Brabandt
8608270bd3 Merge pull request #2257 from weirane/nroff-wordcount
Add nroff to wordcount
2020-10-18 16:48:42 +02:00
Christian Brabandt
85c64a668d Merge pull request #2259 from subnut/master
Improve the documentation of localsearch extension
2020-10-18 16:48:20 +02:00
Subhaditya Nath
34968bf65c Improve the documentation of localsearch extension
Fixed the copy-paste error mentioned by @chrisbra at
https://github.com/vim-airline/vim-airline/pull/2240#discussion_r494570378

Also improved the wording a bit
2020-10-17 20:05:22 +05:30
Wang Ruochen
19ab70ee87 Add nroff to wordcount 2020-10-17 16:54:46 +08:00
Christian Brabandt
83bd08a97a Merge pull request #2243 from whisperity/battery-plugin-no-overwrite
[battery.vim] Change indicator to not overwrite position section
2020-10-14 09:04:46 +02:00
Christian Brabandt
14abb40287 Merge pull request #2255 from JNRowe/master
Fix doc for enabling wordcount’s reading time support
2020-10-14 09:04:08 +02:00
James Rowe
4e03ac85f9 Fix doc for enabling wordcount’s reading time support 2020-10-13 18:19:02 +01:00
IK
9c0a85de2f Merge pull request #2254 from kazukazuinaina/fix_localsearch_url
[fix] localsearch's url and add abort in autoload function
2020-10-14 01:45:56 +09:00
kazukazuinaina
659693c250 [fix] localsearch's url and add abort in autoload function 2020-10-14 01:17:00 +09:00
Whisperity
2762f7e6e5 [battery.vim] Move indicator to non-overwriting position if window big enough 2020-10-12 17:58:47 +02:00
IK
06747d11be Merge pull request #2250 from kazukazuinaina/fix_variable_scope
[fix] Variable's Scope in ctrlspace's extension
2020-10-12 17:48:01 +09:00
Christian Brabandt
7087c475be Merge pull request #2253 from adrian5/master
Fix wording/typos in doc
2020-10-12 10:18:53 +02:00
adrian5
2ad2eeb9ca Fix wording/typos in doc 2020-10-11 16:05:44 +02:00
kazukazuinaina
0a5753813c [fix] Variable Scope in ctrlspace's extension 2020-10-10 02:08:23 +09:00
Christian Brabandt
aa773f5cdf Merge pull request #2248 from MuhammadMouradG/master
Fix buffer order in tabline with CtrlSpace plugin
2020-10-06 14:41:34 +02:00
MuhammadMouradG
f117de553b Fix buffer order in tabline with CtrlSpace plugin 2020-10-06 12:36:28 +00:00
Christian Brabandt
958ffe059a doc: fix grammatical typo
fixes: #2246
2020-10-05 10:50:05 +02:00
Christian Brabandt
9614105d09 Merge pull request #2240 from subnut/master
Add more customization for 'localsearch' extension
2020-09-26 08:50:14 +02:00
Subhaditya Nath
3fc5ad231c Add more customization for 'localsearch' extension
Now it can be configured to show only when localsearch is disabled. It
is useful if you mostly keep localsearch enabled and don't want to keep
seeing the extra 'LS' section, but still want to have some kind of a
visual indication about when localsearch is disabled.
2020-09-26 01:16:48 +05:30
Christian Brabandt
3740312de0 Merge pull request #2234 from kmoschcau/master
Improve the term extension and make it consistent
2020-09-16 11:59:03 +02:00
Moschcau, Kai
d40e5f9a1d Improve the term extension and make it consistent
This improves the term extension in a few ways.

First it fixes some vint warnings about case sensitive comparisons.

Next it makes the active and inactive variants consistent, as well as
making the line number display consistent to other buffer types. This
was one of the main reasons to do this, because the inclusion of the
Neoterm ID in a previous pull request made inactive terminal status
lines look really inconsistent compared to the active ones.

Further this now shows the Neoterm ID in both active and inactive
buffers in Airline section B. It also removes the now redundant
Neoterm IDs from the buffer name in both Neovim and Vim.

Finally the cosmetic buffer name is now used for both active and
inactive variants.
2020-09-16 09:41:18 +02:00
Christian Brabandt
bf4bba4c5a Merge pull request #2237 from kazukazuinaina/update_gitignore
[update] .gitignore
2020-09-15 14:15:31 +02:00
Christian Brabandt
3272a2d490 doc: mention coc explorer
related: #2235
2020-09-15 14:14:21 +02:00
Christian Brabandt
af556115de Merge pull request #2235 from andys8/patch-1
Support coc-explorer (file explorer extension)
2020-09-15 14:10:45 +02:00
Andy
98683125f6 Support coc-explorer (file explorer extension) 2020-09-15 13:44:05 +02:00
Nathan Lanza
27b52acee7 Only attempt to use dirvish if b:dirvish exists
This was causing persistent errors when you run, for example,

```
ls | nvim -c 'setf dirvish'
```

as dirvish will not yet have set that local variable yet airline will
attempt to use it.
2020-09-15 12:30:27 +02:00
Christian Brabandt
47c9205127 Merge pull request #2236 from chrisbra/fix_failing_test
fix failing test
2020-09-15 12:27:30 +02:00
Christian Brabandt
aed3523ee3 fix failing test 2020-09-15 12:22:41 +02:00
kazukazuinaina
30287992e2 [update] .gitignore 2020-09-15 18:18:07 +09:00
Christian Brabandt
f5693986c4 Merge pull request #2227 from kazukazuinaina/add_battery_extensions
[add] support for battery.vim
2020-09-09 09:03:30 +02:00
kazukazuinaina
2a69254d21 [add] support battery.vim 2020-09-08 01:26:24 +09:00
Christian Brabandt
51f599e2cf Merge pull request #2223 from arafel/magit_dictionary
vim-magit: Can't use an empty dictionary key
2020-09-03 12:46:56 +02:00
Paul Walker
dd5a3c91a1 vim-magit: Can't use an empty dictionary key 2020-09-03 10:51:23 +01:00
IK
2daabc2cce Merge pull request #2222 from kazukazuinaina/fix_nerdtree_setting_variables
[fix] document's typo about nerdtree_statusline
2020-09-03 17:34:31 +09:00
kazukazuinaina
7f91b54a44 [fix] document's typo about nerdtree_statusline 2020-09-03 17:20:52 +09:00
Christian Brabandt
c77d89046e doc: fix typo for show_buffers variable
related: #2218
2020-08-27 13:07:32 +02:00
Christian Brabandt
0f5eedff74 mode: keep hi setting when switching from 'n' to 'ni'
when using `Ctrl-O` from insert mode, the highlighting currently updates
from insert mode highlighting to normal mode highlighting.
Unfortunately, changing the highlighting can be a bit expansive, so
redefining the highlighting just for one simple command does not make
too much sense.

Instead, keep the insert mode highlighting, because that's kind of like
the major mode Vim is in currently. The mode message uses '(INSERT)' to
distinguish between a "normal" INSERT mode and this temporary INSERT
mode, so it should still be visually be distinguishable.

closes #2217
2020-08-26 22:46:05 +02:00
huanhuan_zhuang
5d3cfa4045 add 'g:airline#extensions#tabline#tabtitle_formatter' option
The option can be used to specify a customized format() function to display tab title in tab mode
2020-08-25 13:42:18 +02:00
Christian Brabandt
3a55368320 searchcount: Ignore errors from searchcount() function
If the search regex causes an error, an ugly error message is thrown,
so ignore errors in that case silently.

closes #2216
2020-08-25 13:36:03 +02:00
IK
ef4666bd86 Merge pull request #2210 from kr5hn4/patch-1
Update README.md
2020-08-21 03:38:30 +09:00
Krishna Biradar
a738664dcc Update README.md
Fix typo
2020-08-20 22:43:42 +05:30
Christian Brabandt
02c529efe4 Merge pull request #2205 from eevan78/master
Several fixes and improvements
2020-08-20 09:33:53 +02:00
eevan78
c1134da741 Fix po.vim
There is an extra '] ' in case when a display_limit is set. Also change messages == '0T' to messages ==# '0T'
2020-08-19 11:00:39 +04:00
IK
f84683a8c2 Merge pull request #2204 from kazukazuinaina/fix_vista_statusline
[adjust] vista's extension  width
2020-08-18 15:44:32 +09:00
eevan78
ad80550252 Initial Windows support for msgfmt
For now, it is tested successfully on the latest Vim 8.2 running on Windows 10.
Needs further change and testing for Neovim and older Vim versions.
2020-08-15 02:52:48 +04:00
eevan78
c78c1fb870 Make keymap extension follow the iminsert option
This small change makes keymap extension sensitive to <CTRL-^> in Insert mode.
2020-08-15 02:43:58 +04:00
eevan78
5770e8befd Small improvements of po extension
• Fixed shortening of message. It was not showing more than one digit for fuzzy and untranslated strings.
• Fixed case when starting translation (0 translated), and accomodated for some bigger po catalogs (more than 1000 strings)
• Add support for Windows (I use it on Windows, it works fine with latest Vim. Didn't test Neovim or older Vim versions, though)
• Add one extra space character to the right of the output string
2020-08-15 02:39:25 +04:00
kazukazuinaina
0cebac6bb0 [adjust] vista's extension width 2020-08-15 00:17:01 +09:00
IK
19d1990f86 Merge pull request #2202 from kazukazuinaina/fix_reading_time_doc
[fix] readingtime formatter's doc
2020-08-13 01:56:38 +09:00
kazukazuinaina
8e0d5cd95d [fix] readingtime formatter's doc 2020-08-13 01:52:50 +09:00
IK
f4aaa7c76f Merge pull request #2201 from kazukazuinaina/add_readingtime_doc
[add] readingtime formatter's document
2020-08-13 00:55:58 +09:00
kazukazuinaina
12f1934d38 [add] readingtime formatter's document 2020-08-13 00:23:51 +09:00
Christian Brabandt
6a1c2a74e9 Merge pull request #2125 from shaine/master
Use disabled style for inactive tabs
2020-08-12 15:43:05 +02:00
Christian Brabandt
a294f0cb7e Merge pull request #2183 from tooSadman/nvim-lsp-support
Added support for built-in nvim-lsp
2020-08-12 15:41:47 +02:00
Christian Brabandt
8037c373d0 Merge pull request #2195 from kazukazuinaina/add_wordcount_formatter_readingtime
[add] wordcount's reading time formatter
2020-08-12 15:40:26 +02:00
Christian Brabandt
21e47ca5b3 Disable whitespace checking for csv files
In addition, add a time limit of 500 ms for detecting the indent

fixes: #2200
2020-08-12 15:38:26 +02:00
kazukazuinaina
f26a01cd02 [add] wordcount's reading time formatter 2020-08-07 00:05:38 +09:00
IK
16935cc666 Merge pull request #2194 from kazukazuinaina/add_new_test
[add] new vim version's test
2020-08-06 18:47:28 +09:00
kazukazuinaina
8cd824b4ac [add] new vim version's test 2020-08-06 18:42:06 +09:00
IK
16f88fe363 Merge pull request #2193 from kazukazuinaina/add_short_path_doc
[add] short_path's doc in airline
2020-08-06 01:05:04 +09:00
kazukazuinaina
0e2cc23d49 [add] short_path's doc in airline 2020-08-05 14:15:14 +09:00
tooSadman
782774c0dc Added support for built-in nvim-lsp 2020-08-03 18:19:26 +03:00
Christian Brabandt
ffa44b8327 Merge pull request #2188 from kazukazuinaina/fix_searchcount_extension
[fixup] Release the search restriction and remove unnecessary functions
2020-08-03 15:20:49 +02:00
Christian Brabandt
e4077b1725 Merge pull request #2185 from dcousens/patch-1
Fix spelling typo in comment
2020-08-03 14:44:58 +02:00
Christian Brabandt
a836e09e91 Merge pull request #2187 from kazukazuinaina/add_section_c_short_path
[add] short_path formatter in section_c
2020-08-03 12:21:44 +02:00
kazukazuinaina
1ca2428f51 [fixup] Release the search restriction and remove unnecessary functions 2020-07-28 16:29:42 +09:00
IK
2a027e992d Merge pull request #2186 from kazukazuinaina/fix_searchcount_extension
[fix] searchcount's extension
2020-07-28 11:14:33 +09:00
kazukazuinaina
7ff5fdc349 fix CI 2020-07-23 16:11:19 +09:00
kazukazuinaina
b322ee6728 [add] short_path formatter in section_c
[update] test
2020-07-23 15:58:21 +09:00
kazukazuinaina
19fdf61efe [fix] CI's error 2020-07-21 14:41:15 +09:00
kazukazuinaina
13a92b1474 [fix] searchcount's extension 2020-07-21 14:08:21 +09:00
Daniel Cousens
7bb3ec24ba Fix spelling typo in comment 2020-07-20 21:41:59 +10:00
Christian Brabandt
7fc51f6952 Merge pull request #2181 from cdelledonne/master
Add support for cdelledonne/vim-cmake
2020-07-17 19:36:00 +02:00
Carlo Delle Donne
72a19ed9ed Add support for cdelledonne/vim-cmake 2020-07-17 15:14:40 +02:00
Christian Brabandt
b6d6485a90 Merge pull request #2176 from konafx/master
Add fern.vim support
2020-07-14 16:10:21 +02:00
konafx
a7716dec4d Add extension for fern.vim 2020-07-14 22:54:55 +09:00
Christian Brabandt
f655add4e9 hunks: do not add trailing whitespace when branch extension is disabled
fixes #2177
2020-07-14 14:03:17 +02:00
Christian Brabandt
767107070e Merge pull request #2175 from skeept/patch-1
don't rely on NR for checking that NrrRgn is loaded
2020-07-14 11:36:33 +02:00
skeept
c4ee72f2d9 don't rely on NR for checking that NrrRgn is loaded
This fixes issue when using Plug to conditionally loading NrrRgn:

Plug 'chrisbra/NrrwRgn', {'on': ['NR', 'NW', 'NRV', 'NW', 'NarrowRegion']}

The command will exist but the plugin has not been loaded yet which gives a warning message.
2020-07-09 11:16:23 -05:00
Christian Brabandt
768bd0f5c6 Merge pull request #2158 from larrybradley/fix-venv
Fix handling of virtualenv and poetv plugins
2020-07-09 08:42:32 +02:00
Christian Brabandt
08bab60614 Merge pull request #2174 from nomasprime/dynamically_resize_section_z
Dynamically resize section Z
2020-07-09 08:41:45 +02:00
Rick Jones
46c35b80a1 Make appending airline_right_alt_sep conditional on it not being empty (wordcount)
Was appending a redundant space when airline_right_alt_sep was empty.
2020-07-08 23:46:00 +01:00
Rick Jones
ee4afdeedb Dynamically resize section Z
Resolves: #2168
2020-07-08 23:46:00 +01:00
IK
2fec415a5d Merge pull request #2165 from kazukazuinaina/add_searchcount_document
[add] searchcount's document
2020-07-08 18:12:23 +09:00
kazukazuinaina
416897c73d [add] searchcount's document 2020-07-08 18:09:05 +09:00
Christian Brabandt
0a0d61af6c fzf: do not check for loaded fzf
closes #2163
2020-07-08 08:47:59 +02:00
Christian Brabandt
48d49075ec Merge pull request #2171 from nickspoons/omnisharp-extension
Add OmniSharp extension to display server status
2020-07-08 08:39:02 +02:00
nickspoons
fab4a02838 Add OmniSharp extension to display server status 2020-07-08 16:32:07 +12:00
Christian Brabandt
b843321428 Merge pull request #2166 from fvictorio/patch-1
Fix link to localsearch repo
2020-07-05 11:26:07 +02:00
Franco Victorio
7cd12641c7 Fix link to localsearch repo 2020-07-04 17:42:23 -03:00
Christian Brabandt
ba9b3e1839 Merge pull request #2161 from kazukazuinaina/add_support_searchcount
[RFC] Add support for searchcount extension
2020-06-29 09:25:56 +02:00
Christian Brabandt
cb03578a7c Merge pull request #2164 from Freed-Wu/master
Fix bug of keyboard_layout
2020-06-29 09:24:48 +02:00
wzy
b96e02c649 Fix bug of keyboard_layout
when `keyboard_layout==''`, `let keyboard_layout = split(keyboard_layout, '\.')[-1]` will return an error.
2020-06-29 13:44:13 +08:00
kazukazuinaina
2d9e88794d delete redrawstatus
This is unnecessary. Removing it will still work properly and improve performance.
2020-06-28 06:37:29 +09:00
kazukazuinaina
2c45d3c1aa [add] support fot searchcount extension 2020-06-28 05:57:55 +09:00
IK
d0aaa061c2 Merge pull request #2157 from kazukazuinaina/add_terminalMode_color_palette
[add] terminal mode's color palette
2020-06-26 17:55:02 +09:00
kazukazuinaina
476bba726c [add] terminal mode's color palette
Neovim returns a has('terminal') of 0.
Therefore, this conditional branch is not needed.
2020-06-25 00:33:27 +09:00
Christian Brabandt
8be6a2ecd5 Merge pull request #2156 from kazukazuinaina/add_fzf_extension_doc
[add] fzf integration's document
2020-06-22 08:41:50 +02:00
Christian Brabandt
bc8fdfe946 terminal: correctly shorten terminal tabline
If there is a single terminal window in  the current tabpage, the whole
long command will be displayed in the tabline, even when it should be
shortened by default.

By default the title will not be shown if there are several windows in
the current tabpage, but if there is only one single terminal window, it
will still be shown (and might be a bit long). But I guess, it is better
to just show a possible too long terminal window name, than not show
anything).

fixes #2126
2020-06-21 22:31:43 +02:00
kazukazuinaina
bcabad32cf [add] fzf integration's document 2020-06-20 07:43:19 +09:00
Larry Bradley
e352adda69 Fix handling of virtualenv and poetv plugins 2020-06-19 11:07:06 -04:00
Christian Brabandt
5ce3e63658 Merge pull request #2146 from noisysocks/master
Support fzf and fzf.vim
2020-06-19 11:45:34 +02:00
Christian Brabandt
e58c4a493c Merge pull request #2155 from kazukazuinaina/update_license_year
[update] wordcount's formatter's license year
2020-06-19 09:49:35 +02:00
kazukazuinaina
cc6d3a7df1 [update] wordcount's formatter's license year 2020-06-19 03:28:21 +09:00
Robert Anderson
88894aa0ad Support fzf and fzf.vim
Adds a slightly nicer statusline for the terminal buffers created by the
fzf and fzf.vim plugins.

https://github.com/junegunn/fzf
https://github.com/junegunn/fzf.vim
2020-06-13 10:31:29 +10:00
IK
ee85ed4c67 Merge pull request #2150 from kazukazuinaina/update_licence_year_extension
[update] license's year in airline's extension
2020-06-11 19:02:01 +09:00
kazukazuinaina
fab1ee3117 [update] license's year in airline's extension 2020-06-11 05:26:04 +09:00
Christian Brabandt
90f7210413 Merge pull request #2149 from nomasprime/add_update_highlights_docs
Add update highlights docs
2020-06-09 18:37:14 +02:00
Rick Jones
8177d63e07 Add update highlights docs
Resolves: #1404
2020-06-06 16:13:02 +01:00
IK
d221dc5312 Merge pull request #2143 from PratikBhusal/master
vim-dirvish: Fixed bugs, added include guards and documentation
2020-05-31 09:15:55 +09:00
PratikBhusal
de76234a0e vim-dirvish: Fixed bugs and added better include guards
Fixes issue #2142.

These changes primarily focused on making the include guards more robust
and simplify how the path for w:airline_section_c was generated.
Credits goes to @kazukazuinaina for improving on my original
implementation.
2020-05-30 00:25:56 -05:00
Christian Brabandt
0de31196b6 Merge pull request #2139 from PratikBhusal/master
Add vim-dirvish support
2020-05-29 23:12:46 +02:00
Christian Brabandt
6ddda74126 Merge pull request #2141 from kazukazuinaina/add_extension_unite_denite
[add] unite and denite's config
2020-05-29 23:11:50 +02:00
Christian Brabandt
64c0374423 Merge pull request #2138 from kazukazuinaina/update_CONTRIBUTING.md
[update] CONTRIBUTING.md
2020-05-29 23:11:07 +02:00
kazukazuinaina
b929452f32 [add] unite and denite's config
[add] document
2020-05-29 18:20:01 +09:00
Christian Brabandt
c744fb81b6 Merge pull request #2140 from xerus2000/patch-1
Update README.md
2020-05-27 11:50:16 +02:00
Janek
ba2c1b4e25 Update README.md 2020-05-27 10:45:28 +02:00
PratikBhusal
e0838c704a Added vim-dirvish support
Matched VCS format of Netrw to only show branch name.
Filetype hidden as it is a duplicate on the left side.
File encoding hidden as it does not matter in dirvish buffer.
Removed unnecessary current column information
2020-05-25 19:34:52 -05:00
kazukazuinaina
d232ec08b9 [update] CONTRIBUTING.md 2020-05-24 08:09:20 +09:00
IK
3fa0e0ce0c Merge pull request #2131 from kazukazuinaina/update-changelog
[update] CHANGELOG.md
2020-05-23 05:09:11 +09:00
IK
e23978fb68 Merge pull request #2137 from kazukazuinaina/refactoring_vimagit
[refactor] vimagit's extension
2020-05-22 23:21:46 +09:00
kazukazuinaina
a133605d01 [refactor] vimagit's extension 2020-05-21 15:19:25 +09:00
IK
f244ff9987 Merge pull request #2136 from kazukazuinaina/fix_endif
fix missing endif
2020-05-21 03:13:53 +09:00
kazukazuinaina
68024ec33d fix missing endif 2020-05-21 01:26:33 +09:00
kazukazuinaina
1e6f5c7705 [update] CHANGELOG.md 2020-05-07 00:44:11 +09:00
Christian Brabandt
aa46603214 Merge pull request #2128 from jolan78/master
fix for #2127
2020-05-04 14:19:44 +02:00
Christian Brabandt
ffdf52e38d Merge pull request #2129 from kazukazuinaina/fix_check_ycm_extension
abopt get() function
2020-05-04 14:19:14 +02:00
kazukazuinaina
1f1a71ae2b abopt get() function 2020-05-04 17:53:13 +09:00
jolan78
3b46a4d9a3 fix for #2127 2020-05-04 10:07:39 +02:00
Christian Brabandt
915c7cfcd7 Fix brocken CI test
because vim 7.4 does not know v:vim_did_enter

I am beginning to wonder, whether we should have vim8 as a minimal
requirement...
2020-05-04 08:10:33 +02:00
Christian Brabandt
0ac474fdc4 plugin: load vim-airline as optional package
allow to load vim-airline as opt package

Fixes: 2122
2020-05-04 07:48:13 +02:00
Shaine Hatch
62e7fc6ab1 Use disabled style for inactive tabs 2020-04-30 12:13:55 -06:00
Christian Brabandt
96d37d2fbe hunks: fix missing line continue character 2020-04-29 17:17:58 +02:00
Christian Brabandt
48064e24d5 hunks: only enable coc-git extension, if explicitly enabled by the user
As requested by the coc maintainer, this is explicitly disabled, unless
the user configures vim-airline to use it for the branch extension. This
is done, because the `CocAction('extensionStats')` function is known to
be slow and this may cause a slow startup.
2020-04-29 16:59:37 +02:00
Christian Brabandt
e7f78bbc0f Merge pull request #2124 from kazukazuinaina/add_vaffle_path
[add] vaffle's path section
2020-04-29 15:08:33 +02:00
kazukazuinaina
ad3132da33 [add] vaffle's path section 2020-04-29 21:37:36 +09:00
Christian Brabandt
ff3f66ed30 Merge pull request #2121 from kazukazuinaina/add_branch_setting_in_doc
[add] branch symbol's Explanation
2020-04-24 17:27:29 +02:00
kazukazuinaina
d2513b8460 [add] branch symbol's Explanation
[fix] document's position
2020-04-24 20:13:41 +09:00
Christian Brabandt
eff4828b37 README: fix saythanks link
unfortunately, saythanks broke and since it has been restored, the links
changed. So fix it here again.
2020-04-20 08:11:35 +02:00
Christian Brabandt
f00a9e6e7a Merge pull request #2119 from kazukazuinaina/update_coc_status_width
[adjust] coc_status's width
2020-04-20 07:57:16 +02:00
Christian Brabandt
76c1998753 extensions: prevent error about unknown function for ycm
if g:loaded_youcompleteme does not exists, the ycm extension will not be
loaded. However extensions.vim could still try to init the ycm
extension, which would lead to an error message:

  E117: unknown function airline#extensions#ycm#init

so make sure, it is only loaded, if ycm is loaded as well.
2020-04-20 07:54:00 +02:00
kazukazuinaina
379e0f5bc2 [adjust] coc_status's width 2020-04-18 17:48:26 +09:00
Christian Brabandt
2eb95b2e09 Merge pull request #2118 from kazukazuinaina/add_hunks_readme
[add] coc-git section in README
2020-04-17 12:22:06 +02:00
kazukazuinaina
cce6b55a27 [add] coc-git section in README 2020-04-17 16:57:54 +09:00
Christian Brabandt
c8fe296c52 Merge pull request #2117 from kazukazuinaina/update_ycm_extension
[add] ycm's toggle and doc
2020-04-17 09:40:05 +02:00
Christian Brabandt
0074044413 Merge pull request #2116 from kazukazuinaina/add_cursormode_toggle
[add] cursormode's toggle
2020-04-17 09:38:51 +02:00
kazukazuinaina
15a1a3ccc7 [add] ycm's toggle and doc 2020-04-15 12:08:09 +09:00
kazukazuinaina
37273299f7 [add] cursormode's toggle 2020-04-15 11:45:45 +09:00
Christian Brabandt
7c31850381 wordcount: only test against complete filetypes
Put a word-boundary regex atom before and after the current filetype, to
make sure that a `C` filetype won't be detected as a filetype that
enables the wordcount extension. (`c` matches asciidoc).
2020-04-14 19:53:18 +02:00
Christian Brabandt
12aa326dae Merge pull request #2113 from kazukazuinaina/add_zoomwintab_doc
[add] zoomwintab's document
2020-04-14 13:53:00 +02:00
kazukazuinaina
9840b26fa4 [add] zoomwintab's document
[fix] mistake plugin name

[add] zoomwintab's variable's config
2020-04-14 20:41:44 +09:00
Christian Brabandt
a100e89671 Merge pull request #2111 from troydm/master
zoomwintab extension added
2020-04-10 14:21:16 +02:00
troydm
487d21e7ff zoomwintab extension vint fix 2020-04-07 21:50:23 +03:00
troydm
5902a23e78 zoomwintab extension added 2020-04-07 21:33:28 +03:00
Christian Brabandt
87d4648172 Merge pull request #2108 from kazukazuinaina/add_coc_status_test
[add] some coc's test
2020-04-03 08:09:29 +02:00
kazukazuinaina
acd7e82d2b [add] some coc's test 2020-04-03 12:15:42 +09:00
Christian Brabandt
23374c491c Merge pull request #2106 from kazukazuinaina/add_vista_test
[add] vista's test
2020-04-02 18:04:11 +02:00
kazukazuinaina
576710f7a5 [add] vista's test 2020-04-03 01:00:55 +09:00
Christian Brabandt
adf2afae7c hunks: still some problems with coc-git integration
Fix remaining problems, test correctly for enabled coc-git plugin.
2020-04-01 10:49:00 +02:00
Christian Brabandt
29eec37c66 tabline: fix typo
related: #2103
2020-03-30 08:27:20 +02:00
Christian Brabandt
74ca43a9b6 [hunks] also cache coc git status 2020-03-29 19:37:44 +02:00
Christian Brabandt
5a490dd9ac hunks: remove test for empty branch for changes plugin
Because changes plugin does not rely on git
Also remove the test of the local variable for the changes plugin
whether it is enabled or not, this is taken care of in the changes
plugin
2020-03-29 19:37:44 +02:00
Christian Brabandt
c70f3da583 Merge pull request #2103 from kazukazuinaina/always_show_tab_count
[add] new option / always show tab count feature
2020-03-29 18:50:14 +02:00
kazukazuinaina
185bcc5e88 [add] new option / always show tab count feature 2020-03-30 01:06:06 +09:00
Christian Brabandt
c05fff8504 hunks: add abort keyword to function definitions 2020-03-29 17:30:29 +02:00
Christian Brabandt
a13bed2f51 hunks: integrate coc-git extension
The coc-git extension to coc does show similar statistics as e.g.
gitgutter, therefore, integrate the coc-git interface into the hunk
extension.

closes #2094
2020-03-29 17:30:29 +02:00
Christian Brabandt
02a0ab4b59 Merge pull request #2102 from kazukazuinaina/fix_coc_test
fix coc extension's unit test
2020-03-29 16:42:21 +02:00
kazukazuinaina
5b994f77b1 fix coc's unit test 2020-03-29 23:13:13 +09:00
Christian Brabandt
2f2003be52 Merge pull request #2098 from kazukazuinaina/add_check_vista_toggle
[add] check vista's toggle
2020-03-29 16:04:35 +02:00
Christian Brabandt
8a7172e1c2 Merge pull request #2099 from kazukazuinaina/fix_denite_extension
[fix] operator and [add] abort in autoload function
2020-03-29 16:04:08 +02:00
Christian Brabandt
99c2dfd569 coc: use bold accent for g:coc_status
fixes #2101
2020-03-29 16:03:00 +02:00
kazukazuinaina
f8a3afa4a1 [fix] operator and [add] abort in autoload function 2020-03-29 00:45:32 +09:00
kazukazuinaina
e671a68b48 [add] check vista's toggle 2020-03-28 18:15:29 +09:00
Christian Brabandt
0278e9095d Merge pull request #2093 from kazukazuinaina/add_wordcount_filetype
add plaintex filetype
2020-03-23 11:39:20 +01:00
kazukazuinaina
16223d0bc3 add plaintex filetype
re-order and update document
2020-03-20 22:41:50 +09:00
Christian Brabandt
119477060d Merge pull request #2090 from Freed-Wu/master
Add g:airline#extensions#capslock#sign
2020-03-20 14:13:56 +01:00
Christian Brabandt
352e6dd19d Merge pull request #2089 from kazukazuinaina/add_gina_copyright
[add] gina.vim's url
2020-03-20 14:13:09 +01:00
Christian Brabandt
b36542d509 Merge pull request #2092 from kazukazuinaina/fix_github_actions_url
[fix] github_actions's url
2020-03-20 14:12:49 +01:00
Freed-Wu
254d1a2d8d Add g:airline#extensions#capslock#symbol
Add help

Add linebreak and default
2020-03-20 11:02:34 +08:00
kazukazuinaina
dd72442fee [fix] github_actions's url 2020-03-18 02:52:17 +09:00
kazukazuinaina
b2cd5baa24 [add] gina.vim's url 2020-03-15 20:05:22 +09:00
Christian Brabandt
4e2546a209 Changelog: Mention coc.nvim improved integration from #2079 2020-03-02 13:18:28 +01:00
ckipp01
fe94d52c4c coc: add in coc_status to coc.nvim integration
Allow to show additional messages from coc.nvim in section_c

For ease of use, shorten the message for windows smaller than 81
characters.

closes #2079
2020-03-02 13:16:37 +01:00
Christian Brabandt
fdafa44b2f Merge pull request #2068 from fx-carton/master
Add support for vim-lsp
2020-03-02 13:05:19 +01:00
Christian Brabandt
418fb24982 Merge pull request #2083 from kazukazuinaina/add_check_ale_extension_toggle
[add] check ale's toggle
2020-03-02 13:04:25 +01:00
Serge Y. Stroobandt
3b339fee98 wordcount: Word count for the combined file types
[Pandoc flavoured Markdown](https://en.wikipedia.org/wiki/Markdown#CommonMark) has its [own file type in `vim`](https://github.com/vim-pandoc/vim-pandoc-syntax#standalone), namely `markdown.pandoc`.
Word count by default in `vim-airline` obviously would make a lot of sense for this popular file type.

Fix this, by making sure that the wordcount extensions will apply
correctly if any of the combined filetypes (e.g. either pandoc or
markdwon) matches the list of allowed filetypes.
2020-03-02 13:03:21 +01:00
François-Xavier Carton
0860036454 Add support for vim-lsp 2020-03-01 00:41:33 +01:00
kazukazuinaina
9e3a0626bf [add] check ale's toggle 2020-02-29 01:31:39 +09:00
Christian Brabandt
71a7e23f32 Merge pull request #2081 from kazukazuinaina/fix/scope
[fix] count variable's scope
2020-02-28 09:19:09 +01:00
kazukazuinaina
6115527e7e [fix] conut variable's scope 2020-02-28 17:14:45 +09:00
Christian Brabandt
774cd8b08f term: better formatting of neovim terminal
closes #2074
2020-02-27 13:37:50 +01:00
Christian Brabandt
bc19a18b3c Merge pull request #2070 from idbrii/focuslost_inactive_focusgained_ignore
Ignore FocusGained events for the current second
2020-02-27 13:17:27 +01:00
Christian Brabandt
256eb1b5a1 Merge pull request #2077 from kazukazuinaina/update/changelog
Changelog / add unit test section
2020-02-27 13:09:15 +01:00
kazukazuinaina
7e042e7b70 Changelog / add unit test section 2020-02-27 11:15:25 +09:00
David Briscoe
c2ff76829f Ignore FocusGained events for the current second
Fix #2062: restore g:airline_focuslost_inactive behaviour.

Only ignore focusgained events on Windows. If there are more problematic
platforms, we'll add them later.

Instead of ignoring the next x FocusGained events whenever we do call
system(), ignore them for the current second. That allows us to put a
hard limit on the duration of the ignore.

This seems like a much better solution than the previous one because it
also prevents ignore events from building up (s:focusgained_ignored was
often greater than 5).

Test (gvim 8.2.140 on Win10)
gvim.exe ~/.vim/bundle/airline/autoload/airline/extensions/branch.vim
:Gedit HEAD
check several parents and no regression of looping behaviour from #2053.

:let g:airline_focuslost_inactive = 1
:split
alt-tab several times and statusline is correctly dimmed and restored
each time.
2020-02-21 09:21:47 -08:00
Christian Brabandt
0b26834648 Merge pull request #2069 from kazukazuinaina/gina_refactoring
[update] gina's extensions
2020-02-21 09:07:35 +01:00
Christian Brabandt
d7692e1fe5 Merge pull request #2067 from JacksonBailey/improve-readme
Specify the full helptags command
2020-02-21 09:06:15 +01:00
Jackson Bailey
9bbeb75dd8 Specify the full helptags command 2020-02-20 13:34:29 -05:00
kazukazuinaina
fc09bf751a [update] gina's extensions in extensions dir
fix typo and add section_b

[add] extension gina

[add] unstaged extensions

[fix] typo

[Done] gina refactoring

[fix] document

[fix] gina's spell

[add] abort
2020-02-17 22:43:07 +09:00
Christian Brabandt
7e00ee1107 Merge pull request #2066 from kazukazuinaina/update_reviewdog_yml
[update] reviewdog.yml
2020-02-17 13:59:25 +01:00
Christian Brabandt
3fdfdc9963 Merge pull request #2059 from languitar/patch-1
Always obey the poetv#enabled setting
2020-02-17 13:58:31 +01:00
kazukazuinaina
7cc49c9386 [update] reviewdog.yml 2020-02-07 20:14:47 +09:00
Christian Brabandt
099dd92eeb Merge pull request #2065 from kazukazuinaina/fix_github_actions_url
[fix] github action's url in README
2020-02-07 09:14:19 +01:00
kazukazuinaina
0654fec1be [fix] github action's url in README 2020-02-07 17:10:15 +09:00
Christian Brabandt
985d15613e Merge pull request #2063 from kazukazuinaina/add_github_actions
[add] github actions
2020-02-07 08:39:54 +01:00
Christian Brabandt
73502997ff Merge branch 'master' into add_github_actions 2020-02-07 08:39:41 +01:00
Christian Brabandt
3481cebe22 Merge pull request #2064 from kazukazuinaina/update_travis_badge
[update]travis-ci's badge
2020-02-07 08:36:24 +01:00
kazukazuinaina
a6a3eab8d9 [add] github actions
[add] github actions's batch in README

[update] yml
2020-02-07 05:14:16 +09:00
kazukazuinaina
5e470bcf0b [update]travis-ci's badge 2020-02-07 04:59:37 +09:00
Johannes Wienke
5c1f3b426b Always obey the poetv#enabled setting
Do not silently enable an extension even though the `enabled` setting is false.

This would resolve #2058
2020-02-01 22:01:00 +01:00
Christian Brabandt
f659a98d50 completion: only return random theme, when it actually matches 2020-01-30 13:42:21 +01:00
Christian Brabandt
e22f735f80 Merge pull request #2055 from kazukazuinaina/fix_typo_in_doc
[fix] typo in doc
2020-01-29 08:14:17 +01:00
Christian Brabandt
abf54b60a4 Merge pull request #2053 from idbrii/fix-focusgained
branch: ignore upcoming FocusGained when updating
2020-01-29 08:13:53 +01:00
kazukazuinaina
24900181f4 [fix] typo in doc 2020-01-29 12:17:39 +09:00
David Briscoe
dd247a0f85 branch: ignore upcoming FocusGained when updating
closes #2029

airline#util#focusgain(1) was called too soon -- it's called before vim
loses focus and not after it gains focus. Instead, we ignore the next
FocusGained event.
2020-01-28 12:01:09 -08:00
Christian Brabandt
8fbb16f838 async: correctly use &shell and &shellcmdflag
instead of hardcoding to use 'sh' and '-c'
2020-01-28 16:04:53 +01:00
Christian Brabandt
a201689e38 async: correctly redirect error on powershell 2020-01-28 16:01:52 +01:00
Christian Brabandt
2e9d36e220 async: problem with powershell
also check for the powershell on windows.

closes #2050
2020-01-28 16:00:02 +01:00
Christian Brabandt
c3cda92272 Merge pull request #2049 from kazukazuinaina/fix_echo_extension_load
Fix echo extension load
2020-01-28 15:58:00 +01:00
Christian Brabandt
eb916c0c57 Merge pull request #2051 from kazukazuinaina/fix_nerdtree_url_in_doc
[fix] nerdtree's url in doc and README.md
2020-01-28 15:56:13 +01:00
Christian Brabandt
f4795532c6 branch: disable FocusGained handler when updating fugitive information
closes #2029
2020-01-28 15:54:53 +01:00
kazukazuinaina
52175cec3d [fix] nerdtree's url
[fix] nerdtree's url in README
2020-01-28 17:40:25 +09:00
kazukazuinaina
70c91d70c5 [fix] can display loaded extension in g:airline_extensions
[fix] continue check
2020-01-27 07:11:24 +09:00
Christian Brabandt
d4502d02a1 Merge pull request #2046 from dlukes/master
Deduplicate virtualenv identifier sections
2020-01-24 12:48:20 +01:00
David Lukes
ce45960049 Suggest fix for #2045 2020-01-24 12:46:07 +01:00
Christian Brabandt
1240403ce5 highlighter: fix obvious spelling error 2020-01-20 12:32:06 +01:00
Christian Brabandt
a676af7c8a highlighter: check for accents key
This is actually a work around for a broken installation. the dict p
should always contain the accents key (see `airline#themes#patch()`
function, that adds missing accents). So even if the theme does not
define the accents key, it should always exist.

However, an error while evaluating the statusline is extremely annoying,
so add some safeguards here and skip the following for loop.

related #2043
2020-01-20 12:28:04 +01:00
Christian Brabandt
62976a21b0 Merge pull request #2044 from kazukazuinaina/update_license_in_doc
update license year in doc/airline.txt
2020-01-20 08:24:51 +01:00
kazukazuinaina
4a4be9cd99 update license year in doc/airline.txt 2020-01-16 11:22:19 +09:00
Christian Brabandt
8d694cba9c Merge pull request #2042 from kazukazuinaina/fix_issue_2041
update &preview in extensions.vim
2020-01-13 11:37:02 +01:00
kazukazuinaina
f0317f6dd4 update preview in extensions.vim 2020-01-12 01:27:24 +09:00
Christian Brabandt
c1de3d3370 Merge pull request #2040 from kazukazuinaina/update_license_year_
update license's year in vim-airline
2020-01-06 10:18:28 +01:00
kazukazuinaina
cf6dcf5e19 update license's year in vim-airline 2020-01-06 11:22:49 +09:00
Christian Brabandt
66f77d4a77 Merge pull request #2038 from kazukazuinaina/update_changelog
add poetv in CHANGELOG.md
2020-01-03 08:33:37 +01:00
kazukazuinaina
07e16116fd add poetv in CHANGELOG.md 2020-01-03 15:06:38 +09:00
Christian Brabandt
0755196c4d Merge pull request #2035 from petobens/poetv
Add poetv extension
2019-12-30 21:38:47 +01:00
Christian Brabandt
3d0f51152a Merge pull request #2034 from kazukazuinaina/update_ci
update .travis.yml
2019-12-30 21:37:58 +01:00
kazukazuinaina
48917f34a3 update .travis.yml
test

update

aaa

update

update ci

fix commit

update vim

update

update .travis.yml

update travis.yml

update

update

update .travis.yml

fix syntax error

update Gem

update path

delete bundle install

add license
2019-12-31 02:31:15 +09:00
petobens
98f03df8e5 Add poetv extension 2019-12-30 10:37:03 -03:00
Christian Brabandt
d199186df0 Merge pull request #2033 from jonathf/index_from_1
Adding option: `buffers#buffer_idx_mode = 3`
2019-12-27 16:31:31 +01:00
Jonathan Feinberg
892c9ad6b5 Adding option: buffers#buffer_idx_mode = 3
By using `buffer_idx_mode = 3`, indexing will start at 1, instead of 11.
2019-12-27 13:00:50 +01:00
Christian Brabandt
5a87ca631a Merge pull request #2027 from midchildan/feat-buffer-disable
allow disabling airline per-buffer
2019-12-27 08:47:45 +01:00
Christian Brabandt
c6283b5185 Merge pull request #2026 from midchildan/fix-airline-inactive
fix missing check for w:airline_disable_statusline
2019-12-27 08:47:20 +01:00
Christian Brabandt
dee74777db Merge pull request #2031 from kazukazuinaina/add_vaffle_extension
Add support for Vaffle
2019-12-27 08:27:27 +01:00
kazukazuinaina
61bcec3b57 add vaffle extension 2019-12-26 17:03:15 +09:00
midchildan
9779a7a340 allow disabling airline per-buffer 2019-12-22 21:26:59 +09:00
midchildan
bc0e2a3438 fix missing check for w:airline_disable_statusline 2019-12-22 20:06:35 +09:00
Christian Brabandt
b93492b40b Merge pull request #2024 from kazukazuinaina/fix_untracked_branch_check
fix untrack branch check about gina
2019-12-19 11:44:50 +01:00
kazukazuinaina
be85daa23f fix untrack branch check about gina 2019-12-19 15:43:50 +09:00
Christian Brabandt
3b6b2474a2 Merge pull request #2023 from kazukazuinaina/update_ISSUE_TEMPLETE
add screen shot section in ISSUE_TEMPLETE.md
2019-12-18 10:05:31 +01:00
kazukazuinaina
6f440ff679 add screen shot section 2019-12-18 16:46:54 +09:00
Christian Brabandt
98326670b6 Merge pull request #2022 from kazukazuinaina/can_choice_gina_statusline
can choice to use gina's extension
2019-12-17 19:19:42 +01:00
kazukazuinaina
44b1e3df5d can choice to use gina's extension
fix typo

add v:version >= 800and remove v:version > 704

fix CI error
2019-12-18 00:44:47 +09:00
Christian Brabandt
929cf2e21f Merge pull request #2021 from kazukazuinaina/add_try_catch_in_gina_branch
add try catch in gina.vim's extension in branch.vim
2019-12-15 16:19:51 +01:00
Christian Brabandt
aee2c7f91d Merge pull request #2020 from kazukazuinaina/fix_typo_in_tabline_vim
fix typo in tabline.vim
2019-12-15 16:17:59 +01:00
Christian Brabandt
e142bbd1bf Merge pull request #2017 from kazukazuinaina/update_changelog
update changelog
2019-12-15 16:17:31 +01:00
kazukazuinaina
d4e2bfe892 add try catch in gina.vim's extension in branch.vim 2019-12-15 23:08:31 +09:00
kazukazuinaina
60aaed01ae fix typo in tabline.vim 2019-12-15 21:28:51 +09:00
kazukazuinaina
f1c48e9820 update changelog 2019-12-14 04:38:58 +09:00
Christian Brabandt
72286b27cc Merge pull request #2016 from kazukazuinaina/add_gina_support_for_branch
add gina support for vim-airline's branch
2019-12-13 20:19:08 +01:00
kazukazuinaina
f8e1f85fde add gina support for vim-airline's branch
add check gina in util.vim

fix typo

add gina check

fix typo

add gina.vim's url in doc

fix typo

delete v:version > 800

fix error
2019-12-14 04:10:46 +09:00
Christian Brabandt
9f00b402c5 plugin: save/restore cpo setting
This has been missing way too long. It should always be set to a sane
vim default, as documented (:h write-plugin). So add it as well.
2019-12-13 10:17:15 +01:00
Christian Brabandt
5f9ae83f44 config: allow to disable setting the statusline option
closes #2013
2019-12-13 09:59:45 +01:00
Christian Brabandt
e395afed51 vista: init extension on VimEnter
closes #2009
2019-12-13 08:56:26 +01:00
Christian Brabandt
30725e6eb2 Merge pull request #2010 from kazukazuinaina/add_gina_new_extension
add gina's some extensions
2019-12-13 08:45:36 +01:00
Christian Brabandt
9c3f84fc67 tabline: skip expansive BufAdd call on Session load
closes #2015
2019-12-13 08:44:15 +01:00
Christian Brabandt
758c83acbf tabline: simplify autocommand condition 2019-12-12 09:58:21 +01:00
Christian Brabandt
58b9b3ec81 netrw: do not error out when g:netrw_sort_by is not defined 2019-12-11 23:36:15 +01:00
Christian Brabandt
6ef37e4b3e Merge pull request #2012 from kazukazuinaina/update_vista_vim_url
update vista.vim's url in document
2019-12-10 16:15:49 +01:00
Christian Brabandt
c24f3c7c4d whitespace: do not detect '=======' as conflict marker for rst files
closes #2014
2019-12-10 16:14:08 +01:00
kazukazuinaina
f472e1bafb update vista.vim's url in document 2019-12-09 00:51:18 +09:00
kazukazuinaina
b1ca153b72 add gina's some extensions
add gina-ls
2019-12-06 17:26:08 +09:00
Christian Brabandt
2daef1bcb8 Merge pull request #2007 from kazukazuinaina/add_gina_branch
add :Gina branch command support
2019-12-02 10:10:05 +01:00
kazukazuinaina
806f071348 add :Gina branch command support 2019-12-02 11:54:38 +09:00
Christian Brabandt
ce932f3825 Revert "themes: drop simple colorscheme - theme mappings"
This reverts commit 47be64d7f2.

closes #2006
2019-11-29 08:27:13 +01:00
Christian Brabandt
47be64d7f2 themes: drop simple colorscheme - theme mappings
vim-airline by default already tries to load theme names, that have the
same name as the colorscheme. Therefore, it does not make sense, to add
mappings that result in the same theme name.

So drop the base16, wombat, zenburn and solarized keys
2019-11-27 13:52:21 +01:00
Christian Brabandt
81fdc3b988 plugin: make use of rand() function from vim 8.1.2342 2019-11-25 17:13:33 +01:00
Christian Brabandt
19c655b420 plugin: do not trigger redraws for popup windows
coc.nvim might set the filetype of the poppup window, which might
trigger a redraw of the statusline, causing the current window to become
inactive.

So bail out early, if the current buffer is a popup buffer. It cannot
have a statusline anyhow.

fixes #1930 (but this time for Vim)
2019-11-25 16:24:58 +01:00
Christian Brabandt
b9eb941201 Merge pull request #2002 from kazukazuinaina/update_gitignore
add .DS_Store in .gitignore
2019-11-21 17:48:24 +01:00
kazukazuinaina
6bc040a3a5 add .DS_Store in .gitignore 2019-11-20 12:21:42 +09:00
Christian Brabandt
29549aa55a Merge pull request #1997 from kazukazuinaina/fix_typo_NERDTree
substitute/NERDtree/NERDTree
2019-11-15 08:26:03 +01:00
kazukazuinaina
17ec87f503 substitute/NERDtree/NERDTree 2019-11-15 15:50:36 +09:00
Christian Brabandt
e3e2b1af44 Merge pull request #1996 from kazukazuinaina/update_NERDTree_statusline
update nerdtree's statusline
2019-11-13 22:33:01 +01:00
kazukazuinaina
8a3eeddc80 update nerdtree's statusline
add let g:airline#extensions#nerdtree_statusline's documentation
2019-11-11 21:11:36 +09:00
Christian Brabandt
e4e4ba3c7b Changelog: fix link to github 2019-11-10 16:49:29 +01:00
133 changed files with 4881 additions and 1916 deletions

View File

@@ -8,7 +8,10 @@
if you are using terminal:
- terminal: ????
- $TERM variable: ???
- terminal columns size: ???
- terminal line size: ???
- color configuration (:set t_Co?):
if you are using Neovim:
- does it happen in Vim: ???
@@ -19,3 +22,5 @@ if you are using Neovim:
#### expected behavior
????
#### screen shot (if possible)

45
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-20.04
strategy:
matrix:
vim:
- v9.1.0000
- v9.0.0000
- v8.2.1000
- v8.2.0000
- v8.1.0000
- v8.0.0000
- v7.4
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Checkout vim-themis
uses: actions/checkout@main
with:
repository: thinca/vim-themis
path: vim-themis
- name: Setup Vim
uses: rhysd/action-setup-vim@v1
id: vim
with:
version: ${{ matrix.vim }}
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis --reporter spec

22
.github/workflows/reviewdog.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: reviewdog
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
vint:
name: runner / vint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: vint
uses: reviewdog/action-vint@v1
with:
github_token: ${{ secrets.github_token }}
level: error
reporter: github-pr-check

4
.gitignore vendored
View File

@@ -1,4 +1,8 @@
.DS_Store
doc/tags
*.lock
.vim-flavor
*.swp
.bundle
vendor
test/.deps

View File

@@ -1,8 +0,0 @@
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

View File

@@ -3,6 +3,32 @@
This is the Changelog for the vim-airline project.
## [0.12] - Unreleased
- New features
- Extensions:
- [poetv](https://github.com/petobens/poet-v) support
- [vim-lsp](https://github.com/prabirshrestha/vim-lsp) support
- [zoomwintab](https://github.com/troydm/zoomwintab.vim) support
- [Vaffle](https://github.com/cocopon/vaffle.vim) support
- [vim-dirvish](https://github.com/justinmk/vim-dirvish) support
- [fzf.vim](https://github.com/junegunn/fzf.vim) support
- [OmniSharp](https://github.com/OmniSharp/omnisharp-vim) support
- [searchcount](https://vim-jp.org/vimdoc-en/eval.html#searchcount()) support
- [fern.vim](https://github.com/lambdalisue/fern.vim) support
- [Vim-CMake](https://github.com/cdelledonne/vim-cmake) support
- [battery.vim](https://github.com/lambdalisue/battery.vim) support
- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) support
- [gen_tags.vim](https://github.com/jsfaint/gen_tags.vim) support
- Ascii Scrollbar support
- Improvements
- git branch can also be displayed using [gina.vim](https://github.com/lambdalisue/gina.vim)
- coc extensions can also show additional status messages as well as the current function
- [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension
- rewrote parts using Vim9 Script for performance improvements
- Other
- Changed CI from travis-ci.org to GitHub Actions
- Introduce Vim script static analysis using [reviewdog](https://github.com/reviewdog/action-vint)
- Added multiple Vim versions to unit tests using Travis CI
- Added option to show short paths in the status line
## [0.11] - 2019-11-10
- New features
@@ -23,9 +49,9 @@ This is the Changelog for the vim-airline project.
- The branch extensions now also displays whether the repository is in a clean state
(will append a ! or ⚡if the repository is considered dirty).
- The whitespace extensions will also check for conflict markers
- `:AirlineRefresh` command now takes an additional `!` attribute, that **skips**
- `:AirlineRefresh` command now takes an additional `!` attribute, that **skips**
recreating the highlighting groups (which might have a serious performance
impact if done very often, as might be the case when the configuration variable
impact if done very often, as might be the case when the configuration variable
`airline_skip_empty_sections` is active).
- airline can now also detect multiple cursor mode (issue [#1933](https://github.com/vim-airline/vim-airline/issues/1933))
- expose hunks output using the function `airline#extensions#hunks#get_raw_hunks()` to the outside [#1877](https://github.com/vim-airline/vim-airline/pull/1877)
@@ -123,7 +149,7 @@ This is the Changelog for the vim-airline project.
- [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)
- [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe)
- [po.vim](http://www.vim.org/scripts/script.php?script_id=695)
- [unicode.vim](https://github.com/chrisbra/unicode.vim)
- wordcount
@@ -212,7 +238,7 @@ This is the Changelog for the vim-airline project.
- support for themes: 8 included
[0.12]: https://github.com/vim-airline/vim-airline/compare/v0.11...HEAD
[0.11]: https://github.com/vim-airline/vim-airline/compare/v0.10...v.11
[0.11]: https://github.com/vim-airline/vim-airline/compare/v0.10...v0.11
[0.10]: https://github.com/vim-airline/vim-airline/compare/v0.9...v0.10
[0.9]: https://github.com/vim-airline/vim-airline/compare/v0.8...v0.9
[0.8]: https://github.com/vim-airline/vim-airline/compare/v0.7...v0.8

View File

@@ -4,17 +4,32 @@ Contributions and pull requests are welcome. Please take note of the following
* 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.
* Any changes to the core should be tested against Vim 7.4.
# Testing
Contributors should install [thinca/vim-themis](https://github.com/thinca/vim-themis) to run tests before sending a PR if they applied some modification to the code. PRs which do not pass tests won't be accepted.
## 1. Installation
```
$ cd /path/to/vim-airline
$ git submodule add https://github.com/thinca/vim-themis ./.themis-bin
```
## 2. Running tests
```
$ ./path/to/themis-bin/bin/themis path/to/vim-airline/test --reporter spec
```
# 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
* 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
@@ -26,7 +41,5 @@ Tracking down bugs can take a very long time due to different configurations, ve
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

View File

@@ -1,2 +0,0 @@
source 'https://rubygems.org'
gem 'vim-flavor', '~> 1.1'

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (C) 2013-2019 Bailey Ling, Christian Brabandt, et al.
Copyright (C) 2013-2021 Bailey Ling, Christian Brabandt, et al.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),

View File

@@ -1,11 +1,15 @@
# vim-airline [![Build Status](https://travis-ci.org/vim-airline/vim-airline.png)](https://travis-ci.org/vim-airline/vim-airline)[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/chrisbra)
# vim-airline
Lean &amp; mean status/tabline for vim that's light as air.
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/chrisbra)
[![reviewdog](https://github.com/vim-airline/vim-airline/workflows/reviewdog/badge.svg?branch=master&event=push)](https://github.com/vim-airline/vim-airline/actions?query=workflow%3Areviewdog+event%3Apush+branch%3Amaster)
[![CI](https://github.com/vim-airline/vim-airline/workflows/CI/badge.svg)](https://github.com/vim-airline/vim-airline/actions?query=workflow%3ACI)
Lean & mean status/tabline for vim that's light as air.
![img](https://github.com/vim-airline/vim-airline/wiki/screenshots/demo.gif)
When the plugin is correctly loaded, Vim will draw a nice statusline at the
bottom of each window.
When the plugin is correctly loaded, there will be a nice statusline at the
bottom of each vim window.
That line consists of several sections, each one displaying some piece of
information. By default (without configuration) this line will look like this:
@@ -16,7 +20,7 @@ information. By default (without configuration) this line will look like this:
|~ |
|~ VIM - Vi IMproved |
|~ |
|~ version 8.0 |
|~ version 8.2 |
|~ by Bram Moolenaar et al. |
|~ Vim is open source and freely distributable |
|~ |
@@ -36,7 +40,7 @@ The statusline is the colored line at the bottom, which contains the sections
section|meaning (example)
-------|------------------
A | displays the mode + additional flags like crypt/spell/paste (INSERT)
B | VCS information (branch, hunk summary) (master)
B | Environment status (VCS information - branch, hunk summary (master), [battery][61] level)
C | filename + read-only flag (~/.vim/vimrc RO)
X | filetype (vim)
Y | file encoding[fileformat] (utf-8[unix])
@@ -62,19 +66,36 @@ For a better look, those sections can be colored differently, depending on vario
* 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],
[fugitive][4], [flog][62], [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.
[ctrlspace][38], [vim-bufmru][47], [vimagit][50], [denite][51],
[vim.battery][61] and more.
* 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.
* Optimized for speed - 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.
Note these are now external to this plugin. More details can be found in the [themes repository][46].
* 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.
# Installation
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][55] | `call minpac#add('vim-airline/vim-airline')` |
| 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 ~/.vim/pack/dist/start/vim-airline/doc` to generate help tags |
| manual | copy all of the files into your `~/.vim` directory |
## Straightforward customization
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.
@@ -93,7 +114,7 @@ Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
```
See https://github.com/vim-airline/vim-airline-themes for more.
See [vim-airline-themes][46] for more.
## Automatic truncation
@@ -158,12 +179,15 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
#### [syntastic][5]
![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png)
#### hunks ([vim-gitgutter][29] & [vim-signify][30])
#### hunks ([vim-gitgutter][29], [vim-signify][30], [coc-git][59] & [gitsigns.nvim][63])
![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png)
#### [vimagit][50]
![vim-airline-vimagit-demo](https://cloud.githubusercontent.com/assets/533068/22107273/2ea85ba0-de4d-11e6-9fa8-331103b88df4.gif)
#### [flog][62]
![vim-flog-airline-demo](https://user-images.githubusercontent.com/5008897/120819897-4e820280-c554-11eb-963e-6c08a1bbae09.png)
#### [virtualenv][31]
![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png)
@@ -188,6 +212,12 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
#### [LanguageClient][57]
![image](https://user-images.githubusercontent.com/9622/45275524-52f45c00-b48b-11e8-8b83-a66240b10747.gif)
#### [Vim-CMake][60]
![image](https://user-images.githubusercontent.com/24732205/87788512-c876a380-c83d-11ea-9ee3-5f639f986a8f.png)
#### [vim.battery][61]
![image](https://user-images.githubusercontent.com/1969470/94561399-368b0e00-0264-11eb-94a0-f6b67c73d422.png)
## Extras
vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also:
@@ -196,7 +226,7 @@ vim-airline also supplies some supplementary stand-alone extensions. In additio
![image](https://f.cloud.github.com/assets/306502/962401/2a75385e-04ef-11e3-935c-e3b9f0e954cc.png)
### statusline on top
The statusline can alternatively by drawn on top, making room for other plugins to use the statusline:
The statusline can alternatively be drawn on top, making room for other plugins to use the statusline:
The example shows a custom statusline setting, that imitates Vims default statusline, while allowing
to call custom functions. Use `:let g:airline_statusline_ontop=1` to enable it.
@@ -234,22 +264,6 @@ What about [vim-powerline][1]?
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!
# Installation
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][55] | `call minpac#add('vim-airline/vim-airline')` |
| 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 |
| manual | copy all of the files into your `~/.vim` directory |
# Documentation
`:help airline`
@@ -266,7 +280,7 @@ Solutions to common problems can be found in the [Wiki][27].
# Performance
Whoa! Everything got slow all of a sudden...
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.
@@ -286,16 +300,16 @@ A full list of screenshots for various themes can be found in the [Wiki][14].
# Maintainers
The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44].
The project is currently being maintained by [Christian Brabandt][42] and [Bailey Ling][41].
If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43].
# License
[MIT License][58]. Copyright (c) 2013-2019 Bailey Ling & Contributors.
[MIT License][58]. Copyright (c) 2013-2021 Bailey Ling & Contributors.
[1]: https://github.com/Lokaltog/vim-powerline
[2]: https://github.com/Lokaltog/powerline
[2]: https://github.com/powerline/powerline
[3]: https://github.com/Lokaltog/powerline-fonts
[4]: https://github.com/tpope/vim-fugitive
[5]: https://github.com/scrooloose/syntastic
@@ -311,10 +325,10 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[15]: https://github.com/techlivezheng/vim-plugin-minibufexpl
[16]: https://github.com/sjl/gundo.vim
[17]: https://github.com/mbbill/undotree
[18]: https://github.com/scrooloose/nerdtree
[18]: https://github.com/preservim/nerdtree
[19]: https://github.com/majutsushi/tagbar
[20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium
[21]: https://github.com/ludovicchabant/vim-lawrencium
[22]: https://github.com/MarcWeber/vim-addon-manager
[23]: https://github.com/altercation/solarized
[24]: https://github.com/chriskempson/tomorrow-theme
@@ -337,9 +351,8 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[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
[46]: https://github.com/vim-airline/vim-airline-themes#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
@@ -352,3 +365,9 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[56]: https://github.com/vim-airline/vim-airline-themes/blob/master/autoload/airline/themes/dark_minimal.vim
[57]: https://github.com/autozimu/LanguageClient-neovim
[58]: https://github.com/vim-airline/vim-airline/blob/master/LICENSE
[59]: https://github.com/neoclide/coc-git
[60]: https://github.com/cdelledonne/vim-cmake
[61]: http://github.com/lambdalisue/battery.vim/
[62]: http://github.com/rbong/vim-flog/
[63]: https://github.com/lewis6991/gitsigns.nvim
[64]: https://github.com/VimfanTPdvorak/vimodoro

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env rake
task :default => [:test]
task :ci => [:dump, :test]
task :dump do
sh 'vim --version'
end
task :test do
sh 'bundle exec vim-flavor test'
end

View File

@@ -1,25 +1,35 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
let g:airline_inactive_funcrefs = get(g:, 'airline_inactive_statusline_funcrefs', [])
let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning']
let s:inactive_funcrefs = []
let s:contexts = {}
let s:core_funcrefs = [
\ function('airline#extensions#apply'),
\ function('airline#extensions#default#apply') ]
function! airline#add_statusline_func(name)
call airline#add_statusline_funcref(function(a:name))
function! airline#add_statusline_func(name, ...)
let warn = get(a:, 1, 1)
call airline#add_statusline_funcref(function(a:name), warn)
endfunction
function! airline#add_statusline_funcref(function)
function! airline#add_inactive_statusline_func(name, ...)
let warn = get(a:, 1, 1)
call airline#add_inactive_statusline_funcref(function(a:name), warn)
endfunction
function! airline#add_statusline_funcref(function, ...)
if index(g:airline_statusline_funcrefs, a:function) >= 0
call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
let warn = get(a:, 1, 1)
if warn > 0
call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
endif
return
endif
call add(g:airline_statusline_funcrefs, a:function)
@@ -32,8 +42,15 @@ function! airline#remove_statusline_func(name)
endif
endfunction
function! airline#add_inactive_statusline_func(name)
call add(s:inactive_funcrefs, function(a:name))
function! airline#add_inactive_statusline_funcref(function, ...)
if index(g:airline_inactive_funcrefs, a:function) >= 0
let warn = get(a:, 1, 1)
if warn > 0
call airline#util#warning(printf('The airline inactive statusline funcref "%s" has already been added.', string(a:function)))
endif
return
endif
call add(g:airline_inactive_funcrefs, a:function)
endfunction
function! airline#load_theme()
@@ -53,6 +70,8 @@ function! airline#load_theme()
call airline#highlighter#load_theme()
call airline#extensions#load_theme()
call airline#update_statusline()
call airline#util#doautocmd('AirlineAfterTheme')
endfunction
" Load an airline theme
@@ -93,8 +112,6 @@ function! airline#switch_theme(name, ...)
unlet! w:airline_lastmode
call airline#load_theme()
call airline#util#doautocmd('AirlineAfterTheme')
" this is required to prevent clobbering the startup info message, i don't know why...
call airline#check_mode(winnr())
endfunction
@@ -125,9 +142,10 @@ endfunction
" Update the statusline
function! airline#update_statusline()
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
if airline#util#stl_disabled(winnr()) || airline#util#is_popup_window(winnr())
return
endif
" TODO: need to ignore popup windows here as well?
let range = filter(range(1, winnr('$')), 'v:val != winnr()')
" create inactive statusline
call airline#update_statusline_inactive(range)
@@ -138,7 +156,12 @@ function! airline#update_statusline()
" Now create the active statusline
let w:airline_active = 1
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
try
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
catch /^Vim\%((\a\+)\)\=:E48:/
" Catch: Sandbox mode
" no-op
endtry
endfunction
" Function to be called to make all statuslines inactive
@@ -154,11 +177,11 @@ endfunction
" Function to draw inactive statuslines for inactive windows
function! airline#update_statusline_inactive(range)
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
if airline#util#stl_disabled(winnr())
return
endif
for nr in a:range
if airline#util#getwinvar(nr, 'airline_disabled', 0)
if airline#util#stl_disabled(nr)
continue
endif
call setwinvar(nr, 'airline_active', 0)
@@ -168,7 +191,12 @@ function! airline#update_statusline_inactive(range)
\ 'left_sep': g:airline_left_alt_sep,
\ 'right_sep': g:airline_right_alt_sep }, 'keep')
endif
call s:invoke_funcrefs(context, s:inactive_funcrefs)
try
call s:invoke_funcrefs(context, g:airline_inactive_funcrefs)
catch /^Vim\%((\a\+)\)\=:E48:/
" Catch: Sandbox mode
" no-op
endtry
endfor
endfunction
@@ -203,66 +231,66 @@ function! airline#check_mode(winnr)
let context = s:contexts[a:winnr]
if get(w:, 'airline_active', 1)
let l:m = mode(1)
if l:m ==# "i"
let l:mode = ['insert']
elseif l:m[0] ==# "i"
let l:mode = ['insert']
elseif l:m ==# "Rv"
let l:mode =['replace']
elseif l:m[0] ==# "R"
let l:mode = ['replace']
elseif l:m[0] =~# '\v(v|V||s|S|)'
let l:mode = ['visual']
elseif l:m ==# "t"
let l:mode = ['terminal']
elseif l:m[0] ==# "c"
let l:mode = ['commandline']
elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
let l:mode = ['normal']
elseif l:m[0:1] ==# 'ni'
let l:mode = ['normal']
let l:m = 'ni'
let m = mode(1)
" Refer :help mode() to see the list of modes
" NB: 'let mode' here refers to the display colour _groups_,
" not the literal mode's code (i.e., m). E.g., Select modes
" v, S and ^V use 'visual' since they are of similar ilk.
" Some modes do not get recognised for status line purposes:
" no, nov, noV, no^V, !, cv, and ce.
" Mode name displayed is handled in init.vim (g:airline_mode_map).
"
if m[0] ==# "i"
let mode = ['insert'] " Insert modes + submodes (i, ic, ix)
elseif m[0] == "R"
let mode = ['replace'] " Replace modes + submodes (R, Rc, Rv, Rx) (NB: case sensitive as 'r' is a mode)
elseif m[0] =~ '\v(v|V||s|S|)'
let mode = ['visual'] " Visual and Select modes (v, V, ^V, s, S, ^S))
elseif m ==# "t"
let mode = ['terminal'] " Terminal mode (only has one mode (t))
elseif m[0] =~ '\v(c|r|!)'
let mode = ['commandline'] " c, cv, ce, r, rm, r? (NB: cv and ce stay showing as mode entered from)
else
let l:mode = ['normal']
let mode = ['normal'] " Normal mode + submodes (n, niI, niR, niV; plus operator pendings no, nov, noV, no^V)
endif
if exists("*VMInfos") && !empty(VMInfos())
" Vim plugin Multiple Cursors https://github.com/mg979/vim-visual-multi
let l:m = 'multi'
let m = 'multi'
endif
if index(['Rv', 'no', 'ni', 'ix', 'ic', 'multi'], l:m) == -1
let l:m = l:m[0]
" Adjust to handle additional modes, which don't display correctly otherwise
if index(['niI', 'niR', 'niV', 'ic', 'ix', 'Rc', 'Rv', 'Rx', 'multi'], m) == -1
let m = m[0]
endif
let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
let w:airline_current_mode = get(g:airline_mode_map, m, m)
else
let l:mode = ['inactive']
let mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__')
endif
if g:airline_detect_modified && &modified
call add(l:mode, 'modified')
call add(mode, 'modified')
endif
if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
call add(mode, 'paste')
endif
if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(l:mode, 'crypt')
call add(mode, 'crypt')
endif
if g:airline_detect_spell && &spell
call add(l:mode, 'spell')
call add(mode, 'spell')
endif
if &readonly || ! &modifiable
call add(l:mode, 'readonly')
call add(mode, 'readonly')
endif
let mode_string = join(l:mode)
let mode_string = join(mode)
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(mode, string(context.bufnr))
call airline#util#doautocmd('AirlineModeChanged')
let w:airline_lastmode = mode_string
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Christian Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -131,10 +131,10 @@ if v:version >= 800 && has("job")
endfunction
function! airline#async#get_mq_async(cmd, file)
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
let cmd = [&shell, &shellcmdflag, a:cmd]
endif
let options = {'cmd': a:cmd, 'buf': '', 'file': a:file}
@@ -153,9 +153,12 @@ if v:version >= 800 && has("job")
endfunction
function! airline#async#get_msgfmt_stat(cmd, file)
if g:airline#init#is_windows || !executable('msgfmt')
" no msgfmt on windows?
if !executable('msgfmt')
" no msgfmt
return
endif
if g:airline#init#is_windows
let cmd = 'cmd /C ' . a:cmd. shellescape(a:file)
else
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
endif
@@ -176,10 +179,10 @@ if v:version >= 800 && has("job")
endfunction
function! airline#async#vim_vcs_clean(cmd, file, vcs)
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
let cmd = [&shell, &shellcmdflag, a:cmd]
endif
let options = {'buf': '', 'vcs': a:vcs, 'file': a:file}
@@ -202,10 +205,10 @@ if v:version >= 800 && has("job")
endfunction
function! airline#async#vim_vcs_untracked(config, file)
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:config['cmd'] . shellescape(a:file)
else
let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)]
let cmd = [&shell, &shellcmdflag, a:config['cmd'] . shellescape(a:file)]
endif
let options = {'cfg': a:config, 'buf': '', 'file': a:file}
@@ -263,10 +266,10 @@ elseif has("nvim")
\ 'on_stderr': function('s:nvim_output_handler'),
\ 'on_exit': function('s:nvim_mq_job_handler')
\ }
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
let cmd = [&shell, &shellcmdflag, a:cmd]
endif
if has_key(s:mq_jobs, a:file)
@@ -285,11 +288,11 @@ elseif has("nvim")
\ 'on_stderr': function('s:nvim_output_handler'),
\ 'on_exit': function('s:nvim_po_job_handler')
\ }
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
" no msgfmt on windows?
return
else
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
let cmd = [&shell, &shellcmdflag, a:cmd. shellescape(a:file)]
endif
if has_key(s:po_jobs, a:file)
@@ -308,10 +311,10 @@ elseif has("nvim")
\ 'on_stdout': function('s:nvim_output_handler'),
\ 'on_stderr': function('s:nvim_output_handler'),
\ 'on_exit': function('s:on_exit_clean')}
if g:airline#init#is_windows && &shell =~ 'cmd'
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
let cmd = [&shell, &shellcmdflag, a:cmd]
endif
if !has_key(s:clean_jobs, a:vcs)
@@ -369,6 +372,8 @@ function! airline#async#vim7_vcs_clean(cmd, file, vcs)
" don't want to to see error messages
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:cmd .' 2>nul'
elseif g:airline#init#is_windows && &shell =~ 'powerline'
let cmd = a:cmd .' 2> $null'
else
let cmd = a:cmd .' 2>/dev/null'
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -90,7 +90,7 @@ function! s:prototype.build() dict
" 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
" separator goes from the previous previous group
" to the current group
let pgroup = group
endif
@@ -106,12 +106,12 @@ function! s:prototype.build() dict
let line .= '%#'.group.'#'
elseif split
if !is_empty
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
let line .= s:get_transitioned_separator(self, prev_group, group, side)
endif
let split = 0
else
if !is_empty
let line .= s:get_seperator(self, prev_group, group, side)
let line .= s:get_separator(self, prev_group, group, side)
endif
endif
let line .= is_empty ? '' : s:get_accented_line(self, group, contents)
@@ -133,14 +133,11 @@ function! airline#builder#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'
return color1[1] != color2[1] || color1[0] != color2[0]
else
return color1[3] != color2[3] || color1[2] != color2[2]
endif
return color1[1] != color2[1] || color1[0] != color2[0]
\ || color1[2] != color2[2] || color1[3] != color2[3]
endfunction
function! s:get_transitioned_seperator(self, prev_group, group, side)
function! s:get_transitioned_separator(self, prev_group, group, side)
let line = ''
if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side
call airline#highlighter#add_separator(a:prev_group, a:group, 0)
@@ -155,9 +152,9 @@ function! s:get_transitioned_seperator(self, prev_group, group, side)
return line
endfunction
function! s:get_seperator(self, prev_group, group, side)
function! s:get_separator(self, prev_group, group, side)
if airline#builder#should_change_group(a:prev_group, a:group)
return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side)
return s:get_transitioned_separator(a:self, a:prev_group, a:group, a:side)
else
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep
endif
@@ -201,20 +198,27 @@ function! s:section_is_empty(self, content)
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)
" special case: When the content is %=, that is the
" separation marker, which switches between left- and
" right-aligned content.
" Consider that to be empty, so that the previous previous
" group is correctly remembered in the builder() function
if empty(a:content) || a:content is# '%='
return 1
endif
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
if empty(list)
return 0 " no function in statusline text
let stripped = substitute(a:content,
\ '\(%{.*}\|%#__accent_[^#]*#\|%#__restore__#\|%( \| %)\)', '', 'g')
if !empty(stripped)
return 0 " There is content in the statusline
endif
while len(list) > 0
let expr = list[0]
let exprlist = []
call substitute(a:content, '%{\([^}]*\)}', '\=add(exprlist, submatch(1))', 'g')
for expr in exprlist
try
" catch all exceptions, just in case
if !empty(eval(expr))
@@ -223,9 +227,7 @@ function! s:section_is_empty(self, content)
catch
return 0
endtry
let start += 1
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
endw
endfor
return 1
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -23,24 +23,24 @@ endfunction
let s:script_path = tolower(resolve(expand('<sfile>:p:h')))
let s:filetype_overrides = {
\ 'coc-explorer': [ 'CoC Explorer', '' ],
\ 'defx': ['defx', '%{b:defx.paths[0]}'],
\ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'],
\ 'floggraph': [ 'Flog', '%{get(b:, "flog_status_summary", "")}' ],
\ 'gundo': [ 'Gundo', '' ],
\ 'help': [ 'Help', '%f' ],
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
\ 'nerdtree': [ get(g:, 'NERDTreeStatusline', 'NERD'), '' ],
\ 'startify': [ 'startify', '' ],
\ 'vim-plug': [ 'Plugins', '' ],
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
\ 'vimshell': ['vimshell','%{vimshell#get_status_string()}'],
\ 'vaffle' : [ 'Vaffle', '%{b:vaffle.dir}' ],
\ }
if exists(':Gina') && (v:version > 704 || (v:version == 704 && has("patch1898")))
" Gina needs the Vim 7.4.1898, which introduce the <mods> flag for custom commands
let s:filetype_overrides['gina-status'] = ['gina', '%{gina#component#repo#preset()}' ]
let s:filetype_overrides['diff'] = ['gina', '%{gina#component#repo#preset()}' ]
let s:filetype_overrides['gina-log'] = ['gina', '%{gina#component#repo#preset()}' ]
let s:filetype_overrides['gina-tag'] = ['gina', '%{gina#component#repo#preset()}' ]
if get(g:, 'airline#extensions#nerdtree_statusline', 1)
let s:filetype_overrides['nerdtree'] = [ get(g:, 'NERDTreeStatusline', 'NERD'), '' ]
else
let s:filetype_overrides['nerdtree'] = ['NERDTree', '']
endif
let s:filetype_regex_overrides = {}
@@ -82,7 +82,7 @@ function! airline#extensions#apply(...)
let w:airline_section_y = ''
endif
if &previewwindow
if &previewwindow && empty(get(w:, 'airline_section_a', ''))
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
@@ -142,7 +142,9 @@ function! airline#extensions#load()
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!")
continue
endtry
call add(s:loaded_ext, ext)
endfor
return
endif
@@ -150,28 +152,50 @@ function! airline#extensions#load()
call airline#extensions#quickfix#init(s:ext)
call add(s:loaded_ext, 'quickfix')
if get(g:, 'loaded_unite', 0)
if get(g:, 'loaded_unite', 0) && get(g:, 'airline#extensions#unite#enabled', 1)
call airline#extensions#unite#init(s:ext)
call add(s:loaded_ext, 'unite')
endif
if get(g:, 'loaded_denite', 0)
if get(g:, 'loaded_denite', 0) && get(g:, 'airline#extensions#denite#enabled', 1)
call airline#extensions#denite#init(s:ext)
call add(s:loaded_ext, 'denite')
endif
if get(g:, 'loaded_gina', 0) && get(g:, 'airline#extensions#gina#enabled', 1)
call airline#extensions#gina#init(s:ext)
call add(s:loaded_ext, 'gina')
endif
if get(g:, 'loaded_fern', 0) && get(g:, 'airline#extensions#fern#enabled', 1)
call airline#extensions#fern#init(s:ext)
call add(s:loaded_ext, 'fern')
endif
if exists(':NetrwSettings')
call airline#extensions#netrw#init(s:ext)
call add(s:loaded_ext, 'netrw')
endif
" fzf buffers are also terminal buffers, so this must be above term.
if exists(':FZF') && get(g:, 'airline#extensions#fzf#enabled', 1)
call airline#extensions#fzf#init(s:ext)
call add(s:loaded_ext, 'fzf')
endif
" Vim-CMake buffers are also terminal buffers, so this must be above term.
if get(g:, 'loaded_cmake', 0) && get(g:, 'airline#extensions#vimcmake#enabled', 1)
call airline#extensions#vimcmake#init(s:ext)
call add(s:loaded_ext, 'vimcmake')
endif
if (has("terminal") || has('nvim')) &&
\ get(g:, 'airline#extensions#term#enabled', 1)
call airline#extensions#term#init(s:ext)
call add(s:loaded_ext, 'term')
endif
if get(g:, 'airline#extensions#ycm#enabled', 0)
if get(g:, 'airline#extensions#ycm#enabled', 0) && exists('g:loaded_youcompleteme')
call airline#extensions#ycm#init(s:ext)
call add(s:loaded_ext, 'ycm')
endif
@@ -205,8 +229,18 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'undotree')
endif
if exists(':RTM')
call airline#extensions#vimodoro#init(s:ext)
call add(s:loaded_ext, 'vimodoro')
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'))
\ && (exists('g:loaded_signify')
\ || exists('g:loaded_gitgutter')
\ || exists('g:loaded_changes')
\ || exists('g:loaded_quickfixsigns')
\ || exists(':Gitsigns')
\ || exists(':CocCommand'))
call airline#extensions#hunks#init(s:ext)
call add(s:loaded_ext, 'hunks')
endif
@@ -222,8 +256,13 @@ function! airline#extensions#load()
call airline#extensions#tagbar#init(s:ext)
call add(s:loaded_ext, 'tagbar')
endif
if get(g:, 'airline#extensions#taglist#enabled', 1) && exists(':TlistShowTag')
call airline#extensions#taglist#init(s:ext)
call add(s:loaded_ext, 'taglist')
endif
if get(g:, 'airline#extensions#vista#enabled', 1)
\ && exists(':Vista')
call airline#extensions#vista#init(s:ext)
call add(s:loaded_ext, 'vista')
endif
@@ -234,18 +273,29 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'bookmark')
endif
if get(g:, 'airline#extensions#scrollbar#enabled', 0)
call airline#extensions#scrollbar#init(s:ext)
call add(s:loaded_ext, 'scrollbar')
endif
if get(g:, 'airline#extensions#csv#enabled', 1)
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
call airline#extensions#csv#init(s:ext)
call add(s:loaded_ext, 'csv')
endif
if get(g:, 'airline#extensions#zoomwintab#enabled', 0)
call airline#extensions#zoomwintab#init(s:ext)
call add(s:loaded_ext, 'zoomwintab')
endif
if exists(':VimShell')
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
endif
if get(g:, 'airline#extensions#branch#enabled', 1) && (
\ airline#util#has_fugitive() ||
\ airline#util#has_gina() ||
\ airline#util#has_lawrencium() ||
\ airline#util#has_vcscommand() ||
\ airline#util#has_custom_scm())
@@ -266,9 +316,20 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'fugitiveline')
endif
if (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList') || isdirectory($VIRTUAL_ENV)))
" NOTE: This means that if both virtualenv and poetv are enabled and
" available, poetv silently takes precedence and the virtualenv
" extension won't be initialized. Since both extensions currently just
" add a virtualenv identifier section to the airline, this seems
" acceptable.
if (get(g:, 'airline#extensions#poetv#enabled', 0) && (exists(':PoetvActivate')))
call airline#extensions#poetv#init(s:ext)
call add(s:loaded_ext, 'poetv')
elseif (get(g:, 'airline#extensions#virtualenv#enabled', 0) && (exists(':VirtualEnvList')))
call airline#extensions#virtualenv#init(s:ext)
call add(s:loaded_ext, 'virtualenv')
elseif (get(g:, 'airline#extensions#poetv#enabled', 0) && (isdirectory($VIRTUAL_ENV)))
call airline#extensions#poetv#init(s:ext)
call add(s:loaded_ext, 'poetv')
endif
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
@@ -287,6 +348,18 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'ale')
endif
if (get(g:, 'airline#extensions#lsp#enabled', 1) && exists(':LspDeclaration'))
call airline#extensions#lsp#init(s:ext)
call add(s:loaded_ext, 'lsp')
endif
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && has('nvim')
\ && luaeval('vim.lsp ~= nil'))
call airline#extensions#nvimlsp#init(s:ext)
call add(s:loaded_ext, 'nvimlsp')
endif
if (get(g:, 'airline#extensions#coc#enabled', 1) && exists(':CocCommand'))
call airline#extensions#coc#init(s:ext)
call add(s:loaded_ext, 'coc')
@@ -332,7 +405,7 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'promptline')
endif
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && get(g:, 'loaded_nrrw_rgn', 0)
call airline#extensions#nrrwrgn#init(s:ext)
call add(s:loaded_ext, 'nrrwrgn')
endif
@@ -347,17 +420,27 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'capslock')
endif
if (get(g:, 'airline#extensions#codeium#enabled', 1) && get(g:, 'loaded_codeium', 0))
call airline#extensions#codeium#init(s:ext)
call add(s:loaded_ext, 'codeium')
endif
if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0))
call airline#extensions#gutentags#init(s:ext)
call add(s:loaded_ext, 'gutentags')
endif
if get(g:, 'airline#extensions#gen_tags#enabled', 1) && (get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0))
call airline#extensions#gen_tags#init(s:ext)
call add(s:loaded_ext, 'gen_tags')
endif
if (get(g:, 'airline#extensions#grepper#enabled', 1) && get(g:, 'loaded_grepper', 0))
call airline#extensions#grepper#init(s:ext)
call add(s:loaded_ext, 'grepper')
endif
if (get(g:, 'airline#extensions#xkblayout#enabled', 1) && exists('g:XkbSwitchLib'))
if get(g:, 'airline#extensions#xkblayout#enabled', 1) && (exists('g:XkbSwitchLib') || exists('*FcitxCurrentIM') || has('nvim'))
call airline#extensions#xkblayout#init(s:ext)
call add(s:loaded_ext, 'xkblayout')
endif
@@ -390,17 +473,32 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'cursormode')
endif
if get(g:, 'airline#extensions#searchcount#enabled', 1) && exists('*searchcount')
call airline#extensions#searchcount#init(s:ext)
call add(s:loaded_ext, 'searchcount')
endif
if get(g:, 'loaded_battery', 0) && get(g:, 'airline#extensions#battery#enabled', 0)
call airline#extensions#battery#init(s:ext)
call add(s:loaded_ext, 'battery')
endif
if (get(g:, 'airline#extensions#vim9lsp#enabled', 1) && exists('*lsp#lsp#ErrorCount'))
call airline#extensions#vim9lsp#init(s:ext)
call add(s:loaded_ext, 'vim9lsp')
endif
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path).
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
for file in split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n")
" we have to check both resolved and unresolved paths, since it's possible
" that they might not get resolved properly (see #187)
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(s:loaded_ext, name) > -1
\ index(s:loaded_ext, name.'*') > -1
continue
endif
try
@@ -412,6 +510,22 @@ function! airline#extensions#load()
endif
endfor
endif
if exists(':Dirvish') && get(g:, 'airline#extensions#dirvish#enabled', 1)
call airline#extensions#dirvish#init(s:ext)
call add(s:loaded_ext, 'dirvish')
endif
if (get(g:, 'airline#extensions#omnisharp#enabled', 1) && get(g:, 'OmniSharp_loaded', 0))
call airline#extensions#omnisharp#init(s:ext)
call add(s:loaded_ext, 'omnisharp')
endif
if (get(g:, 'airline#extensions#rufo#enabled', 0) && get(g:, 'rufo_loaded', 0))
call airline#extensions#rufo#init(s:ext)
call add(s:loaded_ext, 'rufo')
endif
endfunction
function! airline#extensions#get_loaded_extensions()

View File

@@ -1,9 +1,13 @@
" MIT License. Copyright (c) 2013-2019 Bjorn Neergaard, w0rp et al.
" MIT License. Copyright (c) 2013-2021 Bjorn Neergaard, w0rp et al.
" Plugin: https://github.com/dense-analysis/ale
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_ale_dont_use_this_in_other_plugins_please', 0)
finish
endif
function! s:airline_ale_count(cnt, symbol)
return a:cnt ? a:symbol. a:cnt : ''
endfunction
@@ -124,6 +128,10 @@ function! airline#extensions#ale#init(ext)
endfunction
function! s:ale_refresh()
if !exists('#airline')
" airline disabled
return
endif
if get(g:, 'airline_skip_empty_sections', 0)
exe ':AirlineRefresh!'
endif

View File

@@ -0,0 +1,23 @@
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/lambdalisue/battery.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists('g:loaded_battery')
finish
endif
function! airline#extensions#battery#status(...) abort
if !exists('g:battery#update_statusline')
let g:battery#update_statusline = 1
call battery#update()
endif
let bat = battery#component()
return bat
endfunction
function! airline#extensions#battery#init(ext) abort
call airline#parts#define_function('battery', 'airline#extensions#battery#status')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2019 Bjoern Petri <bjoern.petri@sundevil.de>
" MIT License. Copyright (c) 2021 Bjoern Petri <bjoern.petri@sundevil.de>
" Plugin: https://github.com/MattesGroeger/vim-bookmarks
" vim: et ts=2 sts=2 sw=2
@@ -8,23 +8,23 @@ if !exists(':BookmarkToggle')
finish
endif
function! airline#extensions#bookmark#currentbookmark()
function! airline#extensions#bookmark#currentbookmark() abort
if get(w:, 'airline_active', 0)
let file = expand("%:p")
if file ==# ""
return
endif
let file = expand('%:p')
if file ==# ''
return
endif
let current_line = line('.')
let has_bm = bm#has_bookmark_at_line(file, current_line)
let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
let annotation = has_bm ? bm['annotation'] : ""
let current_line = line('.')
let has_bm = bm#has_bookmark_at_line(file, current_line)
let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
let annotation = has_bm ? bm['annotation'] : ''
return annotation
endif
return annotation
endif
return ''
endfunction
function! airline#extensions#bookmark#init(ext)
function! airline#extensions#bookmark#init(ext) abort
call airline#parts#define_function('bookmark', 'airline#extensions#bookmark#currentbookmark')
endfunction

View File

@@ -1,5 +1,5 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" Plugin: fugitive, lawrencium and vcscommand
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: fugitive, gina, lawrencium and vcscommand
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -17,8 +17,8 @@ scriptencoding utf-8
let s:vcs_config = {
\ 'git': {
\ 'exe': 'git',
\ 'cmd': 'git status --porcelain -- ',
\ 'dirty': 'git status -uno --porcelain --ignore-submodules',
\ 'cmd': 'git --no-optional-locks status --porcelain -- ',
\ 'dirty': 'git --no-optional-locks status -uno --porcelain --ignore-submodules',
\ 'untracked_mark': '??',
\ 'exclude': '\.git',
\ 'update_branch': 's:update_git_branch',
@@ -85,13 +85,32 @@ let s:names = {'0': 'index', '1': 'orig', '2':'fetch', '3':'merge'}
let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7)
function! s:update_git_branch()
if !airline#util#has_fugitive()
call airline#util#ignore_next_focusgain()
if airline#util#has_fugitive()
call s:config_fugitive_branch()
elseif airline#util#has_gina()
call s:config_gina_branch()
else
let s:vcs_config['git'].branch = ''
return
endif
endfunction
let s:vcs_config['git'].branch = exists("*FugitiveHead") ?
\ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
function! s:config_fugitive_branch() abort
let s:vcs_config['git'].branch = FugitiveHead(s:sha1size)
if s:vcs_config['git'].branch is# 'master' &&
\ airline#util#winwidth() < 81
" Shorten default a bit
let s:vcs_config['git'].branch='mas'
endif
endfunction
function! s:config_gina_branch() abort
try
let g:gina#component#repo#commit_length = s:sha1size
let s:vcs_config['git'].branch = gina#component#repo#branch()
catch
endtry
if s:vcs_config['git'].branch is# 'master' &&
\ airline#util#winwidth() < 81
" Shorten default a bit
@@ -107,8 +126,15 @@ function! s:display_git_branch()
if has_key(s:names, commit)
let name = get(s:names, commit)."(".name.")"
elseif !empty(commit)
let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit)
if ref !~ "^fatal: no tag exactly matches"
if exists('*FugitiveExecute')
let ref = FugitiveExecute(['describe', '--all', '--exact-match', commit], bufnr('')).stdout[0]
else
noautocmd let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit)
if ref =~# ':'
let ref = ''
endif
endif
if !empty(ref)
let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")"
else
let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")"
@@ -116,7 +142,6 @@ function! s:display_git_branch()
endif
catch
endtry
return name
endfunction
@@ -200,7 +225,7 @@ function! s:update_untracked()
for vcs in keys(s:vcs_config)
" only check, for git, if fugitive is installed
" and for 'hg' if lawrencium is installed, else skip
if vcs is# 'git' && !airline#util#has_fugitive()
if vcs is# 'git' && (!airline#util#has_fugitive() && !airline#util#has_gina())
continue
elseif vcs is# 'mercurial' && !airline#util#has_lawrencium()
continue
@@ -303,6 +328,10 @@ endfunction
function! s:reset_untracked_cache(shellcmdpost)
" shellcmdpost - whether function was called as a result of ShellCmdPost hook
if !exists('#airline')
" airline disabled
return
endif
if !g:airline#init#vim_async && !has('nvim')
if a:shellcmdpost
" Clear cache only if there was no error or the script uses an
@@ -324,11 +353,17 @@ function! s:reset_untracked_cache(shellcmdpost)
endfor
endfunction
function! s:sh_autocmd_handler()
if exists('#airline')
unlet! b:airline_head b:airline_do_mq_check
endif
endfunction
function! airline#extensions#branch#init(ext)
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
autocmd ShellCmdPost,CmdwinLeave * unlet! b:airline_head b:airline_do_mq_check
autocmd User AirlineBeforeRefresh unlet! b:airline_head b:airline_do_mq_check
autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler()
autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler()
autocmd BufWritePost * call s:reset_untracked_cache(0)
autocmd ShellCmdPost * call s:reset_untracked_cache(1)
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/bling/vim-bufferline
" vim: et ts=2 sts=2 sw=2
@@ -20,7 +20,7 @@ function! airline#extensions#bufferline#init(ext)
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
" if 'acd' is set, vim-airline uses the path section, so we need to 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())

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al.
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/tpope/vim-capslock
" vim: et ts=2 sts=2 sw=2
@@ -9,7 +9,7 @@ if !exists('*CapsLockStatusline')
endif
function! airline#extensions#capslock#status()
return tolower(CapsLockStatusline()) == '[caps]' ? 'CAPS' : ''
return tolower(CapsLockStatusline()) ==# '[caps]' ? get(g:, 'airline#extensions#capslock#symbol', 'CAPS') : ''
endfunction
function! airline#extensions#capslock#init(ext)

View File

@@ -1,48 +1,54 @@
" MIT License. Copyright (c) 2019 Peng Guanwen et al.
" MIT License. Copyright (c) 2019-2021 Peng Guanwen et al.
" vim: et ts=2 sts=2 sw=2
" Plugin: https://github.com/neoclide/coc
scriptencoding utf-8
let s:error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:')
let s:warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:')
let s:show_coc_status = get(g:, 'airline#extensions#coc#show_coc_status', 1)
function! airline#extensions#coc#get_warning()
function! airline#extensions#coc#get_warning() abort
return airline#extensions#coc#get('warning')
endfunction
function! airline#extensions#coc#get_error()
function! airline#extensions#coc#get_error() abort
return airline#extensions#coc#get('error')
endfunction
function! airline#extensions#coc#get(type)
if !exists(":CocCommand")
return ''
endif
let _backup = get(g:, 'coc_stl_format', '')
function! airline#extensions#coc#get(type) abort
if !exists(':CocCommand') | return '' | endif
let is_err = (a:type is# 'error')
if is_err
let g:coc_stl_format = get(g:, 'airline#extensions#coc#stl_format_err', '%E{[%e(#%fe)]}')
else
let g:coc_stl_format = get(g:, 'airline#extensions#coc#stl_format_warn', '%W{[%w(#%fw)]}')
endif
let info = get(b:, 'coc_diagnostic_info', {})
if empty(info) | return '' | endif
let cnt = get(info, a:type, 0)
if !empty(_backup)
let g:coc_stl_format = _backup
endif
if empty(cnt) | return '' | endif
if empty(cnt)
return ''
else
return (is_err ? s:error_symbol : s:warning_symbol).cnt
endif
let error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:')
let warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:')
let error_format = get(g:, 'airline#extensions#coc#stl_format_err', '%C(L%L)')
let warning_format = get(g:, 'airline#extensions#coc#stl_format_warn', '%C(L%L)')
" replace %C with error count and %L with line number
return (is_err ? error_symbol : warning_symbol) .
\ substitute(substitute(is_err ? error_format : warning_format,
\ '%C', cnt, 'g'),
\ '%L', (info.lnums)[is_err ? 0 : 1], 'g')
endfunction
function! airline#extensions#coc#init(ext)
function! airline#extensions#coc#get_status() abort
" Shorten text for windows < 91 characters
let status = airline#util#shorten(get(g:, 'coc_status', ''), 91, 9)
return (s:show_coc_status ? status : '')
endfunction
function! airline#extensions#coc#get_current_function() abort
return get(b:, 'coc_current_function', '')
endfunction
function! airline#extensions#coc#init(ext) abort
call airline#parts#define_function('coc_error_count', 'airline#extensions#coc#get_error')
call airline#parts#define_function('coc_warning_count', 'airline#extensions#coc#get_warning')
call airline#parts#define_function('coc_status', 'airline#extensions#coc#get_status')
call airline#parts#define_function('coc_current_function', 'airline#extensions#coc#get_current_function')
endfunction

View File

@@ -0,0 +1,17 @@
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/Exafunction/codeium.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_codeium', 0)
finish
endif
function! airline#extensions#codeium#status() abort
return '{…}' . codeium#GetStatusString()
endfunction
function! airline#extensions#codeium#init(ext) abort
call airline#parts#define_function('codeium', 'airline#extensions#codeium#status')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/wincent/command-t
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/csv.vim
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/ctrlpvim/ctrlp.vim
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,21 +1,21 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/szw/vim-ctrlspace
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#ctrlspace#statusline(...)
function! airline#extensions#ctrlspace#statusline(...) abort
let spc = g:airline_symbols.space
let padding = spc . spc . spc
let l:padding = spc . spc . spc
let cs = ctrlspace#context#Configuration().Symbols.CS
let b = airline#builder#new({ 'active': 1 })
call b.add_section('airline_b', cs . padding . ctrlspace#api#StatuslineModeSegment(s:padding))
call b.add_section('airline_b', cs . l:padding . ctrlspace#api#StatuslineModeSegment(l:padding))
call b.split()
call b.add_section('airline_x', spc . ctrlspace#api#StatuslineTabSegment() . spc)
return b.build()
endfunction
function! airline#extensions#ctrlspace#init(ext)
function! airline#extensions#ctrlspace#init(ext) abort
let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"
endfunction

View File

@@ -5,6 +5,12 @@
scriptencoding utf-8
if exists('g:loaded_cursormode')
finish
endif
let g:loaded_cursormode = 1
let s:is_win = has('win32') || has('win64')
let s:is_iTerm = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'iTerm.app'
let s:is_AppleTerminal = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'Apple_Terminal'
@@ -101,6 +107,10 @@ augroup airline#extensions#cursormode
augroup END
function! airline#extensions#cursormode#activate()
if !exists('#airline')
" airline disabled
return
endif
let s:color_map = s:get_color_map()
call airline#extensions#cursormode#set()
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -7,7 +7,7 @@ let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_g
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
\ 'b': 79,
\ 'x': 60,
\ 'y': 88,
\ 'y': 80,
\ 'z': 45,
\ 'warning': 80,
\ 'error': 80,
@@ -76,17 +76,14 @@ else
endfunction
endif
function! airline#extensions#default#apply(builder, context)
function! airline#extensions#default#apply(builder, context) abort
let winnr = a:context.winnr
let active = a:context.active
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
call s:build_sections(a:builder, a:context, s:layout[0])
else
let text = s:get_section(winnr, 'c')
if empty(text)
let text = ' %f%m '
endif
let text = !empty(s:get_section(winnr, 'c')) ? s:get_section(winnr, 'c') : ' %f%m '
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2017-2019 Thomas Dy et al.
" MIT License. Copyright (c) 2017-2021 Thomas Dy et al.
" Plugin: https://github.com/Shougo/denite.nvim
" vim: et ts=2 sts=2 sw=2
@@ -12,8 +12,8 @@ let s:denite_ver = (exists('*denite#get_status_mode') ? 2 : 3)
" 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)
if &filetype !=# 'denite' || &filetype !=# 'denite-filter'
function! airline#extensions#denite#check_denite_mode(bufnr) abort
if &filetype !=# 'denite' && &filetype !=# 'denite-filter'
return ''
endif
@@ -30,7 +30,7 @@ function! airline#extensions#denite#check_denite_mode(bufnr)
return ''
endfunction
function! airline#extensions#denite#apply(...)
function! airline#extensions#denite#apply(...) abort
if &filetype ==# 'denite' || &filetype ==# 'denite-filter'
let w:airline_skip_empty_sections = 0
call a:1.add_section('airline_a', ' Denite %{airline#extensions#denite#check_denite_mode('.a:2['bufnr'].')}')
@@ -49,7 +49,7 @@ function! airline#extensions#denite#apply(...)
endif
endfunction
function! airline#extensions#denite#init(ext)
function! airline#extensions#denite#init(ext) abort
call denite#custom#option('_', 'statusline', 0)
call a:ext.add_statusline_func('airline#extensions#denite#apply')
endfunction

View File

@@ -0,0 +1,36 @@
" MIT Licsense
" Plugin: https://github.com/justinmk/vim-dirvish
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_dirvish', 0)
finish
endif
let s:spc = g:airline_symbols.space
function! airline#extensions#dirvish#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#dirvish#apply')
endfunction
function! airline#extensions#dirvish#apply(...) abort
if &filetype ==# 'dirvish' && exists('b:dirvish')
let w:airline_section_a = 'Dirvish'
let w:airline_section_b = exists('*airline#extensions#branch#get_head')
\ ? '%{airline#extensions#branch#get_head()}'
\ : ''
let w:airline_section_c = '%{b:dirvish._dir}'
let w:airline_section_x = ''
let w:airline_section_y = ''
let current_column_regex = ':%\dv'
let w:airline_section_z = join(filter(
\ split(get(w:, 'airline_section_z', g:airline_section_z)),
\ 'v:val !~ current_column_regex'
\ ))
endif
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" PLugin: https://eclim.org
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -23,7 +23,7 @@ function! airline#extensions#example#init(ext)
call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}')
" Next up we add a funcref so that we can run some code prior to the
" statusline getting modifed.
" statusline getting modified.
call a:ext.add_statusline_func('airline#extensions#example#apply')
" You can also add a funcref for inactive statuslines.
@@ -40,7 +40,7 @@ function! airline#extensions#example#apply(...)
" section_c.
let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c)
" Then we just append this extenion to it, optionally using separators.
" Then we just append this extension to it, optionally using separators.
let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}'
endif
endfunction

View File

@@ -0,0 +1,36 @@
" MIT License. Copyright (c) 2013-2021
" Plugin: https://github.com/lambdalisue/fern.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_fern', 0)
finish
endif
function! airline#extensions#fern#apply(...) abort
if (&ft =~# 'fern')
let spc = g:airline_symbols.space
let fri = fern#fri#parse(expand('%f'))
call a:1.add_section('airline_a', spc.'fern'.spc)
if exists('*airline#extensions#branch#get_head')
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
else
call a:1.add_section('airline_b', '')
endif
if !(fri.authority =~# '^drawer')
let abspath = substitute(fri.path, 'file://', '', '')
call a:1.add_section('airline_c', spc.fnamemodify(abspath, ':~'))
call a:1.split()
if len(get(g:, 'fern#comparators', {}))
call a:1.add_section('airline_y', spc.'%{fern#comparator}'.spc)
endif
endif
return 1
endif
endfunction
function! airline#extensions#fern#init(ext) abort
let g:fern_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#fern#apply')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2017-2019 Cimbali et al
" MIT License. Copyright (c) 2017-2021 Cimbali et al
" Plugin: https://github.com/tpope/vim-fugitive
" vim: et ts=2 sts=2 sw=2
@@ -8,45 +8,54 @@ if !airline#util#has_fugitive()
finish
endif
function! s:ModifierFlags()
return (exists("+autochdir") && &autochdir) ? ':p' : ':.'
endfunction
let s:has_percent_eval = v:version > 802 || (v:version == 802 && has("patch2854"))
function! airline#extensions#fugitiveline#bufname()
function! airline#extensions#fugitiveline#bufname() abort
if !exists('b:fugitive_name')
let b:fugitive_name = ''
try
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
let b:fugitive_name = FugitiveReal(bufname('%'))
elseif exists('b:git_dir') && exists('*fugitive#repo')
if get(b:, 'fugitive_type', '') is# 'blob'
let b:fugitive_name = fugitive#repo().translate(FugitivePath(@%, ''))
endif
elseif exists('b:git_dir') && !exists('*fugitive#repo')
let buffer = fugitive#buffer()
if buffer.type('blob')
let b:fugitive_name = buffer.repo().translate(buffer.path('/'))
endif
endif
catch
endtry
endif
let fmod = s:ModifierFlags()
let fmod = (exists("+autochdir") && &autochdir) ? ':p' : ':.'
let result=''
if empty(b:fugitive_name)
return fnamemodify(bufname('%'), fmod)
if empty(bufname('%'))
return &buftype ==# 'nofile' ? '[Scratch]' : '[No Name]'
endif
return s:has_percent_eval ? '%f' : fnamemodify(bufname('%'), fmod)
else
return fnamemodify(b:fugitive_name, fmod). " [git]"
return s:has_percent_eval ? '%f [git]' : (fnamemodify(b:fugitive_name, fmod). " [git]")
endif
endfunction
function! airline#extensions#fugitiveline#init(ext)
function! s:sh_autocmd_handler()
if exists('#airline')
unlet! b:fugitive_name
endif
endfunction
function! airline#extensions#fugitiveline#init(ext) abort
let prct = s:has_percent_eval ? '%' : ''
if exists("+autochdir") && &autochdir
" if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well
call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m')
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
call airline#parts#define_raw('path', '%<%{'. prct. 'pathshorten(airline#extensions#fugitiveline#bufname())' . prct . '}%m')
else
call airline#parts#define_raw('path', '%<%{' . prct . 'airline#extensions#fugitiveline#bufname()' . prct . '}%m')
endif
else
call airline#parts#define_raw('file', '%<%{airline#extensions#fugitiveline#bufname()}%m')
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
call airline#parts#define_raw('file', '%<%{' . prct . 'pathshorten(airline#extensions#fugitiveline#bufname())' . prct . '}%m')
else
call airline#parts#define_raw('file', '%<%{' . prct . 'airline#extensions#fugitiveline#bufname()' . prct . '}%m')
endif
endif
autocmd ShellCmdPost,CmdwinLeave * unlet! b:fugitive_name
autocmd User AirlineBeforeRefresh unlet! b:fugitive_name
autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler()
autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler()
endfunction

View File

@@ -0,0 +1,44 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/junegunn/fzf, https://github.com/junegunn/fzf.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#fzf#init(ext) abort
" Remove the custom statusline that fzf.vim sets by removing its `FileType
" fzf` autocmd. Ideally we'd use `let g:fzf_statusline = 0`, but this
" variable is checked *before* airline#extensions#init() is called.
augroup _fzf_statusline
autocmd!
augroup END
call a:ext.add_statusline_func('airline#extensions#fzf#apply')
call a:ext.add_inactive_statusline_func('airline#extensions#fzf#inactive_apply')
endfunction
function! airline#extensions#fzf#statusline(...) abort
let spc = g:airline_symbols.space
let builder = airline#builder#new({ 'active': 1 })
call builder.add_section('airline_a', spc.'FZF'.spc)
call builder.add_section('airline_c', '')
return builder.build()
endfunction
function! airline#extensions#fzf#apply(...) abort
if &filetype ==# 'fzf'
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'FZF'.spc)
call a:1.add_section('airline_c', '')
return 1
endif
endfunction
function! airline#extensions#fzf#inactive_apply(...) abort
if getbufvar(a:2.bufnr, '&filetype') ==# 'fzf'
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'FZF'.spc)
call a:1.add_section('airline_c', '')
return 1
endif
endfunction

View File

@@ -0,0 +1,19 @@
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Written by Kamil Cukrowski 2020
" Plugin: https://github.com/jsfaint/gen_tags.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !(get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0))
finish
endif
function! airline#extensions#gen_tags#status(...) abort
return gen_tags#job#is_running() != 0 ? 'Gen. gen_tags' : ''
endfunction
function! airline#extensions#gen_tags#init(ext) abort
call airline#parts#define_function('gen_tags', 'airline#extensions#gen_tags#status')
endfunction

View File

@@ -0,0 +1,28 @@
" MIT License. Copyright (c) 2013-2021
" Plugin: https://github.com/lambdalisue/gina.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_gina', 0)
finish
endif
function! airline#extensions#gina#apply(...) abort
" gina.vim seems to set b:gina_initialized = 1 in diff buffers it open,
" where get(b:, 'gina_initialized', 0) returns 1.
" In diff buffers not opened by gina.vim b:gina_initialized is not set,
" so get(b:, 'gina_initialized', 0) returns 0.
if (&ft =~# 'gina' && &ft !~# 'blame') || (&ft ==# 'diff' && get(b:, 'gina_initialized', 0))
call a:1.add_section('airline_a', ' gina ')
call a:1.add_section('airline_b', ' %{gina#component#repo#branch()} ')
call a:1.split()
call a:1.add_section('airline_y', ' staged %{gina#component#status#staged()} ')
call a:1.add_section('airline_z', ' unstaged %{gina#component#status#unstaged()} ')
return 1
endif
endfunction
function! airline#extensions#gina#init(ext) abort
let g:gina_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#gina#apply')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al.
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/mhinz/vim-grepper
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al.
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/ludovicchabant/vim-gutentags
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,17 +1,59 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" Plugin: vim-gitgutter, vim-signify, changesPlugin, quickfixsigns
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: vim-gitgutter, vim-signify, changesPlugin, quickfixsigns, coc-git,
" gitsigns.nvim
" 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)
\ && !get(g:, 'loaded_quickfixsigns', 0)
\ && !exists(':Gitsigns')
\ && !exists("*CocAction")
finish
endif
let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0)
let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])
function! s:get_hunks_signify()
function! s:coc_git_enabled() abort
if !exists("*CocAction") ||
\ !get(g:, 'airline#extensions#hunks#coc_git', 0)
" coc-git extension is disabled by default
" unless specifically being enabled by the user
" (as requested from coc maintainer)
return 0
endif
return 1
endfunction
function! s:parse_hunk_status_dict(hunks) abort
let result = [0, 0, 0]
let result[0] = get(a:hunks, 'added', 0)
let result[1] = get(a:hunks, 'changed', 0)
let result[2] = get(a:hunks, 'removed', 0)
return result
endfunction
function! s:parse_hunk_status_decorated(hunks) abort
if empty(a:hunks)
return []
endif
let result = [0, 0, 0]
for val in split(a:hunks)
if val[0] is# '+'
let result[0] = val[1:] + 0
elseif val[0] is# '~'
let result[1] = val[1:] + 0
elseif val[0] is# '-'
let result[2] = val[1:] + 0
endif
endfor
return result
endfunction
function! s:get_hunks_signify() abort
let hunks = sy#repo#get_stats()
if hunks[0] >= 0
return hunks
@@ -19,40 +61,44 @@ function! s:get_hunks_signify()
return []
endfunction
function! s:is_branch_empty()
return exists('*airline#extensions#branch#head') &&
\ empty(get(b:, 'airline_head', ''))
function! s:get_hunks_gitgutter() abort
let hunks = GitGutterGetHunkSummary()
return hunks == [0, 0, 0] ? [] : hunks
endfunction
function! s:get_hunks_gitgutter()
if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty()
return ''
endif
return GitGutterGetHunkSummary()
endfunction
function! s:get_hunks_changes()
if !get(b:, 'changes_view_enabled', 0) || s:is_branch_empty()
return []
endif
function! s:get_hunks_changes() abort
let hunks = changes#GetStats()
return hunks == [0, 0, 0] ? [] : hunks
endfunction
function! s:get_hunks_empty()
function! s:get_hunks_gitsigns() abort
let hunks = get(b:, 'gitsigns_status_dict', {})
return s:parse_hunk_status_dict(hunks)
endfunction
function! s:get_hunks_coc() abort
let hunks = get(b:, 'coc_git_status', '')
return s:parse_hunk_status_decorated(hunks)
endfunction
function! s:get_hunks_empty() abort
return ''
endfunction
function! airline#extensions#hunks#get_raw_hunks()
function! airline#extensions#hunks#get_raw_hunks() abort
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'
elseif exists('*GitGutterGetHunkSummary')
elseif exists('*GitGutterGetHunkSummary') && get(g:, 'gitgutter_enabled')
let b: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'
elseif exists(':Gitsigns')
let b:source_func = 's:get_hunks_gitsigns'
elseif s:coc_git_enabled()
let b:source_func = 's:get_hunks_coc'
else
let b:source_func = 's:get_hunks_empty'
endif
@@ -60,7 +106,7 @@ function! airline#extensions#hunks#get_raw_hunks()
return {b:source_func}()
endfunction
function! airline#extensions#hunks#get_hunks()
function! airline#extensions#hunks#get_hunks() abort
if !get(w:, 'airline_active', 0)
return ''
endif
@@ -71,25 +117,33 @@ function! airline#extensions#hunks#get_hunks()
\ 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' &&
\ get(b:, 'source_func', '') isnot# 's:get_hunks_changes'
\ get(b:, 'source_func', '') isnot# 's:get_hunks_changes' &&
\ get(b:, 'source_func', '') isnot# 's:get_hunks_gitsigns' &&
\ get(b:, 'source_func', '') isnot# 's:get_hunks_coc'
return b:airline_hunks
endif
let hunks = airline#extensions#hunks#get_raw_hunks()
let string = ''
let winwidth = get(airline#parts#get('hunks'), 'minwidth', 100)
if !empty(hunks)
" hunks should contain [added, changed, deleted]
for i in [0, 1, 2]
if (s:non_zero_only == 0 && airline#util#winwidth() > winwidth) || hunks[i] > 0
let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
endif
endfor
endif
if index(airline#extensions#get_loaded_extensions(), 'branch') == -1 && string[-1:] == ' '
" branch extension not loaded, skip trailing whitespace
let string = string[0:-2]
endif
let b:airline_hunks = string
let b:airline_changenr = b:changedtick
let s:airline_winwidth = airline#util#winwidth()
return string
endfunction
function! airline#extensions#hunks#init(ext)
function! airline#extensions#hunks#init(ext) abort
call airline#parts#define_function('hunks', 'airline#extensions#hunks#get_hunks')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Doron Behar, C.Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Doron Behar, C.Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -9,7 +9,18 @@ endif
function! airline#extensions#keymap#status()
if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : ''))
let short_codes = get(g:, 'airline#extensions#keymap#short_codes', {})
let label = get(g:, 'airline#extensions#keymap#label', g:airline_symbols.keymap)
let default = get(g:, 'airline#extensions#keymap#default', '')
if (label !=# '')
let label .= ' '
endif
let keymap = &keymap
if has_key(short_codes, keymap)
let keymap = short_codes[keymap]
endif
return printf('%s', (!empty(keymap) && &iminsert ? (label . keymap) :
\ (!empty(default) ? label . default : default)))
else
return ''
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bjorn Neergaard, hallettj et al.
" MIT License. Copyright (c) 2013-2021 Bjorn Neergaard, hallettj et al.
" Plugin: https://github.com/autozimu/LanguageClient-neovim
" vim: et ts=2 sts=2 sw=2
@@ -35,6 +35,10 @@ function! s:record_diagnostics(state)
endfunction
function! s:get_diagnostics()
if !exists('#airline')
" airline disabled
return
endif
call LanguageClient#getState(function("s:record_diagnostics"))
endfunction
@@ -66,6 +70,10 @@ function! s:airline_languageclient_get_line_number(type) abort
endfunction
function! airline#extensions#languageclient#get(type)
if get(b:, 'LanguageClient_isServerRunning', 0) ==# 0
return ''
endif
let is_err = a:type == s:severity_error
let symbol = is_err ? s:error_symbol : s:warning_symbol

View File

@@ -1,5 +1,5 @@
" MIT License. Copyright (c) 2018-2019 mox et al.
" Plugin: https://github.com/mox-mox/localsearch
" MIT License. Copyright (c) 2018-2021 mox et al.
" Plugin: https://github.com/mox-mox/vim-localsearch
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -12,25 +12,30 @@ let g:airline#extensions#localsearch#loaded = 001
let s:spc = g:airline_symbols.space
function! airline#extensions#localsearch#load_theme(palette)
let g:airline#extensions#localsearch#inverted = get(g:, 'airline#extensions#localsearch#inverted', 0)
function! airline#extensions#localsearch#load_theme(palette) abort
call airline#highlighter#exec('localsearch_dark', [ '#ffffff' , '#000000' , 15 , 1 , ''])
endfunction
function! airline#extensions#localsearch#init(ext)
call a:ext.add_theme_func('airline#extensions#localsearch#load_theme')
call a:ext.add_statusline_func('airline#extensions#localsearch#apply')
function! airline#extensions#localsearch#init(ext) abort
call a:ext.add_theme_func('airline#extensions#localsearch#load_theme')
call a:ext.add_statusline_func('airline#extensions#localsearch#apply')
endfunction
function! airline#extensions#localsearch#apply(...)
function! airline#extensions#localsearch#apply(...) abort
" first variable is the statusline builder
let builder = a:1
""""" WARNING: the API for the builder is not finalized and may change
if exists('#localsearch#WinEnter') " If localsearch mode is enabled
if exists('#localsearch#WinEnter') && !g:airline#extensions#localsearch#inverted " If localsearch mode is enabled and 'invert' option is false
call builder.add_section('localsearch_dark', s:spc.airline#section#create('LS').s:spc)
endif
if !exists('#localsearch#WinEnter') && g:airline#extensions#localsearch#inverted " If localsearch mode is disabled and 'invert' option is true
call builder.add_section('localsearch_dark', s:spc.airline#section#create('GS').s:spc)
endif
return 0
endfunction

View File

@@ -0,0 +1,111 @@
" MIT License. Copyright (c) 2013-2021 François-Xavier Carton et al.
" Plugin: https://github.com/prabirshrestha/vim-lsp
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'lsp_loaded', 0)
finish
endif
function! s:airline_lsp_count(cnt, symbol) abort
return a:cnt ? a:symbol. a:cnt : ''
endfunction
function! s:airline_lsp_get_line_number(cnt, type) abort
let result = ''
if a:type ==# 'error'
let result = lsp#get_buffer_first_error_line()
endif
if empty(result)
return ''
endif
let open_lnum_symbol =
\ get(g:, 'airline#extensions#lsp#open_lnum_symbol', '(L')
let close_lnum_symbol =
\ get(g:, 'airline#extensions#lsp#close_lnum_symbol', ')')
return open_lnum_symbol . result . close_lnum_symbol
endfunction
function! airline#extensions#lsp#get(type) abort
if !exists(':LspDeclaration')
return ''
endif
let error_symbol = get(g:, 'airline#extensions#lsp#error_symbol', 'E:')
let warning_symbol = get(g:, 'airline#extensions#lsp#warning_symbol', 'W:')
let show_line_numbers = get(g:, 'airline#extensions#lsp#show_line_numbers', 1)
let is_err = a:type ==# 'error'
let symbol = is_err ? error_symbol : warning_symbol
let num = lsp#get_buffer_diagnostics_counts()[a:type]
if show_line_numbers == 1
return s:airline_lsp_count(num, symbol) . <sid>airline_lsp_get_line_number(num, a:type)
else
return s:airline_lsp_count(num, symbol)
endif
endfunction
function! airline#extensions#lsp#get_warning() abort
return airline#extensions#lsp#get('warning')
endfunction
function! airline#extensions#lsp#get_error() abort
return airline#extensions#lsp#get('error')
endfunction
let s:lsp_progress = []
function! airline#extensions#lsp#progress() abort
if get(w:, 'airline_active', 0)
if exists('*lsp#get_progress')
let s:lsp_progress = lsp#get_progress()
if len(s:lsp_progress) == 0 | return '' | endif
" show only most new progress
let s:lsp_progress = s:lsp_progress[0]
if s:lsp_progress['message'] !=# ''
let percent = ''
if has_key(s:lsp_progress, 'percentage') && s:lsp_progress['percentage'] >= 0
let percent = ' ' . string(s:lsp_progress['percentage']) . '%'
endif
let s:title = s:lsp_progress['title']
let message = airline#util#shorten(s:lsp_progress['message'] . percent, 91, 9)
return s:lsp_progress['server'] . ': ' . s:title . ' ' . message
endif
endif
endif
return ''
endfunction
let s:timer = 0
let s:ignore_time = 0
function! airline#extensions#lsp#update() abort
if !exists('#airline')
" airline disabled
return
endif
if reltimefloat(reltime()) - s:ignore_time >=
\ get(g:, 'airline#extensions#lsp#progress_skip_time', 0.3)
\ || len(s:lsp_progress) == 0
call airline#update_statusline()
let s:ignore_time = reltimefloat(reltime())
endif
endfunction
function! airline#extensions#lsp#init(ext) abort
call airline#parts#define_function('lsp_error_count', 'airline#extensions#lsp#get_error')
call airline#parts#define_function('lsp_warning_count', 'airline#extensions#lsp#get_warning')
call airline#parts#define_function('lsp_progress', 'airline#extensions#lsp#progress')
augroup airline_lsp_progress
autocmd!
autocmd User lsp_progress_updated call airline#extensions#lsp#update()
augroup END
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/neomake/neomake
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: http://www.drchip.org/astronaut/vim/#NETRW
" vim: et ts=2 sts=2 sw=2
@@ -31,5 +31,5 @@ endfunction
function! airline#extensions#netrw#sortstring()
let order = (get(g:, 'netrw_sort_direction', 'n') =~ 'n') ? '+' : '-'
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
return get(g:, 'netrw_sort_by', '') . (g:airline_symbols.space) . '[' . order . ']'
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/NrrwRgn
" vim: et ts=2 sts=2 sw=2

View File

@@ -0,0 +1,71 @@
" Apache 2.0 license. Copyright (c) 2019-2021 Copyright Neovim contributors.
" Plugin: https://github.com/neovim/nvim-lsp
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && has('nvim')
\ && luaeval('vim.lsp ~= nil'))
finish
endif
function! s:airline_nvimlsp_count(cnt, symbol) abort
return a:cnt ? a:symbol. a:cnt : ''
endfunction
function! airline#extensions#nvimlsp#get(type) abort
if has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.get_clients({ bufnr = 0 }))')
return ''
elseif !has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
return ''
endif
let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:')
let warning_symbol = get(g:, 'airline#extensions#nvimlsp#warning_symbol', 'W:')
let show_line_numbers = get(g:, 'airline#extensions#nvimlsp#show_line_numbers', 1)
let is_err = a:type ==# 'Error'
let symbol = is_err ? error_symbol : warning_symbol
if luaeval("pcall(require, 'vim.diagnostic')")
let severity = a:type == 'Warning' ? 'Warn' : a:type
let num = len(v:lua.vim.diagnostic.get(0, { 'severity': severity }))
elseif luaeval("pcall(require, 'vim.lsp.diagnostic')")
let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type)
else
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
endif
if show_line_numbers == 1 && luaeval("pcall(require, 'vim.diagnostic')") && num > 0
return s:airline_nvimlsp_count(num, symbol) . <sid>airline_nvimlsp_get_line_number(num, a:type)
else
return s:airline_nvimlsp_count(num, symbol)
endif
endfunction
function! s:airline_nvimlsp_get_line_number(cnt, type) abort
let severity = a:type == 'Warning' ? 'Warn' : a:type
let num = v:lua.vim.diagnostic.get(0, { 'severity': severity })[0].lnum
let l:open_lnum_symbol =
\ get(g:, 'airline#extensions#nvimlsp#open_lnum_symbol', '(L')
let l:close_lnum_symbol =
\ get(g:, 'airline#extensions#nvimlsp#close_lnum_symbol', ')')
return open_lnum_symbol . num . close_lnum_symbol
endfunction
function! airline#extensions#nvimlsp#get_warning() abort
return airline#extensions#nvimlsp#get('Warning')
endfunction
function! airline#extensions#nvimlsp#get_error() abort
return airline#extensions#nvimlsp#get('Error')
endfunction
function! airline#extensions#nvimlsp#init(ext) abort
call airline#parts#define_function('nvimlsp_error_count', 'airline#extensions#nvimlsp#get_error')
call airline#parts#define_function('nvimlsp_warning_count', 'airline#extensions#nvimlsp#get_warning')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/tpope/vim-obsession
" vim: et ts=2 sts=2 sw=2

View File

@@ -0,0 +1,45 @@
" MIT License
" Plugin: https://github.com/OmniSharp/omnisharp-vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'OmniSharp_loaded', 0)
finish
endif
function! airline#extensions#omnisharp#server_status(...) abort
if !exists(':OmniSharpGotoDefinition') || !get(g:, 'OmniSharp_server_stdio', 0)
return ''
endif
let host = OmniSharp#GetHost(bufnr('%'))
if type(host.job) != v:t_dict || get(host.job, 'stopped')
return ''
endif
let sln = fnamemodify(host.sln_or_dir, ':t')
if get(host.job, 'loaded', 0)
return sln
endif
try
let projectsloaded = OmniSharp#project#CountLoaded()
let projectstotal = OmniSharp#project#CountTotal()
catch
" The CountLoaded and CountTotal functions are very new - catch the error
" when they don't exist
let projectsloaded = 0
let projectstotal = 0
endtry
return printf('%s(%d/%d)', sln, projectsloaded, projectstotal)
endfunction
function! airline#extensions#omnisharp#init(ext) abort
call airline#parts#define_function('omnisharp', 'airline#extensions#omnisharp#server_status')
augroup airline_omnisharp
autocmd!
autocmd User OmniSharpStarted,OmniSharpReady,OmniSharpStopped AirlineRefresh!
augroup END
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -10,7 +10,7 @@ function! airline#extensions#po#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' ? '…' : '.'). ']'
let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 2)].(&encoding==?'utf-8' ? '…' : '.')
endif
endif
if strlen(get(b:, 'airline_po_stats', '')) >= 30 && airline#util#winwidth() < 150
@@ -19,27 +19,34 @@ function! airline#extensions#po#shorten()
let messages = ''
" Shorten [120 translated, 50 fuzzy, 4 untranslated] to [120T/50F/4U]
if b:airline_po_stats =~ 'fuzzy'
let fuzzy = substitute(b:airline_po_stats, '.*\(\d\+\) fuzzy.*', '\1F', '')
let fuzzy = substitute(b:airline_po_stats, '.\{-}\(\d\+\) fuzzy.*', '\1F', '')
if fuzzy == '0F'
let fuzzy = ''
endif
endif
if b:airline_po_stats =~ 'untranslated'
let untranslated = substitute(b:airline_po_stats, '.*\(\d\+\) untranslated.*', '\1U', '')
let untranslated = substitute(b:airline_po_stats, '.\{-}\(\d\+\) untranslated.*', '\1U', '')
if untranslated == '0U'
let untranslated = ''
endif
endif
let messages = substitute(b:airline_po_stats, '\(\d\+\) translated.*', '\1T', '')
if messages ==# '0T'
let messages = ''
endif
let b:airline_po_stats = printf('%s%s%s', fuzzy, (empty(fuzzy) || empty(untranslated) ? '' : '/'), untranslated)
if strlen(b:airline_po_stats) < 8
let b:airline_po_stats = messages. (!empty(b:airline_po_stats) ? '/':''). b:airline_po_stats
if strlen(b:airline_po_stats) < 10
let b:airline_po_stats = messages. (!empty(b:airline_po_stats) && !empty(messages) ? '/':''). b:airline_po_stats
endif
endif
let b:airline_po_stats = '['.b:airline_po_stats. ']'
let b:airline_po_stats = '['.b:airline_po_stats. '] '
endfunction
function! airline#extensions#po#on_winenter()
if !exists('#airline')
" airline disabled
return
endif
" only reset cache, if the window size changed
if get(b:, 'airline_winwidth', 0) != airline#util#winwidth()
let b:airline_winwidth = airline#util#winwidth()
@@ -48,11 +55,17 @@ function! airline#extensions#po#on_winenter()
endif
endfunction
function! s:autocmd_handler()
if exists('#airline')
unlet! b:airline_po_stats
endif
endfunction
function! airline#extensions#po#apply(...)
if &ft ==# 'po'
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}')
" Also reset the cache variable, if a window has been split, e.g. the winwidth changed
autocmd airline BufWritePost * unlet! b:airline_po_stats
autocmd airline BufWritePost * call s:autocmd_handler()
autocmd airline WinEnter * call airline#extensions#po#on_winenter()
endif
endfunction
@@ -62,7 +75,12 @@ function! airline#extensions#po#stats()
return b:airline_po_stats
endif
let cmd = 'msgfmt --statistics -o /dev/null -- '
" Write stdout to null because we only want to see warnings.
if g:airline#init#is_windows
let cmd = 'msgfmt --statistics -o /NUL '
else
let cmd = 'msgfmt --statistics -o /dev/null -- '
endif
if g:airline#init#vim_async
call airline#async#get_msgfmt_stat(cmd, expand('%:p'))
elseif has("nvim")

View File

@@ -0,0 +1,32 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/petobens/poet_v
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
let s:spc = g:airline_symbols.space
function! airline#extensions#poetv#init(ext)
call a:ext.add_statusline_func('airline#extensions#poetv#apply')
endfunction
function! airline#extensions#poetv#apply(...)
if &filetype =~# 'python'
if get(g:, 'poetv_loaded', 0)
let statusline = poetv#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
endif
endfunction
function! airline#extensions#poetv#update()
if &filetype =~# 'python'
call airline#extensions#poetv#apply()
call airline#update_statusline()
endif
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/edkolev/promptline.vim
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8

View File

@@ -0,0 +1,38 @@
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists('g:rufo_loaded')
finish
endif
let s:spc = g:airline_symbols.space
if !exists('g:airline#extensions#rufo#symbol')
let g:airline#extensions#rufo#symbol = 'RuFo'
endif
function! airline#extensions#rufo#init(ext)
call airline#parts#define_raw('rufo', '%{airline#extensions#rufo#get_status}')
call a:ext.add_statusline_func('airline#extensions#rufo#apply')
endfunction
function! airline#extensions#rufo#get_status()
let out = ''
if &ft == "ruby" && g:rufo_auto_formatting == 1
let out .= s:spc.g:airline_left_alt_sep.s:spc.g:airline#extensions#rufo#symbol
endif
return out
endfunction
" This function will be invoked just prior to the statusline getting modified.
function! airline#extensions#rufo#apply(...)
" First we check for the filetype.
if &filetype == "ruby"
" section_z.
let w:airline_section_z = get(w:, 'airline_section_z', g:airline_section_z)
" Then we just append this extension to it, optionally using separators.
let w:airline_section_z .= '%{airline#extensions#rufo#get_status()}'
endif
endfunction

View File

@@ -0,0 +1,37 @@
" MIT License. Copyright (c) 2013-2021
" vim: et ts=2 sts=2 sw=2 et
scriptencoding utf-8
function! airline#extensions#scrollbar#calculate() abort
if winwidth(0) > get(g:, 'airline#extensions#scrollbar#minwidth', 200)
\ && get(w:, 'airline_active', 0)
let overwrite = 0
if &encoding ==? 'utf-8' && !get(g:, 'airline_symbols_ascii', 0)
let [left, right, middle] = [ '|', '|', '█']
let overwrite = 1
else
let [left, right, middle] = [ '[', ']', '-']
endif
let spc = get(g:, 'airline_symbols.space', ' ')
let width = 20 " max width, plus one border and indicator
let perc = (line('.') + 0.0) / (line('$') + 0.0)
let before = float2nr(round(perc * width))
if before >= 0 && line('.') == 1
let before = 0
let left = (overwrite ? '' : left)
endif
let after = width - before
if (after <= 1 && line('.') == line('$'))
let after = 0
let right = (overwrite ? '' : right)
endif
return left . repeat(spc, before) . middle . repeat(spc, after) . right
else
return ''
endif
endfunction
function! airline#extensions#scrollbar#init(ext) abort
call airline#parts#define_function('scrollbar', 'airline#extensions#scrollbar#calculate')
endfunction

View File

@@ -0,0 +1,56 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" This extension is inspired by vim-anzu <https://github.com/osyo-manga/vim-anzu>.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists('*searchcount')
finish
endif
function! airline#extensions#searchcount#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#searchcount#apply')
endfunction
function! airline#extensions#searchcount#apply(...) abort
call airline#extensions#append_to_section('y',
\ '%{v:hlsearch ? airline#extensions#searchcount#status() : ""}')
endfunction
function! s:search_term()
let show_search_term = get(g:, 'airline#extensions#searchcount#show_search_term', 1)
let search_term_limit = get(g:, 'airline#extensions#searchcount#search_term_limit', 8)
if show_search_term == 0
return ''
endif
" shorten for all width smaller than 300 (this is just a guess)
" this uses a non-breaking space, because it looks like
" a leading space is stripped :/
return "\ua0" . '/' . airline#util#shorten(getreg('/'), 300, search_term_limit)
endfunction
function! airline#extensions#searchcount#status() abort
try
let result = searchcount(#{recompute: 1, maxcount: -1})
if empty(result) || result.total ==# 0
return ''
endif
if result.incomplete ==# 1 " timed out
return printf('%s[?/??]', s:search_term())
elseif result.incomplete ==# 2 " max count exceeded
if result.total > result.maxcount &&
\ result.current > result.maxcount
return printf('%s[>%d/>%d]', s:search_term(),
\ result.current, result.total)
elseif result.total > result.maxcount
return printf('%s[%d/>%d]', s:search_term(),
\ result.current, result.total)
endif
endif
return printf('%s[%d/%d]', s:search_term(),
\ result.current, result.total)
catch
return ''
endtry
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/vim-syntastic/syntastic
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,5 +1,5 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 et
scriptencoding utf-8
@@ -10,9 +10,13 @@ endif
let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
let s:tabws = get(g:, 'tabws_loaded', 0)
let s:current_tabcnt = -1
" Dictionary functions are not possible in Vim9 Script,
" so use the legacy Vim Script implementation
function! airline#extensions#tabline#init(ext)
if has('gui_running')
if has('gui_running') && match(&guioptions, 'e') > -1
set guioptions-=e
endif
@@ -23,228 +27,457 @@ function! airline#extensions#tabline#init(ext)
call a:ext.add_theme_func('airline#extensions#tabline#load_theme')
endfunction
function! s:toggle_off()
call airline#extensions#tabline#autoshow#off()
call airline#extensions#tabline#tabs#off()
call airline#extensions#tabline#buffers#off()
if s:ctrlspace
call airline#extensions#tabline#ctrlspace#off()
endif
if s:tabws
call airline#extensions#tabline#tabws#off()
endif
endfunction
function! s:toggle_on()
if get(g:, 'airline_statusline_ontop', 0)
call airline#extensions#tabline#enable()
let &tabline='%!airline#statusline('.winnr().')'
return
endif
call airline#extensions#tabline#autoshow#on()
call airline#extensions#tabline#tabs#on()
call airline#extensions#tabline#buffers#on()
if s:ctrlspace
call airline#extensions#tabline#ctrlspace#on()
endif
if s:tabws
call airline#extensions#tabline#tabws#on()
endif
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) || airline#util#ignore_buf(match)
\ || isdirectory(expand("<afile>"))
return
endif
call airline#util#doautocmd('BufMRUChange')
call airline#extensions#tabline#redraw()
endfunction
function! airline#extensions#tabline#redraw()
" sometimes, the tabline is not correctly updated see #1580
" so force redraw here
if exists(":redrawtabline") == 2
redrawtabline
else
" Have to set a property equal to itself to get airline to re-eval.
" Setting `let &tabline=&tabline` destroys the cursor position so we
" need something less invasive.
let &ro = &ro
endif
endfunction
function! airline#extensions#tabline#enable()
if &lines > 3
set showtabline=2
endif
endfunction
function! airline#extensions#tabline#load_theme(palette)
if pumvisible()
return
endif
let colors = get(a:palette, 'tabline', {})
let tablabel = get(colors, 'airline_tablabel', a:palette.normal.airline_b)
" Theme for tabs on the left
let tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
let tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
let tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
let tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
let tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
let 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 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 tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
endif
call airline#highlighter#exec('airline_tablabel', tablabel)
call airline#highlighter#exec('airline_tab', tab)
call airline#highlighter#exec('airline_tabsel', tabsel)
call airline#highlighter#exec('airline_tabtype', tabtype)
call airline#highlighter#exec('airline_tabfill', tabfill)
call airline#highlighter#exec('airline_tabmod', tabmod)
call airline#highlighter#exec('airline_tabmod_unsel', tabmodu)
call airline#highlighter#exec('airline_tabhid', tabhid)
" Theme for tabs on the right
" label on the right
let tablabel_r = get(colors, 'airline_tablabel', a:palette.normal.airline_b)
let tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
let tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
let tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
let 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 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 tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
endif
call airline#highlighter#exec('airline_tablabel_right', tablabel_r)
call airline#highlighter#exec('airline_tab_right', tab_right)
call airline#highlighter#exec('airline_tabsel_right', tabsel_right)
call airline#highlighter#exec('airline_tabmod_right', tabmod_right)
call airline#highlighter#exec('airline_tabhid_right', tabhid_right)
call airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right)
endfunction
let s:current_tabcnt = -1
function! airline#extensions#tabline#get()
let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
let curtabcnt = tabpagenr('$')
if curtabcnt != s:current_tabcnt
let s:current_tabcnt = curtabcnt
call airline#extensions#tabline#tabs#invalidate()
call airline#extensions#tabline#buffers#invalidate()
call airline#extensions#tabline#ctrlspace#invalidate()
call airline#extensions#tabline#tabws#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:tabws
return airline#extensions#tabline#tabws#get()
elseif show_buffers && curtabcnt == 1 || !show_tabs
return airline#extensions#tabline#buffers#get()
else
return airline#extensions#tabline#tabs#get()
endif
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
endfunction
function! airline#extensions#tabline#get_buffer_name(nr, ...)
let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list()
let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers)
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),
\ }
if get(g:, 'airline_powerline_fonts', 0)
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep)
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep)
else
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ')
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
endif
return airline#extensions#tabline#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
function! airline#extensions#tabline#add_label(dict, type, right)
if get(g:, 'airline#extensions#tabline#show_tab_type', 1)
call a:dict.add_section_spaced('airline_tablabel'.
\ (a:right ? '_right' : ''),
call a:dict.add_section_spaced('airline_tablabel'. (a:right ? '_right' : ''),
\ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type))
endif
endfunction
function! airline#extensions#tabline#add_tab_label(dict)
if get(g:, 'airline#extensions#tabline#show_tab_count', 1) && tabpagenr('$') > 1
let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1)
if show_tab_count == 2
call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
elseif show_tab_count == 1 && tabpagenr('$') > 1
call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
endif
endfunction
if !exists(":def") || !airline#util#has_vim9_script()
" Legacy Vim Script Implementation
function! s:toggle_off()
call airline#extensions#tabline#autoshow#off()
call airline#extensions#tabline#tabs#off()
call airline#extensions#tabline#buffers#off()
if s:ctrlspace
call airline#extensions#tabline#ctrlspace#off()
endif
if s:tabws
call airline#extensions#tabline#tabws#off()
endif
endfunction
function! s:toggle_on()
if get(g:, 'airline_statusline_ontop', 0)
call airline#extensions#tabline#enable()
let &tabline='%!airline#statusline('.winnr().')'
return
endif
call airline#extensions#tabline#autoshow#on()
call airline#extensions#tabline#tabs#on()
call airline#extensions#tabline#buffers#on()
if s:ctrlspace
call airline#extensions#tabline#ctrlspace#on()
endif
if s:tabws
call airline#extensions#tabline#tabws#on()
endif
set tabline=%!airline#extensions#tabline#get()
endfunction
function! airline#extensions#tabline#load_theme(palette)
if pumvisible()
return
endif
let colors = get(a:palette, 'tabline', {})
let tablabel = get(colors, 'airline_tablabel', a:palette.normal.airline_b)
" Theme for tabs on the left
let tab = get(colors, 'airline_tab', a:palette.inactive.airline_c)
let tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
let tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
let tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
let tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
let 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 tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
let 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 tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
endif
call airline#highlighter#exec('airline_tablabel', tablabel)
call airline#highlighter#exec('airline_tab', tab)
call airline#highlighter#exec('airline_tabsel', tabsel)
call airline#highlighter#exec('airline_tabtype', tabtype)
call airline#highlighter#exec('airline_tabfill', tabfill)
call airline#highlighter#exec('airline_tabmod', tabmod)
call airline#highlighter#exec('airline_tabmod_unsel', tabmodu)
call airline#highlighter#exec('airline_tabhid', tabhid)
" Theme for tabs on the right
" label on the right
let tablabel_r = get(colors, 'airline_tablabel', a:palette.normal.airline_b)
let tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
let tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
let tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
let tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
call airline#highlighter#exec('airline_tablabel_right', tablabel_r)
call airline#highlighter#exec('airline_tab_right', tab_right)
call airline#highlighter#exec('airline_tabsel_right', tabsel_right)
call airline#highlighter#exec('airline_tabmod_right', tabmod_right)
call airline#highlighter#exec('airline_tabhid_right', tabhid_right)
call airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right)
endfunction
function! s:update_tabline(forceit)
if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
return
endif
" loading a session file
" On SessionLoadPost, g:SessionLoad variable is still set :/
if !a:forceit && get(g:, 'SessionLoad', 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) || airline#util#ignore_buf(match) || isdirectory(match)
return
endif
call airline#util#doautocmd('BufMRUChange')
call airline#extensions#tabline#redraw()
endfunction
function! airline#extensions#tabline#redraw()
" sometimes, the tabline is not correctly updated see #1580
" so force redraw here
if exists(":redrawtabline") == 2
redrawtabline
else
" Have to set a property equal to itself to get airline to re-eval.
" Setting `let &tabline=&tabline` destroys the cursor position so we
" need something less invasive.
let &ro = &ro
endif
endfunction
function! airline#extensions#tabline#enable()
if &lines > 3
set showtabline=2
endif
endfunction
function! airline#extensions#tabline#get()
let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
let curtabcnt = tabpagenr('$')
if curtabcnt != s:current_tabcnt
let s:current_tabcnt = curtabcnt
call airline#extensions#tabline#tabs#invalidate()
call airline#extensions#tabline#buffers#invalidate()
call airline#extensions#tabline#ctrlspace#invalidate()
call airline#extensions#tabline#tabws#invalidate()
endif
if !exists('#airline#BufAdd#*')
autocmd airline BufAdd * call <sid>update_tabline(0)
endif
if !exists('#airline#SessionLoadPost')
autocmd airline SessionLoadPost * call <sid>update_tabline(1)
endif
if s:ctrlspace
return airline#extensions#tabline#ctrlspace#get()
elseif s:tabws
return airline#extensions#tabline#tabws#get()
elseif show_buffers && curtabcnt == 1 || !show_tabs
return airline#extensions#tabline#buffers#get()
else
return airline#extensions#tabline#tabs#get()
endif
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
let formatter = get(g:, 'airline#extensions#tabline#tabtitle_formatter')
if empty(title) && formatter !=# '' && exists("*".formatter)
let title = call(formatter, [a:n])
endif
if empty(title)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
let all_buffers = airline#extensions#tabline#buflist#list()
let curbuf = filter(buflist, 'index(all_buffers, v:val) != -1')
if len(curbuf) == 0
call add(curbuf, tabpagebuflist(a:n)[0])
endif
" a:n: -> buffer number
" curbuf: list of buffers in current tabpage
" we need the buffername in current tab page.
return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf)
endif
return title
endfunction
function! airline#extensions#tabline#get_buffer_name(nr, ...)
let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list()
let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers)
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),
\ }
if get(g:, 'airline_powerline_fonts', 0)
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep)
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep)
else
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ')
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
endif
return airline#extensions#tabline#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
finish
else
def s:toggle_off(): void
airline#extensions#tabline#autoshow#off()
airline#extensions#tabline#tabs#off()
airline#extensions#tabline#buffers#off()
if s:ctrlspace
airline#extensions#tabline#ctrlspace#off()
endif
if s:tabws
airline#extensions#tabline#tabws#off()
endif
enddef
def s:toggle_on(): void
if get(g:, 'airline_statusline_ontop', 0)
airline#extensions#tabline#enable()
&tabline = '%!airline#statusline(' .. winnr() .. ')'
return
endif
airline#extensions#tabline#autoshow#on()
airline#extensions#tabline#tabs#on()
airline#extensions#tabline#buffers#on()
if s:ctrlspace
airline#extensions#tabline#ctrlspace#on()
endif
if s:tabws
airline#extensions#tabline#tabws#on()
endif
&tabline = '%!airline#extensions#tabline#get()'
enddef
def airline#extensions#tabline#load_theme(palette: dict<any>): number
# Needs to return a number, because it is implicitly used as extern_funcref
# And funcrefs should return a value (see airline#util#exec_funcrefs())
if pumvisible()
return 0
endif
var colors = get(palette, 'tabline', {})
var tablabel = get(colors, 'airline_tablabel', palette.normal.airline_b)
# Theme for tabs on the left
var tab = get(colors, 'airline_tab', palette.inactive.airline_c)
var tabsel = get(colors, 'airline_tabsel', palette.normal.airline_a)
var tabtype = get(colors, 'airline_tabtype', palette.visual.airline_a)
var tabfill = get(colors, 'airline_tabfill', palette.normal.airline_c)
var tabmod = get(colors, 'airline_tabmod', palette.insert.airline_a)
var tabhid = get(colors, 'airline_tabhid', palette.normal.airline_c)
var tabmodu = tabhid
var tabmodu_right = tabhid
if has_key(palette, 'normal_modified') && has_key(palette.normal_modified, 'airline_c')
tabmodu = get(colors, 'airline_tabmod_unsel', palette.normal_modified.airline_c)
tabmodu_right = get(colors, 'airline_tabmod_unsel_right', palette.normal_modified.airline_c)
else
# Fall back to normal airline_c if modified airline_c isn't present
tabmodu = get(colors, 'airline_tabmod_unsel', palette.normal.airline_c)
tabmodu_right = get(colors, 'airline_tabmod_unsel_right', palette.normal.airline_c)
endif
airline#highlighter#exec('airline_tablabel', tablabel)
airline#highlighter#exec('airline_tab', tab)
airline#highlighter#exec('airline_tabsel', tabsel)
airline#highlighter#exec('airline_tabtype', tabtype)
airline#highlighter#exec('airline_tabfill', tabfill)
airline#highlighter#exec('airline_tabmod', tabmod)
airline#highlighter#exec('airline_tabmod_unsel', tabmodu)
airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right)
airline#highlighter#exec('airline_tabhid', tabhid)
# Theme for tabs on the right
var tablabel_r = get(colors, 'airline_tablabel', palette.normal.airline_b)
var tabsel_right = get(colors, 'airline_tabsel_right', palette.normal.airline_a)
var tab_right = get(colors, 'airline_tab_right', palette.inactive.airline_c)
var tabmod_right = get(colors, 'airline_tabmod_right', palette.insert.airline_a)
var tabhid_right = get(colors, 'airline_tabhid_right', palette.normal.airline_c)
airline#highlighter#exec('airline_tablabel_right', tablabel_r)
airline#highlighter#exec('airline_tab_right', tab_right)
airline#highlighter#exec('airline_tabsel_right', tabsel_right)
airline#highlighter#exec('airline_tabmod_right', tabmod_right)
airline#highlighter#exec('airline_tabhid_right', tabhid_right)
return 0
enddef
def s:update_tabline(forceit: number): void
if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
return
endif
# loading a session file
# On SessionLoadPost, g:SessionLoad variable is still set :/
if !forceit && get(g:, 'SessionLoad', 0)
return
endif
var 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) || airline#util#ignore_buf(match) || isdirectory(match)
return
endif
airline#util#doautocmd('BufMRUChange')
airline#extensions#tabline#redraw()
enddef
def airline#extensions#tabline#redraw(): void
# redrawtabline should always be available
:redrawtabline
enddef
def airline#extensions#tabline#enable(): void
if &lines > 3
&showtabline = 2
endif
enddef
def airline#extensions#tabline#get(): string
var show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
var show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
var curtabcnt = tabpagenr('$')
if curtabcnt != s:current_tabcnt
s:current_tabcnt = curtabcnt
airline#extensions#tabline#tabs#invalidate()
airline#extensions#tabline#buffers#invalidate()
airline#extensions#tabline#ctrlspace#invalidate()
airline#extensions#tabline#tabws#invalidate()
endif
if !exists('#airline#BufAdd#*')
autocmd airline BufAdd * call <sid>update_tabline(0)
endif
if !exists('#airline#SessionLoadPost')
autocmd airline SessionLoadPost * call <sid>update_tabline(1)
endif
if s:ctrlspace
return airline#extensions#tabline#ctrlspace#get()
elseif s:tabws
return airline#extensions#tabline#tabws#get()
elseif show_buffers && curtabcnt == 1 || !show_tabs
return airline#extensions#tabline#buffers#get()
else
return airline#extensions#tabline#tabs#get()
endif
enddef
def airline#extensions#tabline#title(n: number): string
var title = ''
if get(g:, 'airline#extensions#taboo#enabled', 1) &&
get(g:, 'loaded_taboo', 0) && exists("*TabooTabTitle")
title = call("TabooTabTitle", [n])
endif
if empty(title)
title = gettabvar(n, 'title')
endif
var formatter = get(g:, 'airline#extensions#tabline#tabtitle_formatter', '')
if empty(title) && !empty(formatter) && exists("*" .. formatter)
title = call(formatter, [n])
endif
if empty(title)
var buflist = tabpagebuflist(n)
var winnr = tabpagewinnr(n)
var all_buffers = airline#extensions#tabline#buflist#list()
var curbuf = filter(buflist, (_, v) => index(all_buffers, v) != -1)
if len(curbuf) == 0
add(curbuf, tabpagebuflist(n)[0])
endif
return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf)
endif
return title
enddef
def airline#extensions#tabline#get_buffer_name(nr: number, buffers = airline#extensions#tabline#buflist#list()): string
var Formatter = 'airline#extensions#tabline#formatters#' .. get(g:, 'airline#extensions#tabline#formatter', 'default') .. '#format'
return call(Formatter, [ nr, buffers] )
enddef
def airline#extensions#tabline#new_builder(): dict<any>
var 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),
'left_sep': get(g:, 'airline#extensions#tabline#left_sep', g:airline_left_sep),
'left_alt_sep': get(g:, 'airline#extensions#tabline#left_alt_sep', g:airline_left_alt_sep),
}
return airline#extensions#tabline#builder#new(builder_context)
enddef
def airline#extensions#tabline#group_of_bufnr(tab_bufs: list<number>, bufnr: number): string
var cur = bufnr('%')
var group = ''
if cur == bufnr
if g:airline_detect_modified && getbufvar(bufnr, '&modified')
group = 'airline_tabmod'
else
group = 'airline_tabsel'
endif
else
if g:airline_detect_modified && getbufvar(bufnr, '&modified')
group = 'airline_tabmod_unsel'
elseif index(tab_bufs, bufnr) > -1
group = 'airline_tab'
else
group = 'airline_tabhid'
endif
endif
return group
enddef
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -30,7 +30,7 @@ function! airline#extensions#tabline#autoshow#on()
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()))
autocmd BufUnload * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()) - 1)
else
autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
autocmd TabNew,TabClosed * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
endif
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -161,16 +161,15 @@ function! s:get_number(index)
return a:index
endif
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
if bidx_mode > 1
return join(map(split(a:index+11, '\zs'), 'get(s:number_map, v:val, "")'), '')
else
return get(s:number_map, a:index+1, '')
endif
let number_format = bidx_mode > 1 ? '%02d' : '%d'
let l:count = bidx_mode == 2 ? a:index+11 : a:index+1
return join(map(split(printf(number_format, l:count), '\zs'),
\ 'get(s:number_map, v:val, "")'), '')
endfunction
function! s:select_tab(buf_index)
" no-op when called in 'keymap_ignored_filetypes'
if count(get(g:, 'airline#extensions#tabline#keymap_ignored_filetypes',
if count(get(g:, 'airline#extensions#tabline#keymap_ignored_filetypes',
\ ['vimfiler', 'nerdtree']), &ft)
return
endif
@@ -197,12 +196,13 @@ function! s:map_keys()
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
if bidx_mode > 0
if bidx_mode == 1
for i in range(1, 9)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i, i-1)
for i in range(1, 10)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i%10, i-1)
endfor
else
for i in range(11, 99)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i, i-11)
let start_idx = bidx_mode == 2 ? 11 : 1
for i in range(start_idx, 99)
exe printf('noremap <silent> <Plug>AirlineSelectTab%02d :call <SID>select_tab(%d)<CR>', i, i-start_idx)
endfor
endif
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
@@ -220,7 +220,11 @@ function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, mo
if a:clicks == 1 && a:modifiers !~# '[^ ]'
if a:button is# 'l'
" left button - switch to buffer
silent execute 'buffer' a:minwid
try
silent execute 'buffer' a:minwid
catch
call airline#util#warning("Cannot switch buffer, current buffer is modified! See :h 'hidden'")
endtry
elseif a:button is# 'm'
" middle button - delete buffer

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -8,6 +8,10 @@ function! airline#extensions#tabline#buflist#invalidate()
endfunction
function! airline#extensions#tabline#buflist#clean()
if !exists('#airline')
" airline disabled
return
endif
call airline#extensions#tabline#buflist#invalidate()
call airline#extensions#tabline#buffers#invalidate()
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -71,7 +71,7 @@ endfunction
" Compute the change in size of the tabline caused by separators
"
" This should be kept up-to-date with |s:get_transitioned_seperator| and
" This should be kept up-to-date with |s:get_transitioned_separator| and
" |s:get_separator| in autoload/airline/builder.vim
function! s:get_separator_change_with_end(new_group, old_group, new_end_group, old_end_group, sep_size, alt_sep_size)
let sep_change = 0

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2019 Kevin Sapper et al.
" MIT License. Copyright (c) 2016-2021 Kevin Sapper et al.
" Plugin: https://github.com/szw/vim-ctrlspace
" vim: et ts=2 sts=2 sw=2
@@ -24,13 +24,24 @@ function! airline#extensions#tabline#ctrlspace#on()
endfunction
function! airline#extensions#tabline#ctrlspace#invalidate()
if !exists('#airline')
return
endif
let s:current_bufnr = -1
let s:current_tabnr = -1
endfunction
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right)
let pos_extension = (a:pull_right ? '_right' : '')
let buffer_list = ctrlspace#api#BufferList(a:cur_tab)
let buffer_list = []
for bufferindex in sort(keys(ctrlspace#api#Buffers(a:cur_tab)), 'N')
for buffer in ctrlspace#api#BufferList(a:cur_tab)
if buffer['index'] == bufferindex
call add(buffer_list, buffer)
endif
endfor
endfor
" add by tenfy(tenfyzhong@qq.com)
" if the current buffer no in the buffer list

View File

@@ -1,43 +1,85 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 et
scriptencoding utf-8
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
if !exists(":def") || !airline#util#has_vim9_script()
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
let _ = ''
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
let _ = ''
let name = bufname(a:bufnr)
if empty(name)
let _ .= '[No Name]'
else
if s:fnamecollapse
" Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
"let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
let _ .= pathshorten(fnamemodify(name, fmod))
let name = bufname(a:bufnr)
if empty(name)
let _ = '[No Name]'
elseif name =~ 'term://'
" Neovim Terminal
let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
else
let _ .= fnamemodify(name, fmod)
if get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
" Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
"let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
let _ = pathshorten(fnamemodify(name, fmod))
else
let _ = fnamemodify(name, fmod)
endif
if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate
let _ = airline#util#strcharpart(_, 0, fnametruncate)
endif
endif
if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate
let _ = strpart(_, 0, s:fnametruncate)
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
endfunction
function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name)
let buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
let buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
let _ = buf_nr_show ? printf(buf_nr_format, a:bufnr) : ''
let _ .= substitute(a:buffer_name, '\\', '/', 'g')
if getbufvar(a:bufnr, '&modified') == 1
let _ .= g:airline_symbols.modified
endif
endif
return _
endfunction
finish
else
" Vim9 Script implementation
def airline#extensions#tabline#formatters#default#format(bufnr: number, buffers: list<number>): string
var fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
var fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
var result = ''
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
endfunction
var name = bufname(bufnr)
if empty(name)
result = '[No Name]'
elseif name =~ 'term://'
# Neovim Terminal
result = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
else
if get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
result = pathshorten(fnamemodify(name, fmod))
else
result = fnamemodify(name, fmod)
endif
if bufnr != bufnr('%') && fnametruncate && strlen(result) > fnametruncate
result = airline#util#strcharpart(result, 0, fnametruncate)
endif
endif
return airline#extensions#tabline#formatters#default#wrap_name(bufnr, result)
enddef
function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name)
let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : ''
let _ .= substitute(a:buffer_name, '\\', '/', 'g')
def airline#extensions#tabline#formatters#default#wrap_name(bufnr: number, buffer_name: string): string
var buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
var buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
if getbufvar(a:bufnr, '&modified') == 1
let _ .= s:buf_modified_symbol
endif
return _
endfunction
var result = buf_nr_show ? printf(buf_nr_format, bufnr) : ''
result ..= substitute(buffer_name, '\\', '/', 'g')
if getbufvar(bufnr, '&modified')
result ..= g:airline_symbols.modified
endif
return result
enddef
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -7,7 +7,7 @@ function! airline#extensions#tabline#formatters#jsformatter#format(bufnr, buffer
let buf = bufname(a:bufnr)
let filename = fnamemodify(buf, ':t')
if filename == 'index.js' || filename == 'index.jsx' || filename == 'index.ts' || filename == 'index.tsx'
if filename ==# 'index.js' || filename ==# 'index.jsx' || filename ==# 'index.ts' || filename ==# 'index.tsx' || filename ==# 'index.vue'
return fnamemodify(buf, ':p:h:t') . '/i'
else
return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers)

View File

@@ -1,18 +1,20 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
function! airline#extensions#tabline#formatters#short_path#format(bufnr, buffers)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:h:t')
let _ = ''
let name = bufname(a:bufnr)
if empty(name)
let _ .= '[No Name]'
elseif name =~ 'term://'
" Neovim Terminal
let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
else
let _ .= fnamemodify(name, ':p:h:t') . '/' . fnamemodify(name, ':t')
let _ .= fnamemodify(name, fmod) . '/' . fnamemodify(name, ':t')
endif
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)

View File

@@ -0,0 +1,36 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#tabline#formatters#short_path_improved#format(bufnr, buffers) abort
let name = bufname(a:bufnr)
if empty(name)
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, '[No Name]')
endif
let tail = s:tail(a:bufnr)
let tails = s:tails(a:bufnr, a:buffers)
if has_key(tails, tail)
" Use short path for duplicates
return airline#extensions#tabline#formatters#short_path#format(a:bufnr, a:buffers)
endif
" Use tail for unique filenames
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, tail)
endfunction
function! s:tails(self, buffers) abort
let tails = {}
for nr in a:buffers
if nr != a:self
let tails[s:tail(nr)] = 1
endif
endfor
return tails
endfunction
function! s:tail(bufnr) abort
return fnamemodify(bufname(a:bufnr), ':t')
endfunction

View File

@@ -1,15 +1,18 @@
" MIT License. Copyright (c) 2017-2019 Christian Brabandt et al.
" MIT License. Copyright (c) 2017-2021 Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist)
let spc=g:airline_symbols.space
if a:tab_nr_type == 0 " nr of splits
return spc. '%{len(tabpagebuflist('.a:nr.'))}'
elseif a:tab_nr_type == 1 " tab number
return spc. a:nr
else "== 2 splits and tab number
return spc. a:nr. '.%{len(tabpagebuflist('.a:nr.'))}'
let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
if tab_nr_type == 0 " nr of splits
return spc. len(tabpagebuflist(a:tab_nr))
elseif tab_nr_type == 1 " tab number
" Return only the current tab number
return spc. a:tab_nr
else " tab_nr_type == 2 splits and tab number
" return the tab number followed by the number of buffers (in the tab)
return spc. a:tab_nr. spc. len(tabpagebuflist(a:tab_nr))
endif
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -12,7 +12,12 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer
if empty(name)
let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, '[No Name]')
else
let tail = fnamemodify(name, ':s?/\+$??:t')
if name =~ 'term://'
" Neovim Terminal
let tail = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
else
let tail = fnamemodify(name, ':s?/\+$??:t')
endif
if has_key(tails, tail)
let duplicates[nr] = nr
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -22,7 +22,9 @@ function! airline#extensions#tabline#tabs#on()
endfunction
function! airline#extensions#tabline#tabs#invalidate()
let s:current_bufnr = -1
if exists('#airline')
let s:current_bufnr = -1
endif
endfunction
function! airline#extensions#tabline#tabs#get()
@@ -39,6 +41,8 @@ function! airline#extensions#tabline#tabs#get()
endif
endif
let s:filtered_buflist = airline#extensions#tabline#buflist#list()
let b = airline#extensions#tabline#new_builder()
call airline#extensions#tabline#add_label(b, 'tabs', 0)
@@ -50,8 +54,10 @@ function! airline#extensions#tabline#tabs#get()
let group = 'airline_tabsel'
if g:airline_detect_modified
for bi in tabpagebuflist(curtab)
if getbufvar(bi, '&modified')
let group = 'airline_tabmod'
if index(s:filtered_buflist,bi) != -1
if getbufvar(bi, '&modified')
let group = 'airline_tabmod'
endif
endif
endfor
endif
@@ -64,8 +70,7 @@ function! airline#extensions#tabline#tabs#get()
let val = '%('
if get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
let val .= airline#extensions#tabline#tabs#tabnr_formatter(tab_nr_type, a:i)
let val .= airline#extensions#tabline#tabs#tabnr_formatter(a:i, tabpagebuflist(a:i))
endif
return val.'%'.a:i.'T %{airline#extensions#tabline#title('.a:i.')} %)'
@@ -79,14 +84,16 @@ function! airline#extensions#tabline#tabs#get()
if get(g:, 'airline#extensions#tabline#show_close_button', 1)
call b.add_section('airline_tab_right', ' %999X'.
\ get(g:, 'airline#extensions#tabline#close_symbol', 'X').' ')
\ get(g:, 'airline#extensions#tabline#close_symbol', 'X').'%X ')
endif
if get(g:, 'airline#extensions#tabline#show_splits', 1) == 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.')}%)')
if index(s:filtered_buflist,nr) != -1
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right"
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
endif
endfor
if get(g:, 'airline#extensions#tabline#show_buffers', 1)
call airline#extensions#tabline#add_label(b, 'buffers', 1)
@@ -107,8 +114,8 @@ function! airline#extensions#tabline#tabs#map_keys()
endif
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
if bidx_mode == 1
for i in range(1, 9)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i, i)
for i in range(1, 10)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i%10, i)
endfor
else
for i in range(11, 99)

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2019 Kevin Sapper et al.
" MIT License. Copyright (c) 2016-2021 Kevin Sapper et al.
" PLugin: https://github.com/s1341/vim-tabws
" vim: et ts=2 sts=2 sw=2
@@ -24,8 +24,10 @@ function! airline#extensions#tabline#tabws#on()
endfunction
function! airline#extensions#tabline#tabws#invalidate()
let s:current_bufnr = -1
let s:current_tabnr = -1
if exists('#airline')
let s:current_bufnr = -1
let s:current_tabnr = -1
endif
endfunction
function! airline#extensions#tabline#tabws#add_buffer_section(builder, cur_tab, cur_buf, pull_right)

View File

@@ -1,11 +1,11 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" xTabline - Reduced version for vim-airline
" Plugin: https://github.com/mg979/vim-xtabline
" MIT License Copyright (C) 2018-2019 Gianmaria Bajo <mg1979.git@gmail.com>
" MIT License Copyright (C) 2018-2021 Gianmaria Bajo <mg1979.git@gmail.com>
" tabpagecd:
" expanded version by mg979
" MIT License Copyright (C) 2012-2013 Kana Natsuno <http://whileimautomaton.net/>
" MIT License Copyright (C) 2018-2019 Gianmaria Bajo <mg1979.git@gmail.com>
" MIT License Copyright (C) 2018-2021 Gianmaria Bajo <mg1979.git@gmail.com>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -44,7 +44,7 @@ function! airline#extensions#tabline#xtabline#init()
autocmd TabLeave * call s:Do('leave')
autocmd TabClosed * call s:Do('close')
autocmd BufEnter * let g:xtabline_changing_buffer = 0
autocmd BufEnter * if exists('#airline') | let g:xtabline_changing_buffer = 0 | endif
autocmd BufAdd,BufDelete,BufWrite * call airline#extensions#tabline#xtabline#filter_buffers()
augroup END
@@ -180,6 +180,10 @@ function! airline#extensions#tabline#xtabline#filter_buffers()
" 'accepted' is a list of buffer numbers, for quick access.
" 'excluded' is a list of buffer numbers, it will be used by Airline to hide buffers.
if !exists('#airline')
" airline disabled
return
endif
if !s:xtabline_filtering | return | endif
let g:airline#extensions#tabline#exclude_buffers = []
@@ -351,6 +355,10 @@ endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:Do(action)
if !exists('#airline')
" airline disabled
return
endif
let arg = a:action
if !s:state | call s:InitCwds() | return | endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/majutsushi/tagbar
" vim: et ts=2 sts=2 sw=2
@@ -8,7 +8,6 @@ if !exists(':TagbarToggle')
finish
endif
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
let s:spc = g:airline_symbols.space
let s:init=0
@@ -35,15 +34,21 @@ function! airline#extensions#tagbar#currenttag()
try
" try to load the plugin, if filetypes are disabled,
" this will cause an error, so try only once
let a=tagbar#currenttag('%', '', '')
let a = tagbar#currenttag('%s', '', '')
catch
endtry
unlet! a
let s:init=1
endif
let cursize = getfsize(fnamemodify(bufname('%'), ':p'))
if cursize > 0 && cursize > get(g:, 'airline#extensions#tagbar#max_filesize', 1024 * 1024)
return ''
endif
let flags = get(g:, 'airline#extensions#tagbar#flags', '')
" function tagbar#currenttag does not exist, if filetype is not enabled
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', flags,
\ get(g:, 'airline#extensions#tagbar#searchmethod', 'nearest-stl'))
let s:airline_tagbar_last_lookup_time = localtime()
endif
return s:airline_tagbar_last_lookup_val

View File

@@ -0,0 +1,37 @@
" MIT License. Copyright (c) 2021 DEMAREST Maxime (maxime@indelog.fr)
" Plugin: https://github.com/yegappan/taglist/
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists(':TlistShowTag')
finish
endif
function! airline#extensions#taglist#currenttag()
" Update tag list if taglist is not loaded (else we get an empty tag name)
" Load yegappan/taglist and vim-scripts/taglist.vim only once.
let tlist_updated = 0
if !exists('*taglist#Tlist_Get_Tagname_By_Line()') && !exists('*Tlist_Get_Tagname_By_Line()')
TlistUpdate
let tlist_updated = 1
endif
if !tlist_updated && exists('*Tlist_Get_Filenames()')
let tlist_filenames = Tlist_Get_Filenames()
if stridx(type(tlist_filenames) == type([]) ? join(tlist_filenames, '\n') : tlist_filenames, expand('%:p')) < 0
TlistUpdate
endif
endif
" Is this function is not present it'means you use the old vertsion of
" tag list : https://github.com/vim-scripts/taglist.vim.
" Please use the new version : https://github.com/yegappan/taglist.
if exists('*taglist#Tlist_Get_Tagname_By_Line()')
return taglist#Tlist_Get_Tagname_By_Line()
else
return ''
endif
endfunction
function! airline#extensions#taglist#init(ext)
call airline#parts#define_function('taglist', 'airline#extensions#taglist#currenttag')
endfunction

View File

@@ -1,55 +1,79 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
call airline#parts#define_function('tmode', 'airline#extensions#term#termmode')
call airline#parts#define('terminal', {'text': get(g:airline_mode_map, 't', 't'), 'accent': 'bold'})
let s:section_a = airline#section#create_left(['terminal', 'tmode'])
function! airline#extensions#term#apply(...)
if &buftype == 'terminal' || bufname('%')[0] == '!'
function! s:GetAirlineSection()
if exists("g:airline_section_z_term")
let section_z = g:airline_section_z_term
else
let section_z = airline#section#create(['linenr', 'maxlinenr'])
endif
if exists("g:airline_section_a_term")
let section_a = g:airline_section_a_term
else
let section_a = airline#section#create_left(['terminal', 'tmode'])
endif
return [section_a, section_z]
endfunction
function! airline#extensions#term#apply(...) abort
if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!'
let sections = s:GetAirlineSection()
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.s:section_a.spc)
call a:1.add_section('airline_b', '')
call a:1.add_section('airline_term', spc.s:termname())
call a:1.add_section_spaced('airline_a', sections[0])
call a:1.add_section_spaced('airline_b', s:neoterm_id(a:2.bufnr))
call a:1.add_section('airline_term', spc.s:termname(a:2.bufnr))
call a:1.split()
call a:1.add_section('airline_y', '')
call a:1.add_section('airline_z', spc.airline#section#create_right(['linenr', 'maxlinenr']))
call a:1.add_section_spaced('airline_z', sections[1])
return 1
endif
endfunction
function! airline#extensions#term#inactive_apply(...)
if getbufvar(a:2.bufnr, '&buftype') == 'terminal'
function! airline#extensions#term#inactive_apply(...) abort
if getbufvar(a:2.bufnr, '&buftype') ==? 'terminal'
let sections = s:GetAirlineSection()
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'TERMINAL'.spc)
call a:1.add_section('airline_b', spc.'%f')
let neoterm_id = getbufvar(a:2.bufnr, 'neoterm_id')
if neoterm_id != ''
call a:1.add_section('airline_c', spc.'neoterm_'.neoterm_id.spc)
endif
call a:1.add_section_spaced('airline_a', sections[0])
call a:1.add_section_spaced('airline_b', s:neoterm_id(a:2.bufnr))
call a:1.add_section('airline_term', spc.s:termname(a:2.bufnr))
call a:1.split()
call a:1.add_section('airline_y', '')
call a:1.add_section_spaced('airline_z', sections[1])
return 1
endif
endfunction
function! airline#extensions#term#termmode()
function! airline#extensions#term#termmode() abort
let mode = airline#parts#mode()[0]
if mode ==? 'T'
" don't need to output T, statusline already says "TERMINAL"
let mode=''
if mode ==? 'T' || mode ==? '-'
" We don't need to output T, the statusline already says "TERMINAL".
" Also we don't want to output "-" on an inactive statusline.
let mode = ''
endif
return mode
endfunction
function! s:termname()
let bufname = bufname('%')
function! s:termname(bufnr) abort
let bufname = bufname(a:bufnr)
if has('nvim')
return matchstr(bufname, 'term.*:\zs.*')
" Get rid of the leading "term", working dir and process ID.
" Afterwards, remove the possibly added neoterm ID.
return substitute(matchstr(bufname, 'term.*:\zs.*'),
\ ';#neoterm-\d\+', '', '')
else
" get rid of leading '!'
if bufname[0] is# '!'
if bufname =~? 'neoterm-\d\+'
" Do not return a redundant buffer name, when this is a neoterm terminal.
return ''
endif
" Get rid of the leading "!".
if bufname[0] ==? '!'
return bufname[1:]
else
return bufname
@@ -57,7 +81,15 @@ function! s:termname()
endif
endfunction
function! airline#extensions#term#init(ext)
function! s:neoterm_id(bufnr) abort
let id = getbufvar(a:bufnr, 'neoterm_id')
if id !=? ''
let id = 'neoterm-'.id
endif
return id
endfunction
function! airline#extensions#term#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#term#apply')
call a:ext.add_inactive_statusline_func('airline#extensions#term#inactive_apply')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/edkolev/tmuxline.vim
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/mbbill/undotree
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/unicode.vim
" vim: et ts=2 sts=2 sw=2
@@ -9,7 +9,7 @@ if !get(g:, 'loaded_unicodePlugin', 0)
endif
function! airline#extensions#unicode#apply(...)
if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable'
if exists(':UnicodeTable') == 2 && bufname('') =~# '/UnicodeTable.txt'
call airline#parts#define('unicode', {
\ 'text': '[UnicodeTable]',
\ 'accent': 'bold' })

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/Shougo/unite.vim
" vim: et ts=2 sts=2 sw=2

View File

@@ -0,0 +1,27 @@
" MIT License. Copyright (c) 2021 DEMAREST Maxime (maxime@indelog.fr)
" Plugin: https://github.com/yegappan/lsp
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists('*lsp#lsp#ErrorCount')
finish
endif
let s:error_symbol = get(g:, 'airline#extensions#vim9lsp#error_symbol', 'E:')
let s:warning_symbol = get(g:, 'airline#extensions#vim9lsp#warning_symbol', 'W:')
function! airline#extensions#vim9lsp#get_warnings() abort
let res = get(lsp#lsp#ErrorCount(), 'Warn', 0)
return res > 0 ? s:warning_symbol . res : ''
endfunction
function! airline#extensions#vim9lsp#get_errors() abort
let res = get(lsp#lsp#ErrorCount(), 'Error', 0)
return res > 0 ? s:error_symbol . res : ''
endfunction
function! airline#extensions#vim9lsp#init(ext) abort
call airline#parts#define_function('vim9lsp_warning_count', 'airline#extensions#vim9lsp#get_warnings')
call airline#parts#define_function('vim9lsp_error_count', 'airline#extensions#vim9lsp#get_errors')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2019 Jerome Reybert et al.
" MIT License. Copyright (c) 2016-2021 Jerome Reybert et al.
" Plugin: https://github.com/jreybert/vimagit
" vim: et ts=2 sts=2 sw=2
@@ -9,26 +9,21 @@ if !get(g:, 'loaded_magit', 0)
finish
endif
function! airline#extensions#vimagit#init(ext)
let s:commit_mode = {'ST': 'STAGING', 'CC': 'COMMIT', 'CA': 'AMEND'}
function! airline#extensions#vimagit#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#vimagit#apply')
endfunction
function! airline#extensions#vimagit#get_mode()
function! airline#extensions#vimagit#get_mode() abort
if ( exists("*magit#get_current_mode") )
return magit#get_current_mode()
else
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 "???"
endif
return get(s:commit_mode, b:magit_current_commit_mode, '???')
endif
endfunction
function! airline#extensions#vimagit#apply(...)
function! airline#extensions#vimagit#apply(...) abort
if ( &filetype == 'magit' )
let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}'
endif

View File

@@ -0,0 +1,30 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/cdelledonne/vim-cmake
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#vimcmake#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#vimcmake#apply')
call a:ext.add_inactive_statusline_func('airline#extensions#vimcmake#inactive_apply')
endfunction
function! airline#extensions#vimcmake#apply(...) abort
if &filetype ==# 'vimcmake'
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'CMake'.spc)
call a:1.add_section('airline_b', spc.'%{cmake#statusline#GetBuildInfo(1)}'.spc)
call a:1.add_section('airline_c', spc.'%{cmake#statusline#GetCmdInfo()}'.spc)
return 1
endif
endfunction
function! airline#extensions#vimcmake#inactive_apply(...) abort
if getbufvar(a:2.bufnr, '&filetype') ==# 'vimcmake'
let spc = g:airline_symbols.space
call a:1.add_section('airline_a', spc.'[CMake]')
call a:1.add_section('airline_b', spc.'%{cmake#statusline#GetBuildInfo(0)}')
call a:1.add_section('airline_c', spc.'%{cmake#statusline#GetCmdInfo()}')
return 1
endif
endfunction

View File

@@ -0,0 +1,25 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/VimfanTPdvorak/vimodoro.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists(':RTM')
finish
endif
function! airline#extensions#vimodoro#apply(...) abort
if exists('t:vimodoro')
if &ft ==# 'vimodoro'
if exists(':PomodoroStatus')
call airline#extensions#apply_left_override('vimodoro', '%{PomodoroStatus(1)}')
else
call airline#extensions#apply_left_override('vimodoro', g:airline_section_y)
endif
endif
endif
endfunction
function! airline#extensions#vimodoro#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#vimodoro#apply')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/lervag/vimtex
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/jmcantrell/vim-virtualenv
" vim: et ts=2 sts=2 sw=2
@@ -11,7 +11,7 @@ function! airline#extensions#virtualenv#init(ext)
endfunction
function! airline#extensions#virtualenv#apply(...)
if &filetype =~# "python"
if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1
if get(g:, 'virtualenv_loaded', 0)
let statusline = virtualenv#statusline()
else
@@ -25,7 +25,7 @@ function! airline#extensions#virtualenv#apply(...)
endfunction
function! airline#extensions#virtualenv#update()
if &filetype =~# "python"
if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1
call airline#extensions#virtualenv#apply()
call airline#update_statusline()
endif

View File

@@ -1,15 +1,18 @@
" MIT License. Copyright (c) 2019 s1341 (github@shmarya.net)
" Plugin: https://github.com/liuchngxu/vista.vim
" MIT License. Copyright (c) 2021 s1341 (github@shmarya.net)
" Plugin: https://github.com/liuchengxu/vista.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_vista', 0)
finish
endif
function! airline#extensions#vista#currenttag()
function! airline#extensions#vista#currenttag() abort
if get(w:, 'airline_active', 0)
return get(b:, 'vista_nearest_method_or_function', '')
return airline#util#shorten(get(b:, 'vista_nearest_method_or_function', ''), 91, 9)
endif
endfunction
function! airline#extensions#vista#init(ext)
function! airline#extensions#vista#init(ext) abort
call airline#parts#define_function('vista', 'airline#extensions#vista#currenttag')
endfunction

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
@@ -10,7 +10,9 @@ let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts']
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file']}
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'],
\ 'csv': ['indent', 'mixed-indent-file'],
\ 'mail': ['trailing']}
function! s:check_mixed_indent()
let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
@@ -23,9 +25,9 @@ function! s:check_mixed_indent()
let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)'
return search('\v' . t_s_t . '|' . t_l_s, 'nw')
elseif indent_algo == 2
return search('\v(^\t* +\t\s*\S)', 'nw')
return search('\v(^\t* +\t\s*\S)', 'nw', 0, 500)
else
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
return search('\v(^\t+ +)|(^ +\t+)', 'nw', 0, 500)
endif
endfunction
@@ -50,7 +52,12 @@ endfunction
function! s:conflict_marker()
" Checks for git conflict markers
let annotation = '\%([0-9A-Za-z_.:]\+\)\?'
let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(=\{7\}\)\|\%(>\{7\} '.annotation.'\)\)$'
if match(['rst', 'markdown', 'rmd'], &ft) >= 0
" rst filetypes use '=======' as header
let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(>\{7\} '.annotation.'\)\)$'
else
let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(=\{7\}\)\|\%(>\{7\} '.annotation.'\)\)$'
endif
return search(pattern, 'nw')
endfunction
@@ -71,7 +78,8 @@ function! airline#extensions#whitespace#check()
let check = 'trailing'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
try
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
let regexp = get(b:, 'airline_whitespace_trailing_regexp',
\ get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$'))
let trailing = search(regexp, 'nw')
catch
call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp))
@@ -176,6 +184,10 @@ function! airline#extensions#whitespace#init(...)
endfunction
function! s:ws_refresh()
if !exists('#airline')
" airline disabled
return
endif
if get(b:, 'airline_ws_changedtick', 0) == b:changedtick
return
endif

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" Plugin: https://github.com/wesQ3/vim-windowswap
" vim: et ts=2 sts=2 sw=2

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 fdm=marker
scriptencoding utf-8
@@ -9,8 +9,18 @@ if exists('*wordcount')
if get(g:, 'actual_curbuf', '') != bufnr('')
return
endif
let query = a:visual_mode_active ? 'visual_words' : 'words'
return get(wordcount(), query, 0)
if &filetype ==# 'tex' && exists('b:vimtex') && get(g:, 'airline#extensions#vimtex#wordcount', 0)
" We're in a TeX file and vimtex is a plugin, so use vimtex's wordcount...
if a:visual_mode_active
" not useful?
return
else
return vimtex#misc#wordcount()
endif
else
let query = a:visual_mode_active ? 'visual_words' : 'words'
return get(wordcount(), query, 0)
endif
endfunction
else " Pull wordcount from the g_ctrl-g stats
function! s:get_wordcount(visual_mode_active)
@@ -86,17 +96,19 @@ endfunction
" airline functions {{{1
" default filetypes:
function! airline#extensions#wordcount#apply(...)
let filetypes = get(g:, 'airline#extensions#wordcount#filetypes',
\ ['asciidoc', 'help', 'mail', 'markdown', 'org', 'rst', 'tex', 'text'])
let filetypes = get(g:, 'airline#extensions#wordcount#filetypes',
\ ['asciidoc', 'help', 'mail', 'markdown', 'rmd', 'nroff', 'org', 'rst', 'plaintex', 'tex', 'text'])
" export current filetypes settings to global namespace
let g:airline#extensions#wordcount#filetypes = filetypes
" Check if filetype needs testing
if did_filetype()
" correctly test for compound filetypes (e.g. markdown.pandoc)
let ft = substitute(&filetype, '\.', '\\|', 'g')
" Select test based on type of "filetypes": new=list, old=string
if type(filetypes) == get(v:, 't_list', type([]))
\ ? index(filetypes, &filetype) > -1 || index(filetypes, 'all') > -1
\ ? match(filetypes, '\<'. ft. '\>') > -1 || index(filetypes, 'all') > -1
\ : match(&filetype, filetypes) > -1
let b:airline_changedtick = -1
call s:update_wordcount(1) " force update: ensures initial worcount exists

View File

@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
@@ -10,6 +10,7 @@ endfunction
" Reload format when statusline is rebuilt
call airline#extensions#wordcount#formatters#default#update_fmt()
if index(g:airline_statusline_funcrefs, function('airline#extensions#wordcount#formatters#default#update_fmt')) == -1
" only add it, if not already done
call airline#add_statusline_funcref(function('airline#extensions#wordcount#formatters#default#update_fmt'))
@@ -35,5 +36,12 @@ function! airline#extensions#wordcount#formatters#default#to_string(wordcount)
else
let str = printf(s:fmt_short, a:wordcount)
endif
return str . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
let str .= g:airline_symbols.space
if !empty(g:airline_right_alt_sep)
let str .= g:airline_right_alt_sep . g:airline_symbols.space
endif
return str
endfunction

View File

@@ -0,0 +1,47 @@
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#wordcount#formatters#readingtime#update_fmt(...) abort
let s:fmt = get(g:, 'airline#extensions#wordcount#formatter#readingtime#fmt', 'About %s minutes')
let s:fmt_short = get(g:, 'airline#extensions#wordcount#formatter#readingtime#fmt_short', s:fmt ==# 'About %s minutes' ? '%sW' : s:fmt)
endfunction
" Reload format when statusline is rebuilt
call airline#extensions#wordcount#formatters#readingtime#update_fmt()
if index(g:airline_statusline_funcrefs, function('airline#extensions#wordcount#formatters#readingtime#update_fmt')) == -1
" only add it, if not already done
call airline#add_statusline_funcref(function('airline#extensions#wordcount#formatters#readingtime#update_fmt'))
endif
if match(get(v:, 'lang', ''), '\v\cC|en') > -1
let s:decimal_group = ','
elseif match(get(v:, 'lang', ''), '\v\cde|dk|fr|pt') > -1
let s:decimal_group = '.'
else
let s:decimal_group = ''
endif
function! airline#extensions#wordcount#formatters#readingtime#to_string(wordcount) abort
if airline#util#winwidth() > 85
if a:wordcount > 999
" Format number according to locale, e.g. German: 1.245 or English: 1,245
let wordcount = substitute(a:wordcount, '\d\@<=\(\(\d\{3\}\)\+\)$', s:decimal_group.'&', 'g')
else
let wordcount = a:wordcount
endif
let str = printf(s:fmt, ceil(wordcount / 200.0))
else
let str = printf(s:fmt_short, ceil(a:wordcount / 200.0))
endif
let str .= g:airline_symbols.space
if !empty(g:airline_right_alt_sep)
let str .= g:airline_right_alt_sep . g:airline_symbols.space
endif
return str
endfunction

View File

@@ -1,17 +1,37 @@
" MIT License. Copyright (c) 2017-2019 YoungHoon Rhiu et al.
" MIT License. Copyright (c) 2017-2021 YoungHoon Rhiu et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !exists('g:XkbSwitchLib')
if !exists('g:XkbSwitchLib') && !exists('*FcitxCurrentIM') && !has('nvim')
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 = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
if exists('g:XkbSwitchLib')
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '')
elseif exists('*FcitxCurrentIMwithRime')
let keyboard_layout = FcitxCurrentIMwithRime()
elseif exists('*FcitxCurrentIM')
let keyboard_layout = FcitxCurrentIM()
elseif has('nvim')
try
let keyboard_layout = luaeval('require"ime".current()')
catch /.*/
try
let keyboard_layout = luaeval('require"fcitx5-ui".displayCurrentIM()')
catch /.*/
let keyboard_layout = ''
endtry
endtry
else
let keyboard_layout = ''
endif
" substitute keyboard-us to us
let keyboard_layout = substitute(keyboard_layout, 'keyboard-', '', 'g')
let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
if has_key(short_codes, keyboard_layout)
let keyboard_layout = short_codes[keyboard_layout]
endif

View File

@@ -1,8 +1,13 @@
" MIT License. Copyright (c) 2015-2019 Evgeny Firsov et al.
" MIT License. Copyright (c) 2015-2021 Evgeny Firsov et al.
" Plugin: https://github.com/ycm-core/YouCompleteMe
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_youcompleteme', 0)
finish
endif
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:')
@@ -12,8 +17,8 @@ function! airline#extensions#ycm#init(ext)
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")
function! airline#extensions#ycm#get_error_count() abort
if exists("*youcompleteme#GetErrorCount")
let cnt = youcompleteme#GetErrorCount()
if cnt != 0
@@ -25,7 +30,7 @@ function! airline#extensions#ycm#get_error_count()
endfunction
function! airline#extensions#ycm#get_warning_count()
if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount")
if exists("*youcompleteme#GetWarningCount")
let cnt = youcompleteme#GetWarningCount()
if cnt != 0

View File

@@ -0,0 +1,27 @@
" MIT License. Copyright (c) 2021 Dmitry Geurkov (d.geurkov@gmail.com)
" Plugin: https://github.com/troydm/zoomwintab.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
" Avoid installing twice
if exists('g:loaded_vim_airline_zoomwintab')
finish
endif
let g:loaded_vim_airline_zoomwintab = 1
let s:zoomwintab_status_zoomed_in =
\ get(g:, 'airline#extensions#zoomwintab#status_zoomed_in', g:airline_left_alt_sep.' Zoomed')
let s:zoomwintab_status_zoomed_out =
\ get(g:, 'airline#extensions#zoomwintab#status_zoomed_out', '')
function! airline#extensions#zoomwintab#apply(...) abort
call airline#extensions#prepend_to_section('gutter',
\ exists('t:zoomwintab') ? s:zoomwintab_status_zoomed_in : s:zoomwintab_status_zoomed_out)
endfunction
function! airline#extensions#zoomwintab#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#zoomwintab#apply')
endfunction

View File

@@ -0,0 +1,8 @@
scriptencoding utf-8
function! airline#formatter#short_path#format(val) abort
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
return '%{pathshorten(expand("'.a:val.'"))}'
endif
return a:val
endfunction

View File

@@ -1,319 +1,685 @@
" MIT License. Copyright (c) 2013-2019 Bailey Ling Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2
" MIT License. Copyright (c) 2013-2021 Bailey Ling Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2 et
scriptencoding utf-8
let s:is_win32term = (has('win32') || has('win64')) &&
\ !has('gui_running') &&
\ (empty($CONEMUBUILD) || &term !=? 'xterm') &&
\ empty($WT_SESSION) &&
\ !(exists("+termguicolors") && &termguicolors)
let s:separators = {}
let s:accents = {}
let s:hl_groups = {}
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)
endfunction
if !exists(":def") || !airline#util#has_vim9_script()
function! s:group_not_done(list, name)
if index(a:list, a:name) == -1
call add(a:list, a:name)
return 1
else
if &vbs
echomsg printf("airline: group: %s already done, skipping", a:name)
" Legacy Vimscript implementation
function! s:gui2cui(rgb, fallback) abort
if a:rgb == ''
return a:fallback
elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1
return a:rgb
elseif a:rgb[0] !~ '#'
" a:rgb contains colorname
return a:rgb
endif
return 0
endif
endfu
let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)')
return airline#msdos#round_msdos_colors(rgb)
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)
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'
endif
endif
return color
endfunction
function! s:get_array(fg, bg, opts)
let opts=empty(a:opts) ? '' : join(a:opts, ',')
return g:airline_gui_mode ==# 'gui'
\ ? [ a:fg, a:bg, '', '', opts ]
\ : [ '', '', a:fg, a:bg, opts ]
endfunction
function! airline#highlighter#reset_hlcache()
let s:hl_groups = {}
endfunction
function! airline#highlighter#get_highlight(group, ...)
let reverse = get(g:, 'airline_gui_mode', '') ==# 'gui'
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
let res = s:hl_groups[a:group]
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
else
let fg = s:get_syn(a:group, 'fg')
let bg = s:get_syn(a:group, 'bg')
let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
if reverse
let res = s:get_array(bg, fg, bold ? ['bold'] : a:000)
function! s:group_not_done(list, name) abort
if index(a:list, a:name) == -1
call add(a:list, a:name)
return 1
else
let res = s:get_array(fg, bg, bold ? ['bold'] : a:000)
if &vbs
echomsg printf("airline: group: %s already done, skipping", a:name)
endif
return 0
endif
endif
let s:hl_groups[a:group] = res
return res
endfunction
endfu
function! airline#highlighter#get_highlight2(fg, bg, ...)
let fg = s:get_syn(a:fg[0], a:fg[1])
let bg = s:get_syn(a:bg[0], a:bg[1])
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
if g:airline_gui_mode ==# 'gui'
let new_hi = [colors[0], colors[1], '', '', colors[4]]
else
let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]]
endif
let colors = s:CheckDefined(colors)
if old_hi != new_hi || !s:hl_group_exists(a:group)
let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
exe cmd
if has_key(s:hl_groups, a:group)
let s:hl_groups[a:group] = colors
function! s:get_syn(group, what, mode) abort
let color = ''
if hlexists(a:group)
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode)
endif
endif
endfunction
if empty(color) || color == -1
" should always exist
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, a:mode)
" however, just in case
if empty(color) || color == -1
let color = 'NONE'
endif
endif
return color
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
function! s:get_array(guifg, guibg, ctermfg, ctermbg, opts) abort
return [ a:guifg, a:guibg, a:ctermfg, a:ctermbg, empty(a:opts) ? '' : join(a:opts, ',') ]
endfunction
" 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
function! airline#highlighter#reset_hlcache() abort
let s:hl_groups = {}
endfunction
for val in a:colors
if !empty(val) && val !=# 'NONE'
function! airline#highlighter#get_highlight(group, ...) abort
" only check for the cterm reverse attribute
" TODO: do we need to check all modes (gui, term, as well)?
let reverse = synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
let res = s:hl_groups[a:group]
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
else
let ctermfg = s:get_syn(a:group, 'fg', 'cterm')
let ctermbg = s:get_syn(a:group, 'bg', 'cterm')
let guifg = s:get_syn(a:group, 'fg', 'gui')
let guibg = s:get_syn(a:group, 'bg', 'gui')
let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
if reverse
let res = s:get_array(guibg, guifg, ctermbg, ctermfg, bold ? ['bold'] : a:000)
else
let res = s:get_array(guifg, guibg, ctermfg, ctermbg, bold ? ['bold'] : a:000)
endif
endif
let s:hl_groups[a:group] = res
return res
endfunction
function! airline#highlighter#get_highlight2(fg, bg, ...) abort
let guifg = s:get_syn(a:fg[0], a:fg[1], 'gui')
let guibg = s:get_syn(a:bg[0], a:bg[1], 'gui')
let ctermfg = s:get_syn(a:fg[0], a:fg[1], 'cterm')
let ctermbg = s:get_syn(a:bg[0], a:bg[1], 'cterm')
return s:get_array(guifg, guibg, ctermfg, ctermbg, a:000)
endfunction
function! s:hl_group_exists(group) abort
if !hlexists(a:group)
return 0
elseif empty(synIDattr(synIDtrans(hlID(a:group)), 'fg'))
return 0
endif
return 1
endfunction
function! s:CheckDefined(colors) abort
" 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
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:GetHiCmd(list)
" a:list needs to have 5 items!
let res = ''
let i = -1
while i < 4
let i += 1
let item = get(a:list, i, '')
if item is ''
continue
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 empty(bg) || bg < 0
" in case there is no background color defined for Normal
let bg = a:colors[3]
endif
if i == 0
let res .= ' guifg='.item
elseif i == 1
let res .= ' guibg='.item
elseif i == 2
let res .= ' ctermfg='.item
elseif i == 3
let res .= ' ctermbg='.item
elseif i == 4
let res .= printf(' gui=%s cterm=%s term=%s', item, item, item)
endif
endwhile
return res
endfunction
return a:colors[0:1] + [fg, bg] + [a:colors[4]]
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix)
if pumvisible()
return
endif
let group = a:from.'_to_'.a:to.a:suffix
let l:from = airline#themes#get_highlight(a:from.a:suffix)
let l:to = airline#themes#get_highlight(a:to.a:suffix)
if a:inverse
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
else
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
endif
let a:dict[group] = colors
call airline#highlighter#exec(group, colors)
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
endfunction
function! airline#highlighter#add_separator(from, to, inverse)
let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
endfunction
function! airline#highlighter#add_accent(accent)
let s:accents[a:accent] = 1
endfunction
function! airline#highlighter#highlight_modified_inactive(bufnr)
if getbufvar(a:bufnr, '&modified')
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
else
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
endif
if !empty(colors)
call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
endif
endfunction
function! airline#highlighter#highlight(modes, ...)
let bufnr = a:0 ? a:1 : ''
let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
let airline_grouplist = []
let buffers_in_tabpage = sort(tabpagebuflist())
if exists("*uniq")
let buffers_in_tabpage = uniq(buffers_in_tabpage)
endif
" mapped might be something like ['normal', 'normal_modified']
" if a group is in both modes available, only define the second
" that is how this was done previously overwrite the previous definition
for mode in reverse(mapped)
if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
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
" do not re-create highlighting for buffers that are no longer visible
" in the current tabpage
if name =~# 'airline_c\d\+'
let bnr = matchstr(name, 'airline_c\zs\d\+') + 0
if bnr > 0 && index(buffers_in_tabpage, bnr) == -1
continue
endif
elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix))
" group will be redefined below at exec_separator
" or is not needed for tabline with '_inactive' suffix
" since active flag is 1 for builder)
continue
endif
if s:group_not_done(airline_grouplist, name.suffix)
call airline#highlighter#exec(name.suffix, mode_colors)
endif
for accent in keys(s:accents)
if !has_key(p.accents, accent)
continue
endif
let colors = copy(mode_colors)
if p.accents[accent][0] != ''
let colors[0] = p.accents[accent][0]
endif
if p.accents[accent][2] != ''
let colors[2] = p.accents[accent][2]
endif
if len(colors) >= 5
let colors[4] = get(p.accents[accent], 4, '')
else
call add(colors, get(p.accents[accent], 4, ''))
endif
if s:group_not_done(airline_grouplist, name.suffix.'_'.accent)
call airline#highlighter#exec(name.suffix.'_'.accent, colors)
endif
endfor
endfor
if empty(s:separators)
" nothing to be done
function! s:GetHiCmd(list) abort
" a:list needs to have 5 items!
let res = ''
let i = -1
while i < 4
let i += 1
let item = get(a:list, i, '')
if item is ''
continue
endif
" TODO: optimize this
for sep in items(s:separators)
" we cannot check, that the group already exists, else the separators
" might not be correctly defined. But perhaps we can skip above groups
" that match the '_to_' name, because they would be redefined here...
call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
endfor
if i == 0
let res .= ' guifg='.item
elseif i == 1
let res .= ' guibg='.item
elseif i == 2
let res .= ' ctermfg='.item
elseif i == 3
let res .= ' ctermbg='.item
elseif i == 4
let res .= printf(' gui=%s cterm=%s term=%s', item, item, item)
endif
endwhile
return res
endfunction
function! airline#highlighter#load_theme() abort
if pumvisible()
return
endif
endfor
endfunction
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' ) && &buftype != 'terminal'
call airline#highlighter#highlight(['normal', 'modified'])
else
call airline#highlighter#highlight(['normal'])
endif
endfunction
function! airline#highlighter#add_accent(accent) abort
let s:accents[a:accent] = 1
endfunction
function! airline#highlighter#add_separator(from, to, inverse) abort
let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix) abort
if pumvisible()
return
endif
let group = a:from.'_to_'.a:to.a:suffix
let l:from = airline#themes#get_highlight(a:from.a:suffix)
let l:to = airline#themes#get_highlight(a:to.a:suffix)
if a:inverse
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
else
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
endif
let a:dict[group] = colors
call airline#highlighter#exec(group, colors)
endfunction
function! airline#highlighter#highlight_modified_inactive(bufnr) abort
if getbufvar(a:bufnr, '&modified')
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
else
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
endif
if !empty(colors)
call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
endif
endfunction
function! airline#highlighter#exec(group, colors) abort
if pumvisible()
return
endif
let colors = a:colors
if len(colors) == 4
call add(colors, '')
endif
" colors should always be string values
let colors = map(copy(colors), 'type(v:val) != type("") ? string(v:val) : v:val')
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)
let new_hi = [colors[0], colors[1], printf('%s', colors[2]), printf('%s', colors[3]), colors[4]]
let colors = s:CheckDefined(colors)
if old_hi != new_hi || !s:hl_group_exists(a:group)
let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
try
exe cmd
catch /^Vim\%((\a\+)\)\=:E421:/ " color definition not found
let group=matchstr(v:exception, '\w\+\ze=')
let color=matchstr(v:exception, '=\zs\w\+')
let cmd=substitute(cmd, color, 'grey', 'g')
exe cmd
call airline#util#warning('color definition for group ' . a:group . ' not found, using grey as fallback')
catch
call airline#util#warning('Error when running command: '. cmd)
endtry
if has_key(s:hl_groups, a:group)
let s:hl_groups[a:group] = colors
endif
endif
endfunction
function! airline#highlighter#highlight(modes, ...) abort
let bufnr = a:0 ? a:1 : ''
let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
let airline_grouplist = []
let buffers_in_tabpage = sort(tabpagebuflist())
if exists("*uniq")
let buffers_in_tabpage = uniq(buffers_in_tabpage)
endif
" mapped might be something like ['normal', 'normal_modified']
" if a group is in both modes available, only define the second
" that is how this was done previously overwrite the previous definition
for mode in reverse(mapped)
if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
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
" do not re-create highlighting for buffers that are no longer visible
" in the current tabpage
if name =~# 'airline_c\d\+'
let bnr = matchstr(name, 'airline_c\zs\d\+') + 0
if bnr > 0 && index(buffers_in_tabpage, bnr) == -1
continue
endif
elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix))
" group will be redefined below at exec_separator
" or is not needed for tabline with '_inactive' suffix
" since active flag is 1 for builder)
continue
endif
if s:group_not_done(airline_grouplist, name.suffix)
call airline#highlighter#exec(name.suffix, mode_colors)
endif
if !has_key(p, 'accents')
" work around a broken installation
" shouldn't actually happen, p should always contain accents
continue
endif
for accent in keys(s:accents)
if !has_key(p.accents, accent)
continue
endif
let colors = copy(mode_colors)
if p.accents[accent][0] != ''
let colors[0] = p.accents[accent][0]
endif
if p.accents[accent][2] != ''
let colors[2] = p.accents[accent][2]
endif
if len(colors) >= 5
let colors[4] = get(p.accents[accent], 4, '')
else
call add(colors, get(p.accents[accent], 4, ''))
endif
if s:group_not_done(airline_grouplist, name.suffix.'_'.accent)
call airline#highlighter#exec(name.suffix.'_'.accent, colors)
endif
endfor
endfor
if empty(s:separators)
" nothing to be done
continue
endif
" TODO: optimize this
for sep in items(s:separators)
" we cannot check, that the group already exists, else the separators
" might not be correctly defined. But perhaps we can skip above groups
" that match the '_to_' name, because they would be redefined here...
call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
endfor
endif
endfor
endfunction
" End legacy VimScript
finish
else
" This is using Vim9 script
def s:gui2cui(rgb: string, fallback: string): string
if empty(rgb)
return fallback
elseif match(rgb, '^\%(NONE\|[fb]g\)$') > -1
return rgb
elseif rgb !~ '#'
# rgb contains colorname
return rgb
endif
var _rgb = []
_rgb = mapnew(split(rgb[1 : ], '..\zs'), (_, v) => ('0x' .. v)->str2nr(16))
return airline#msdos#round_msdos_colors(_rgb)
enddef
def s:group_not_done(list: list<string>, name: string): bool
if index(list, name) == -1
add(list, name)
return true
else
if &vbs
echomsg printf("airline: group: %s already done, skipping", name)
endif
return false
endif
enddef
def s:get_syn(group: string, what: string, mode: string): string
var color = ''
if hlexists(group)
color = hlID(group)->synIDtrans()->synIDattr(what, mode)
endif
if empty(color) || str2nr(color) == -1
# Normal highlighting group should always exist
color = hlID('Normal')->synIDtrans()->synIDattr(what, mode)
# however, just in case
if empty(color) || str2nr(color) == -1
color = 'NONE'
endif
endif
return color
enddef
def s:get_array(guifg: string, guibg: string, ctermfg: string, ctermbg: string, opts: list<string>): list<string>
return [ guifg, guibg, ctermfg, ctermbg, empty(opts) ? '' : join(opts, ',') ]
enddef
def airline#highlighter#reset_hlcache(): void
s:hl_groups = {}
enddef
def airline#highlighter#get_highlight(group: string, rest: list<string> = ['']): list<string>
# only check for the cterm reverse attribute
# TODO: do we need to check all modes (gui, term, as well)?
var reverse = false
var bold = false
var property: string
var res = []
var ctermfg: string
var ctermbg: string
var guifg: string
var guibg: string
property = hlID(group)->synIDtrans()->synIDattr('reverse', 'cterm')
if !empty(property) && property->str2nr()
reverse = true
endif
if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, group)
res = s:hl_groups[group]
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
else
ctermfg = s:get_syn(group, 'fg', 'cterm')
ctermbg = s:get_syn(group, 'bg', 'cterm')
guifg = s:get_syn(group, 'fg', 'gui')
guibg = s:get_syn(group, 'bg', 'gui')
property = hlID(group)->synIDtrans()->synIDattr('bold')
if !empty(property) && property->str2nr()
bold = true
endif
if reverse
res = s:get_array(guibg, guifg, ctermbg, ctermfg, bold ? ['bold'] : rest)
else
res = s:get_array(guifg, guibg, ctermfg, ctermbg, bold ? ['bold'] : rest)
endif
endif
s:hl_groups[group] = res
return res
enddef
def airline#highlighter#get_highlight2(fg: list<string>, bg: list<string>, ...rest: list<string>): list<string>
var guifg = s:get_syn(fg[0], fg[1], 'gui')
var guibg = s:get_syn(bg[0], bg[1], 'gui')
var ctermfg = s:get_syn(fg[0], fg[1], 'cterm')
var ctermbg = s:get_syn(bg[0], bg[1], 'cterm')
return s:get_array(guifg, guibg, ctermfg, ctermbg, filter(rest, (_, v) => !empty(v)))
enddef
def s:hl_group_exists(group: string): bool
if !hlexists(group)
return false
elseif hlID(group)->synIDtrans()->synIDattr('fg')->empty()
return false
endif
return true
enddef
def s:CheckDefined(colors: list<any>): list<any>
# 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")
g:airline#highlighter#normal_fg_hi = hlID('Normal')->synIDtrans()->synIDattr('fg', 'cterm')
endif
if empty(g:airline#highlighter#normal_fg_hi) || str2nr(g:airline#highlighter#normal_fg_hi) < 0
return colors
endif
for val in colors
if !empty(val) && val !=# 'NONE'
return 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
var fg = g:airline#highlighter#normal_fg_hi
var bg = hlID('Normal')->synIDtrans()->synIDattr('bg', 'cterm')
if empty(bg) || str2nr(bg) < 0
# in case there is no background color defined for Normal
bg = colors[3]
endif
return colors[ 0 : 1 ] + [fg, bg] + [colors[4]]
enddef
def s:GetHiCmd(list: list<string>): string
# list needs to have 5 items!
var res: string
var i = -1
var item: string
while i < 4
i += 1
item = get(list, i, '')
if item is ''
continue
endif
if i == 0
res ..= ' guifg=' .. item
elseif i == 1
res ..= ' guibg=' .. item
elseif i == 2
res ..= ' ctermfg=' .. item
elseif i == 3
res ..= ' ctermbg=' .. item
elseif i == 4
res ..= printf(' gui=%s cterm=%s term=%s', item, item, item)
endif
endwhile
return res
enddef
def airline#highlighter#load_theme(): void
if pumvisible()
return
endif
for winnr in filter(range(1, winnr('$')), (_, v) => v != winnr())
airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
endfor
airline#highlighter#highlight(['inactive'])
if getbufvar( bufnr('%'), '&modified' ) && &buftype != 'terminal'
airline#highlighter#highlight(['normal', 'modified'])
else
airline#highlighter#highlight(['normal'])
endif
enddef
def airline#highlighter#add_accent(accent: string): void
s:accents[accent] = 1
enddef
def airline#highlighter#add_separator(from: string, to: string, inverse: bool): void
s:separators[from .. to] = [from, to, inverse]
s:exec_separator({}, from, to, inverse, '')
enddef
def s:exec_separator(dict: dict<any>, from_arg: string, to_arg: string, inverse: bool, suffix: string): void
if pumvisible()
return
endif
var group = from_arg .. '_to_' .. to_arg .. suffix
var from = mapnew(airline#themes#get_highlight(from_arg .. suffix), (_, v) => type(v) != type('') ? string(v) : v)
var colors = []
var to = mapnew(airline#themes#get_highlight(to_arg .. suffix), (_, v) => type(v) != type('') ? string(v) : v)
if inverse
colors = [ from[1], to[1], from[3], to[3] ]
else
colors = [ to[1], from[1], to[3], from[3] ]
endif
dict[group] = colors
airline#highlighter#exec(group, colors)
enddef
def airline#highlighter#highlight_modified_inactive(bufnr: number): void
var colors: list<any>
var dict1 = eval('g:airline#themes#' .. g:airline_theme .. '#palette')->get('inactive_modified', {})
var dict2 = eval('g:airline#themes#' .. g:airline_theme .. '#palette')->get('inactive', {})
if empty(dict2)
return
endif
if getbufvar(bufnr, '&modified')
colors = get(dict1, 'airline_c', [])
else
colors = get(dict2, 'airline_c', [])
endif
if !empty(colors)
airline#highlighter#exec('airline_c' .. bufnr .. '_inactive', colors)
endif
enddef
def airline#highlighter#exec(group: string, clrs: list<any>): void
if pumvisible()
return
endif
var colors: list<string> = mapnew(copy(clrs), (_, v) => type(v) != type('') ? string(v) : v)
if len(colors) == 4
add(colors, '')
endif
if s:is_win32term
colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
endif
var old_hi: list<string> = airline#highlighter#get_highlight(group)
var new_hi: list<string> = colors
if old_hi != new_hi || !s:hl_group_exists(group)
var cmd = printf('hi %s%s', group, s:GetHiCmd(colors))
try
:exe cmd
catch /^Vim\%((\a\+)\)\=:E421:/
var grp = matchstr(v:exception, '\w\+\ze=')
var clr = matchstr(v:exception, '=\zs\w\+')
cmd = substitute(cmd, clr, 'grey', 'g')
:exe cmd
airline#util#warning('color ' .. clr .. ' definition for group ' .. grp .. ' not found, using grey as fallback')
catch
airline#util#warning('Error when running command: ' .. cmd)
endtry
if has_key(s:hl_groups, group)
s:hl_groups[group] = colors
endif
endif
enddef
def airline#highlighter#highlight(modes: list<string>, bufnr: string = ''): void
var p: dict<any> = eval('g:airline#themes#' .. g:airline_theme .. '#palette')
# draw the base mode, followed by any overrides
var mapped = map(modes, (_, v) => v == modes[0] ? v : modes[0] .. "_" .. v)
var suffix = ''
if modes[0] == 'inactive'
suffix = '_inactive'
endif
var airline_grouplist = []
var dict: dict<any>
var bnr: number = 0
var buffers_in_tabpage: list<number> = uniq(sort(tabpagebuflist()))
# mapped might be something like ['normal', 'normal_modified']
# if a group is in both modes available, only define the second
# that is how this was done previously overwrite the previous definition
for mode in reverse(mapped)
if exists('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode)
dict = eval('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode)
for kvp in items(dict)
var mode_colors = kvp[1]
var name = kvp[0]
if name == 'airline_c' && !empty(bufnr) && suffix == '_inactive'
name = 'airline_c' .. bufnr
endif
# do not re-create highlighting for buffers that are no longer visible
# in the current tabpage
if name =~# 'airline_c\d\+'
bnr = matchstr(name, 'airline_c\zs\d\+')->str2nr()
if bnr > 0 && index(buffers_in_tabpage, bnr) == -1
continue
endif
elseif (name =~ '_to_') || (name[ 0 : 10 ] == 'airline_tab' && !empty(suffix))
# group will be redefined below at exec_separator
# or is not needed for tabline with '_inactive' suffix
# since active flag is 1 for builder)
continue
endif
if s:group_not_done(airline_grouplist, name .. suffix)
airline#highlighter#exec(name .. suffix, mode_colors)
endif
if !has_key(p, 'accents')
# shouldn't actually happen, p should always contain accents
continue
endif
for accent in keys(s:accents)
if !has_key(p.accents, accent)
continue
endif
var colors = copy(mode_colors)
if p.accents[accent][0] != ''
colors[0] = p.accents[accent][0]
endif
if type(get(p.accents[accent], 2, '')) == type('')
colors[2] = get(p.accents[accent], 2, '')
else
colors[2] = string(p.accents[accent][2])
endif
if len(colors) >= 5
colors[4] = get(p.accents[accent], 4, '')
else
add(colors, get(p.accents[accent], 4, ''))
endif
if s:group_not_done(airline_grouplist, name .. suffix .. '_' .. accent)
airline#highlighter#exec(name .. suffix .. '_' .. accent, colors)
endif
endfor
endfor
if empty(s:separators)
continue
endif
for sep in items(s:separators)
# we cannot check, that the group already exists, else the separators
# might not be correctly defined. But perhaps we can skip above groups
# that match the '_to_' name, because they would be redefined here...
s:exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
endfor
endif
endfor
enddef
endif

Some files were not shown because too many files have changed in this diff Show More