85 Commits
Author SHA1 Message Date
kazukazuinaina a6886f2997 [add] fail fast options 2021-01-02 16:09:32 +09:00
kazukazuinaina 1962371666 add vim9script branch in CI
NOTE: CI didn't work without explicitly specifying the branch.
2021-01-02 15:58:54 +09:00
kazukazuinaina 2062dd2f98 delete travis.yml 2021-01-02 15:54:05 +09:00
kazukazuinaina 0e91eeb548 [add] github-actions
Note: According to an email from travis-ci, travis-ci.org will be officially closed down completely on December 31st, 2020
2021-01-02 15:51:33 +09:00
Christian 4b02724d0c highglighter: Vim9 script correctly convert hex string to number 2020-11-27 10:43:54 +01:00
Christian f54f7859a3 tabline: disable Vim9 script add_tab_label 2020-11-27 10:43:54 +01:00
Christian 4bce179ed3 themes: fix syntax errors in Vim9 script for patch func 2020-11-27 10:43:54 +01:00
Christian 2083bfe890 highlighter: correctly get the colors from global palette for Vim9 2020-11-27 10:43:54 +01:00
Christian 084dfe017d highlighter: cast Vim9 variables to correct type 2020-11-27 10:43:54 +01:00
Christian ad7dcbdece tabline: disable Vim9 script functions that do not work currently 2020-11-27 10:43:54 +01:00
Christian bb204d1fee tabline: fix vim9 syntax error in group_of_bufnr 2020-11-27 10:43:53 +01:00
Christian a678556366 dark: convert theme to Vim9 script 2020-11-27 10:43:53 +01:00
Christian def61b1450 themes: fix Vim9 syntax error in patch func 2020-11-27 10:43:53 +01:00
Christian 3de44bc58f themes: fix Vim9 syntax error in get_highlight2 2020-11-27 10:43:53 +01:00
Christian dcb36f0480 themes: fix vim9 syntax errors in generate_color_map 2020-11-27 10:43:53 +01:00
Christian 21f329cd70 themes: Vim9 script implementation of patch 2020-11-27 10:43:53 +01:00
Christian 0eee611a0e themes: Vim9 script implementation of get_highlight and get_highlight2 2020-11-27 10:43:53 +01:00
Christian 4e4663c71c themes: Vim9 script implementation of generate_color_map 2020-11-27 10:43:52 +01:00
Christian 0a80997100 themes: prepare for vim9script implementation 2020-11-27 10:43:52 +01:00
Christian f08b7912c6 themes: add modeline 2020-11-27 10:43:52 +01:00
Christian d49b655e72 tabline: fix possible vim9script error in init func 2020-11-27 10:43:52 +01:00
Christian 70dc69fcd8 tabline: fix errors in Vim9script get_buffer_name 2020-11-27 10:43:52 +01:00
Christian cdb265c410 tabline: fix errors in Vim9script title function 2020-11-27 10:43:52 +01:00
Christian de3dbfcb3c tabline: fix errors in Vim9script load_theme 2020-11-27 10:43:51 +01:00
Christian cc2a836b9a tabline: Vim9 script implementation of add_tab_label 2020-11-27 10:43:51 +01:00
Christian 6ff95bac4e tabline: Vim9 script implementation of add_label 2020-11-27 10:43:51 +01:00
Christian c8c30c9e3e tabline: Vim9 script implementation of group_of_bufnr 2020-11-27 10:43:51 +01:00
Christian a77cd28ecc tabline: Vim9 script implementation of new_builder 2020-11-27 10:43:51 +01:00
Christian 6a6945d45d tabline: Vim9 script implementation of get_buffer_name func 2020-11-27 10:43:51 +01:00
Christian d5ffa5fd58 tabline: Vim9 script implementation of #title func 2020-11-27 10:43:50 +01:00
Christian b10c1107e1 tabline: init function, do call autocommand functions 2020-11-27 10:43:50 +01:00
Christian 4f59fef538 move script local variable current_tabcnt to top 2020-11-27 10:43:50 +01:00
Christian e59a654d17 tabline: Vim9 script implementation of get() 2020-11-27 10:43:50 +01:00
Christian 18ae588bad tabline: remove bang attribute in load_theme func definition 2020-11-27 10:43:50 +01:00
Christian 86c466d81e tabline: fix vim9 error in enable func 2020-11-27 10:43:50 +01:00
Christian c08b1c0c75 tabline: fix vim9 error in toggle_on func 2020-11-27 10:43:49 +01:00
Christian 3d536ef950 tabline: fix vim9 error in init func 2020-11-27 10:43:49 +01:00
Christian 02aaaf94e8 tabline: Vim9 script implementation of load_theme 2020-11-27 10:43:49 +01:00
Christian bbc70019f6 tabline: Vim9 script implementation of enable 2020-11-27 10:43:49 +01:00
Christian 0bc7ff3629 tabline: Vim9 script implementation of redraw 2020-11-27 10:43:49 +01:00
Christian 7880f0a73c tabline: Vim9 script implementation of update_tabline 2020-11-27 10:43:49 +01:00
Christian 5502e5302d tabline: Vim9 script implementation of toggle_on 2020-11-27 10:43:48 +01:00
Christian 59c906da4d tabline: Vim9 script implementation of toggle_off 2020-11-27 10:43:48 +01:00
Christian 19f8be42b6 tabline: Vim9 script implementation of #init function 2020-11-27 10:43:48 +01:00
Christian e81d400b09 tabline: check existence of "e" flag in guioptions 2020-11-27 10:43:48 +01:00
Christian 5062eeeaed tabline: add foldmarkers and remove some empty lines 2020-11-27 10:43:48 +01:00
Christian e6bd342293 tabline: prepare for vim9script implementation 2020-11-27 10:43:48 +01:00
Christian caaa553ce9 tabline: set expandtab and foldmarker to modeline 2020-11-27 10:43:47 +01:00
Christian b4e38be8b8 highlighter: fix indentation (tabs) 2020-11-27 10:43:47 +01:00
Christian 252b89bb1f default tabline formmatter: fix indentation 2020-11-27 10:43:47 +01:00
Christian b271c279d6 default tablineformmter: get rid of s: vars in legacy implementation 2020-11-27 10:43:44 +01:00
Christian 9387517f01 default tablineformatter: implement as vim9 script 2020-11-27 10:42:16 +01:00
Christian 8ec6f1e40f tabline formatter: prepare for vim9 script implementation 2020-11-27 10:42:13 +01:00
Christian 0d0c380940 highlighter: fix a couple of vim9script errors and fix indentation 2020-11-27 10:40:38 +01:00
Christian 9f7557df44 highlighter: remove ! from :def in vim9script 2020-11-27 10:40:38 +01:00
Christian f615f8bad3 autoload: bufnr argument of #highlight function is actually a string 2020-11-27 10:40:38 +01:00
Christian f5e2f97003 highlighter: vim9 script implementation of #highlight() 2020-11-27 10:40:38 +01:00
Christian 14fd943dc6 highlighter: vim9 script implementation of highlight_modified_inactive 2020-11-27 10:40:37 +01:00
Christian e9d4ff75da highlighter: vim9 script implementation of add_accent 2020-11-27 10:40:37 +01:00
Christian 9b32ed3229 highlighter: remove ! from :def in vim9script 2020-11-27 10:40:37 +01:00
Christian 58b2a8bbc8 highlighter: add foldmarker at final endif 2020-11-27 10:40:37 +01:00
Christian 5ac55ea4e5 highlighter: vim9 script implementation of add_separator 2020-11-27 10:40:37 +01:00
Christian 56ba4b34a7 highlighter: vim9 fix duplicate variable name in s:exec_separator function 2020-11-27 10:40:37 +01:00
Christian 798a346a91 highlighter: vim9 script implementation of load_theme 2020-11-27 10:40:36 +01:00
Christian 4f8675434a highlighter: get rid of superflous l: var prefix 2020-11-27 10:40:36 +01:00
Christian 5391b3e246 highlighter: vim9 script implementation of s:exec_separator 2020-11-27 10:40:36 +01:00
Christian 7310ca6cbf highlighter: run ex command with leading colon in vim9 function #exec 2020-11-27 10:40:36 +01:00
Christian 9ae38b43e4 highlighter: vim9 script implementation of s:GetHiCmd 2020-11-27 10:40:36 +01:00
Christian 2441084898 highlighter: vim9 script implementation of s:CheckDefined 2020-11-27 10:40:36 +01:00
Christian d9947beb0f highlighter: vim9 script implementation of #exec 2020-11-27 10:40:36 +01:00
Christian a6b7267979 highlighter: vim9 script implementation of s:hl_group_exists 2020-11-27 10:40:35 +01:00
Christian 90de76359f highlighter: use synIDtrans() in s:hl_group_exists (legacy vimscript)
When checking the defined foreground color in the function that checks
whether a highlighting group exists, it should follow the syntax group
links and check the final color.
2020-11-27 10:40:35 +01:00
Christian 0238d386bb highlighter: vim9 script implementation of get_highlight2 2020-11-27 10:40:35 +01:00
Christian 19861861fd highlighter: vim9 script implementation of get_highlight 2020-11-27 10:40:35 +01:00
Christian 687fb52d9f fix indentation of legacy vimscript (remove tabs) 2020-11-27 10:40:35 +01:00
Christian aa8bd171f3 highlighter: vim9 script implementation of reset_hlcache 2020-11-27 10:40:35 +01:00
Christian b152059a98 highlighter: vim9 script implementation of s:get_array 2020-11-27 10:40:34 +01:00
Christian 4d75c9940c highlighter: vim9 script implementation of s:get_syn 2020-11-27 10:40:34 +01:00
Christian ae3af85ca2 highlighter: remove a couple of empty lines in legacy vimscript implementation 2020-11-27 10:40:34 +01:00
Christian a9f525f8da highlighter: vim9 script implementation of s:group_not_done 2020-11-27 10:40:34 +01:00
Christian 3e93c212cc highlighter: vim9 script implementation of s:gui2cui 2020-11-27 10:40:34 +01:00
Christian a8afa434e3 highlighter: Add condition for new vim9 script implementation
Add a new condition that will contain the new vim9script implementation
of the highlighter logic. Not done yet.

To test it out, you need a recent Vim 8.2 and in addition set the
configuration variable

    :let g:airline_experimental=1

Implementation for all the functions will follow.
2020-11-27 10:40:34 +01:00
Christian b0d4a44f0c add foldmarker to highlighter.vim 2020-11-27 10:40:33 +01:00
Christian 0abcdbeba5 convert msdos.vim 2020-11-27 10:40:33 +01:00
Christian 609205f1e8 remove trailing whitespace 2020-11-27 10:40:33 +01:00
133 changed files with 1724 additions and 3418 deletions
-3
View File
@@ -8,10 +8,7 @@
if you are using terminal: if you are using terminal:
- terminal: ???? - terminal: ????
- $TERM variable: ??? - $TERM variable: ???
- terminal columns size: ???
- terminal line size: ???
- color configuration (:set t_Co?): - color configuration (:set t_Co?):
if you are using Neovim: if you are using Neovim:
- does it happen in Vim: ??? - does it happen in Vim: ???
+30 -23
View File
@@ -3,43 +3,50 @@ name: CI
on: on:
push: push:
branches: branches:
- master - master
- vim9script
pull_request: pull_request:
branches: branches:
- master - master
jobs: jobs:
test: test:
name: Test name: Test
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false
matrix: matrix:
vim: vim_version:
- v9.1.0000 - 'v8.2.1000'
- v9.0.0000 - 'v8.2.0000'
- v8.2.1000 - 'v8.1.0000'
- v8.2.0000 - 'v8.0.0000'
- v8.1.0000 - 'v7.4'
- v8.0.0000
- v7.4
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@main uses: actions/checkout@master
- name: Checkout vim-themis - name: Setup Ruby
uses: actions/checkout@main uses: actions/setup-ruby@v1
with: with:
repository: thinca/vim-themis ruby-version: '2.6'
path: vim-themis
- name: Setup Bundle
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Setup Vim - name: Setup Vim
uses: rhysd/action-setup-vim@v1 uses: thinca/action-setup-vim@v1
id: vim
with: with:
version: ${{ matrix.vim }} vim_version: ${{ matrix.vim_version }}
- name: Test - name: Install Dependencies
env: run: |
THEMIS_VIM: ${{ steps.vim.outputs.executable }} curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim
run: ./vim-themis/bin/themis --reporter spec 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
- name: Run Test
run: rake ci
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
name: runner / vint name: runner / vint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@v2
- name: vint - name: vint
uses: reviewdog/action-vint@v1 uses: reviewdog/action-vint@v1
with: with:
+1 -1
View File
@@ -5,4 +5,4 @@ doc/tags
*.swp *.swp
.bundle .bundle
vendor vendor
test/.deps
+8 -33
View File
@@ -2,9 +2,7 @@
This is the Changelog for the vim-airline project. This is the Changelog for the vim-airline project.
## [0.13] - Unreleased ## [0.12] - Unreleased
## [0.12] - 2026-05-02
- New features - New features
- Extensions: - Extensions:
- [poetv](https://github.com/petobens/poet-v) support - [poetv](https://github.com/petobens/poet-v) support
@@ -14,42 +12,19 @@ This is the Changelog for the vim-airline project.
- [vim-dirvish](https://github.com/justinmk/vim-dirvish) support - [vim-dirvish](https://github.com/justinmk/vim-dirvish) support
- [fzf.vim](https://github.com/junegunn/fzf.vim) support - [fzf.vim](https://github.com/junegunn/fzf.vim) support
- [OmniSharp](https://github.com/OmniSharp/omnisharp-vim) support - [OmniSharp](https://github.com/OmniSharp/omnisharp-vim) support
- [searchcount](https://vim-jp.org/vimdoc-en/eval.html#searchcount()) support - [searchcount](https://vim-jp.org/vimdoc-en/eval.html#searchcount()) support
- [fern.vim](https://github.com/lambdalisue/fern.vim) support - [fern.vim](https://github.com/lambdalisue/fern.vim) support
- [Vim-CMake](https://github.com/cdelledonne/vim-cmake) support - [Vim-CMake](https://github.com/cdelledonne/vim-cmake) support
- [battery.vim](https://github.com/lambdalisue/battery.vim) support - [battery.vim](https://github.com/lambdalisue/battery.vim) support
- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) support - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) support
- [gen_tags.vim](https://github.com/jsfaint/gen_tags.vim) support - [gen_tags.vim](https://github.com/jsfaint/gen_tags.vim) support
- [vim-rufu](https://github.com/ruby-formatter/rufo-vim) support
- [vim-flog](https://github.com/rbong/vim-flog) support
- [nvim-lsp](https://github.com/neovim/nvim-lsp) support
- [vim9lsp.vim](https://github.com/yegappan/lsp) support
- [fcitx.vim](https://github.com/fcitx/fcitx5) support
- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) support
- [codeium](https://github.com/Exafunction/codeium.vim) support
- [vimodoro](https://github.com/VimfanTPdvorak/vimodoro) support
- [nerdfont](https://github.com/lambdalisue/nerdfont.vim) support
- [zhihu](https://github.com/pxwg/zhihu.nvim) Neovim support
- Ascii Scrollbar support
- Improvements - Improvements
- git branch can also be displayed using [gina.vim](https://github.com/lambdalisue/gina.vim) - 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 extensions can also show additional status messages
- [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension - [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension
- rewrote parts using Vim9 Script for performance improvements
- [vim-obsession](https://github.com/tpope/vim-obsession) allow to set paused indicator
- Display executable symbol for executable script
- Support for Neovims global statusline
- whitespace extensions: add git conflict marker support
- Support tabpanel, including mouse and scroll support (Vim only)
- Support multi-line statusline (Vim only)
- Support clickable buffers in Vim
- Support for showing `repo:/path/file` path like style using the `gitrepo` style
- tabline: Expose `<Plug>AirlineSelectFirstTab` and `<Plug>AirlineSelectLastTab`
- tabline: Add a new `buffer_idx_mode` that adds a lot more mappings.
- Other - Other
- Changed CI from travis-ci.org to GitHub Actions
- Introduce Vim script static analysis using [reviewdog](https://github.com/reviewdog/action-vint) - Introduce Vim script static analysis using [reviewdog](https://github.com/reviewdog/action-vint)
- Added multiple Vim versions to unit tests - Added multiple Vim versions to unit tests using Travis CI
- Added option to show short paths in the status line - Added option to show short paths in the status line
## [0.11] - 2019-11-10 ## [0.11] - 2019-11-10
@@ -71,9 +46,9 @@ This is the Changelog for the vim-airline project.
- The branch extensions now also displays whether the repository is in a clean state - The branch extensions now also displays whether the repository is in a clean state
(will append a ! or ⚡if the repository is considered dirty). (will append a ! or ⚡if the repository is considered dirty).
- The whitespace extensions will also check for conflict markers - 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 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_skip_empty_sections` is active).
- airline can now also detect multiple cursor mode (issue [#1933](https://github.com/vim-airline/vim-airline/issues/1933)) - 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) - 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)
@@ -107,7 +82,7 @@ This is the Changelog for the vim-airline project.
- [fugitive](https://github.com/tpope/vim-fugitive) plugin has been refactored - [fugitive](https://github.com/tpope/vim-fugitive) plugin has been refactored
causing adjustments for vim-airline, also uses Fugitives new API calls causing adjustments for vim-airline, also uses Fugitives new API calls
- some improvements to Vims terminal mode - some improvements to Vims terminal mode
- Allow to use alternative separators for inactive windows ([#1236](https://github.com/vim-airline/vim-airline/issues/1236)) - Allow to use alternative seperators for inactive windows ([#1236](https://github.com/vim-airline/vim-airline/issues/1236))
- Statusline can be set to inactive, whenever Vim loses focus (using FocusLost autocommand) - Statusline can be set to inactive, whenever Vim loses focus (using FocusLost autocommand)
## [0.9] - 2018-01-15 ## [0.9] - 2018-01-15
@@ -157,7 +132,7 @@ This is the Changelog for the vim-airline project.
## [0.8] - 2016-03-09 ## [0.8] - 2016-03-09
- Changes - Changes
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline) - Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
- Themes have been split into a separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes) - Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Improvements - Improvements
- Extensions - Extensions
- branch: support Git and Mercurial simultaneously, untracked files - branch: support Git and Mercurial simultaneously, untracked files
-17
View File
@@ -6,23 +6,6 @@ Contributions and pull requests are welcome. Please take note of the following
* Keep the history clean! Squash your branches before you submit a pull request. `pull --rebase` is your friend. * 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.4. * 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 # 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: 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:
+2
View File
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'vim-flavor', '~> 2.2.2'
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (C) 2013-2026 Bailey Ling, Christian Brabandt, et al. Copyright (C) 2013-2020 Bailey Ling, Christian Brabandt, et al.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"), a copy of this software and associated documentation files (the "Software"),
+25 -37
View File
@@ -1,8 +1,4 @@
# vim-airline # vim-airline [![Build Status](https://travis-ci.org/vim-airline/vim-airline.svg?branch=master)](https://travis-ci.org/vim-airline/vim-airline) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/cb%40256bit.org) [![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)
[![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. Lean & mean status/tabline for vim that's light as air.
@@ -32,8 +28,6 @@ information. By default (without configuration) this line will look like this:
+-----------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+
| A | B | C X | Y | Z | [...] | | A | B | C X | Y | Z | [...] |
+-----------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+
| [...] |
+-----------------------------------------------------------------------------+
``` ```
The statusline is the colored line at the bottom, which contains the sections The statusline is the colored line at the bottom, which contains the sections
@@ -47,7 +41,7 @@ section|meaning (example)
X | filetype (vim) X | filetype (vim)
Y | file encoding[fileformat] (utf-8[unix]) Y | file encoding[fileformat] (utf-8[unix])
Z | current position in the file Z | current position in the file
[...] | additional sections (warning/errors/statistics) from external plugins (e.g. YCM, syntastic, ...)<br>can be shown on a second line optionally (Vim only) [...] | additional sections (warning/errors/statistics) from external plugins (e.g. YCM, syntastic, ...)
The information in Section Z looks like this: The information in Section Z looks like this:
@@ -68,7 +62,7 @@ For a better look, those sections can be colored differently, depending on vario
* Tiny core written with extensibility in mind ([open/closed principle][8]). * Tiny core written with extensibility in mind ([open/closed principle][8]).
* Integrates with a variety of plugins, including: [vim-bufferline][6], * Integrates with a variety of plugins, including: [vim-bufferline][6],
[fugitive][4], [flog][62], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16],
[undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29],
[vim-signify][30], [quickfixsigns][39], [syntastic][5], [eclim][34], [vim-signify][30], [quickfixsigns][39], [syntastic][5], [eclim][34],
[lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37], [lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37],
@@ -82,22 +76,6 @@ For a better look, those sections can be colored differently, depending on vario
* 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]. * 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. * 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 ## 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. 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.
@@ -181,15 +159,12 @@ vim-airline integrates with a variety of plugins out of the box. These extensio
#### [syntastic][5] #### [syntastic][5]
![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png) ![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png)
#### hunks ([vim-gitgutter][29], [vim-signify][30], [coc-git][59] & [gitsigns.nvim][63]) #### hunks ([vim-gitgutter][29] & [vim-signify][30] & [coc-git][59])
![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png) ![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png)
#### [vimagit][50] #### [vimagit][50]
![vim-airline-vimagit-demo](https://cloud.githubusercontent.com/assets/533068/22107273/2ea85ba0-de4d-11e6-9fa8-331103b88df4.gif) ![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] #### [virtualenv][31]
![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png) ![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png)
@@ -241,7 +216,6 @@ to call custom functions. Use `:let g:airline_statusline_ontop=1` to enable it.
Every section is composed of parts, and you can reorder and reconfigure them at will. Every section is composed of parts, and you can reorder and reconfigure them at will.
![image](https://f.cloud.github.com/assets/306502/1073278/f291dd4c-14a3-11e3-8a83-268e2753f97d.png) ![image](https://f.cloud.github.com/assets/306502/1073278/f291dd4c-14a3-11e3-8a83-268e2753f97d.png)
Note: nowadays you should use the `AirlineAfterInit` autocommand
Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/vim-airline/vim-airline/issues/299#issuecomment-25772886)). Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/vim-airline/vim-airline/issues/299#issuecomment-25772886)).
@@ -267,6 +241,22 @@ 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! 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 ~/.vim/pack/dist/start/vim-airline/doc` to generate help tags |
| manual | copy all of the files into your `~/.vim` directory |
# Documentation # Documentation
`:help airline` `:help airline`
@@ -303,16 +293,16 @@ A full list of screenshots for various themes can be found in the [Wiki][14].
# Maintainers # Maintainers
The project is currently being maintained by [Christian Brabandt][42] and [Bailey Ling][41]. The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44].
If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43]. If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43].
# License # License
[MIT License][58]. Copyright (c) 2013-2026 Bailey Ling & Contributors. [MIT License][58]. Copyright (c) 2013-2020 Bailey Ling & Contributors.
[1]: https://github.com/Lokaltog/vim-powerline [1]: https://github.com/Lokaltog/vim-powerline
[2]: https://github.com/powerline/powerline [2]: https://github.com/Lokaltog/powerline
[3]: https://github.com/Lokaltog/powerline-fonts [3]: https://github.com/Lokaltog/powerline-fonts
[4]: https://github.com/tpope/vim-fugitive [4]: https://github.com/tpope/vim-fugitive
[5]: https://github.com/scrooloose/syntastic [5]: https://github.com/scrooloose/syntastic
@@ -331,7 +321,7 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[18]: https://github.com/preservim/nerdtree [18]: https://github.com/preservim/nerdtree
[19]: https://github.com/majutsushi/tagbar [19]: https://github.com/majutsushi/tagbar
[20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts [20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
[21]: https://github.com/ludovicchabant/vim-lawrencium [21]: https://bitbucket.org/ludovicchabant/vim-lawrencium
[22]: https://github.com/MarcWeber/vim-addon-manager [22]: https://github.com/MarcWeber/vim-addon-manager
[23]: https://github.com/altercation/solarized [23]: https://github.com/altercation/solarized
[24]: https://github.com/chriskempson/tomorrow-theme [24]: https://github.com/chriskempson/tomorrow-theme
@@ -354,6 +344,7 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[41]: https://github.com/bling [41]: https://github.com/bling
[42]: https://github.com/chrisbra [42]: https://github.com/chrisbra
[43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer [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 [45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b
[46]: https://github.com/vim-airline/vim-airline-themes#vim-airline-themes-- [46]: https://github.com/vim-airline/vim-airline-themes#vim-airline-themes--
[47]: https://github.com/mildred/vim-bufmru [47]: https://github.com/mildred/vim-bufmru
@@ -371,6 +362,3 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[59]: https://github.com/neoclide/coc-git [59]: https://github.com/neoclide/coc-git
[60]: https://github.com/cdelledonne/vim-cmake [60]: https://github.com/cdelledonne/vim-cmake
[61]: http://github.com/lambdalisue/battery.vim/ [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
+14
View File
@@ -0,0 +1,14 @@
#!/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
+47 -75
View File
@@ -1,35 +1,25 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', []) 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', 'warning2'] let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning']
let s:inactive_funcrefs = []
let s:contexts = {} let s:contexts = {}
let s:core_funcrefs = [ let s:core_funcrefs = [
\ function('airline#extensions#apply'), \ function('airline#extensions#apply'),
\ function('airline#extensions#default#apply') ] \ function('airline#extensions#default#apply') ]
function! airline#add_statusline_func(name, ...) function! airline#add_statusline_func(name)
let warn = get(a:, 1, 1) call airline#add_statusline_funcref(function(a:name))
call airline#add_statusline_funcref(function(a:name), warn)
endfunction endfunction
function! airline#add_inactive_statusline_func(name, ...) function! airline#add_statusline_funcref(function)
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 if index(g:airline_statusline_funcrefs, a:function) >= 0
let warn = get(a:, 1, 1) call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
if warn > 0
call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function)))
endif
return return
endif endif
call add(g:airline_statusline_funcrefs, a:function) call add(g:airline_statusline_funcrefs, a:function)
@@ -42,15 +32,8 @@ function! airline#remove_statusline_func(name)
endif endif
endfunction endfunction
function! airline#add_inactive_statusline_funcref(function, ...) function! airline#add_inactive_statusline_func(name)
if index(g:airline_inactive_funcrefs, a:function) >= 0 call add(s:inactive_funcrefs, function(a:name))
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 endfunction
function! airline#load_theme() function! airline#load_theme()
@@ -70,8 +53,6 @@ function! airline#load_theme()
call airline#highlighter#load_theme() call airline#highlighter#load_theme()
call airline#extensions#load_theme() call airline#extensions#load_theme()
call airline#update_statusline() call airline#update_statusline()
call airline#util#doautocmd('AirlineAfterTheme')
endfunction endfunction
" Load an airline theme " Load an airline theme
@@ -112,6 +93,8 @@ function! airline#switch_theme(name, ...)
unlet! w:airline_lastmode unlet! w:airline_lastmode
call airline#load_theme() call airline#load_theme()
call airline#util#doautocmd('AirlineAfterTheme')
" this is required to prevent clobbering the startup info message, i don't know why... " this is required to prevent clobbering the startup info message, i don't know why...
call airline#check_mode(winnr()) call airline#check_mode(winnr())
endfunction endfunction
@@ -142,10 +125,9 @@ endfunction
" Update the statusline " Update the statusline
function! airline#update_statusline() function! airline#update_statusline()
if airline#util#stl_disabled(winnr()) || airline#util#is_popup_window(winnr()) if airline#util#stl_disabled(winnr())
return return
endif endif
" TODO: need to ignore popup windows here as well?
let range = filter(range(1, winnr('$')), 'v:val != winnr()') let range = filter(range(1, winnr('$')), 'v:val != winnr()')
" create inactive statusline " create inactive statusline
call airline#update_statusline_inactive(range) call airline#update_statusline_inactive(range)
@@ -156,12 +138,7 @@ function! airline#update_statusline()
" Now create the active statusline " Now create the active statusline
let w:airline_active = 1 let w:airline_active = 1
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
try call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
catch /^Vim\%((\a\+)\)\=:E48:/
" Catch: Sandbox mode
" no-op
endtry
endfunction endfunction
" Function to be called to make all statuslines inactive " Function to be called to make all statuslines inactive
@@ -191,12 +168,7 @@ function! airline#update_statusline_inactive(range)
\ 'left_sep': g:airline_left_alt_sep, \ 'left_sep': g:airline_left_alt_sep,
\ 'right_sep': g:airline_right_alt_sep }, 'keep') \ 'right_sep': g:airline_right_alt_sep }, 'keep')
endif endif
try call s:invoke_funcrefs(context, s:inactive_funcrefs)
call s:invoke_funcrefs(context, g:airline_inactive_funcrefs)
catch /^Vim\%((\a\+)\)\=:E48:/
" Catch: Sandbox mode
" no-op
endtry
endfor endfor
endfunction endfunction
@@ -231,66 +203,66 @@ function! airline#check_mode(winnr)
let context = s:contexts[a:winnr] let context = s:contexts[a:winnr]
if get(w:, 'airline_active', 1) if get(w:, 'airline_active', 1)
let m = mode(1) let l:m = mode(1)
" Refer :help mode() to see the list of modes if l:m ==# "i"
" NB: 'let mode' here refers to the display colour _groups_, let l:mode = ['insert']
" not the literal mode's code (i.e., m). E.g., Select modes elseif l:m[0] ==# "i"
" v, S and ^V use 'visual' since they are of similar ilk. let l:mode = ['insert']
" Some modes do not get recognised for status line purposes: elseif l:m ==# "Rv"
" no, nov, noV, no^V, !, cv, and ce. let l:mode =['replace']
" Mode name displayed is handled in init.vim (g:airline_mode_map). elseif l:m[0] ==# "R"
" let l:mode = ['replace']
if m[0] ==# "i" elseif l:m[0] =~# '\v(v|V||s|S|)'
let mode = ['insert'] " Insert modes + submodes (i, ic, ix) let l:mode = ['visual']
elseif m[0] == "R" elseif l:m ==# "t"
let mode = ['replace'] " Replace modes + submodes (R, Rc, Rv, Rx) (NB: case sensitive as 'r' is a mode) let l:mode = ['terminal']
elseif m[0] =~ '\v(v|V||s|S|)' elseif l:m[0] ==# "c"
let mode = ['visual'] " Visual and Select modes (v, V, ^V, s, S, ^S)) let l:mode = ['commandline']
elseif m ==# "t" elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
let mode = ['terminal'] " Terminal mode (only has one mode (t)) let l:mode = ['normal']
elseif m[0] =~ '\v(c|r|!)' elseif l:m[0:1] ==# 'ni'
let mode = ['commandline'] " c, cv, ce, r, rm, r? (NB: cv and ce stay showing as mode entered from) let l:mode = ['insert']
let l:m = 'ni'
else else
let mode = ['normal'] " Normal mode + submodes (n, niI, niR, niV; plus operator pendings no, nov, noV, no^V) let l:mode = ['normal']
endif endif
if exists("*VMInfos") && !empty(VMInfos()) if exists("*VMInfos") && !empty(VMInfos())
" Vim plugin Multiple Cursors https://github.com/mg979/vim-visual-multi " Vim plugin Multiple Cursors https://github.com/mg979/vim-visual-multi
let m = 'multi' let l:m = 'multi'
endif endif
" Adjust to handle additional modes, which don't display correctly otherwise if index(['Rv', 'no', 'ni', 'ix', 'ic', 'multi'], l:m) == -1
if index(['niI', 'niR', 'niV', 'ic', 'ix', 'Rc', 'Rv', 'Rx', 'multi'], m) == -1 let l:m = l:m[0]
let m = m[0]
endif endif
let w:airline_current_mode = get(g:airline_mode_map, m, m) let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
else else
let mode = ['inactive'] let l:mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__') let w:airline_current_mode = get(g:airline_mode_map, '__')
endif endif
if g:airline_detect_modified && &modified if g:airline_detect_modified && &modified
call add(mode, 'modified') call add(l:mode, 'modified')
endif endif
if g:airline_detect_paste && &paste if g:airline_detect_paste && &paste
call add(mode, 'paste') call add(l:mode, 'paste')
endif endif
if g:airline_detect_crypt && exists("+key") && !empty(&key) if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(mode, 'crypt') call add(l:mode, 'crypt')
endif endif
if g:airline_detect_spell && &spell if g:airline_detect_spell && &spell
call add(mode, 'spell') call add(l:mode, 'spell')
endif endif
if &readonly || ! &modifiable if &readonly || ! &modifiable
call add(mode, 'readonly') call add(l:mode, 'readonly')
endif endif
let mode_string = join(mode) let mode_string = join(l:mode)
if get(w:, 'airline_lastmode', '') != mode_string if get(w:, 'airline_lastmode', '') != mode_string
call airline#highlighter#highlight_modified_inactive(context.bufnr) call airline#highlighter#highlight_modified_inactive(context.bufnr)
call airline#highlighter#highlight(mode, string(context.bufnr)) call airline#highlighter#highlight(l:mode, string(context.bufnr))
call airline#util#doautocmd('AirlineModeChanged') call airline#util#doautocmd('AirlineModeChanged')
let w:airline_lastmode = mode_string let w:airline_lastmode = mode_string
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
+26 -27
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -90,7 +90,7 @@ function! s:prototype.build() dict
" need to fix highlighting groups, since we " need to fix highlighting groups, since we
" have skipped a section, we actually need " have skipped a section, we actually need
" the previous previous group and so the " the previous previous group and so the
" separator goes from the previous previous group " seperator goes from the previous previous group
" to the current group " to the current group
let pgroup = group let pgroup = group
endif endif
@@ -106,12 +106,12 @@ function! s:prototype.build() dict
let line .= '%#'.group.'#' let line .= '%#'.group.'#'
elseif split elseif split
if !is_empty if !is_empty
let line .= s:get_transitioned_separator(self, prev_group, group, side) let line .= s:get_transitioned_seperator(self, prev_group, group, side)
endif endif
let split = 0 let split = 0
else else
if !is_empty if !is_empty
let line .= s:get_separator(self, prev_group, group, side) let line .= s:get_seperator(self, prev_group, group, side)
endif endif
endif endif
let line .= is_empty ? '' : s:get_accented_line(self, group, contents) let line .= is_empty ? '' : s:get_accented_line(self, group, contents)
@@ -137,7 +137,7 @@ function! airline#builder#should_change_group(group1, group2)
\ || color1[2] != color2[2] || color1[3] != color2[3] \ || color1[2] != color2[2] || color1[3] != color2[3]
endfunction endfunction
function! s:get_transitioned_separator(self, prev_group, group, side) function! s:get_transitioned_seperator(self, prev_group, group, side)
let line = '' let line = ''
if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side 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) call airline#highlighter#add_separator(a:prev_group, a:group, 0)
@@ -152,9 +152,9 @@ function! s:get_transitioned_separator(self, prev_group, group, side)
return line return line
endfunction endfunction
function! s:get_separator(self, prev_group, group, side) function! s:get_seperator(self, prev_group, group, side)
if airline#builder#should_change_group(a:prev_group, a:group) if airline#builder#should_change_group(a:prev_group, a:group)
return s:get_transitioned_separator(a:self, a:prev_group, a:group, a:side) return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side)
else else
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep
endif endif
@@ -190,31 +190,28 @@ function! s:section_is_empty(self, content)
endif endif
" only check, if airline#skip_empty_sections == 1 " only check, if airline#skip_empty_sections == 1
if get(g:, 'airline_skip_empty_sections', 0) == 0 || if get(g:, 'airline_skip_empty_sections', 0) == 0
\ get(w:, 'airline_skip_empty_sections', -1) == 0
return 0 return 0
endif endif
" special case: When the content is %=, that is the " only check, if airline#skip_empty_sections == 1
" separation marker, which switches between left- and if get(w:, 'airline_skip_empty_sections', -1) == 0
" right-aligned content. return 0
" Consider that to be empty, so that the previous previous endif
" group is correctly remembered in the builder() function " assume accents sections to be never empty
if empty(a:content) || a:content is# '%=' " (avoides, that on startup the mode message becomes empty)
if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1
return 0
endif
if empty(a:content)
return 1 return 1
endif endif
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
let stripped = substitute(a:content, if empty(list)
\ '\(%{.*}\|%#__accent_[^#]*#\|%#__restore__#\|%( \| %)\)', '', 'g') return 0 " no function in statusline text
if !empty(stripped)
return 0 " There is content in the statusline
endif endif
while len(list) > 0
let exprlist = [] let expr = list[0]
call substitute(a:content, '%{\([^}]*\)}', '\=add(exprlist, submatch(1))', 'g')
for expr in exprlist
try try
" catch all exceptions, just in case " catch all exceptions, just in case
if !empty(eval(expr)) if !empty(eval(expr))
@@ -223,7 +220,9 @@ function! s:section_is_empty(self, content)
catch catch
return 0 return 0
endtry endtry
endfor let start += 1
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start)
endw
return 1 return 1
endfunction endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
+6 -53
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -26,7 +26,6 @@ let s:filetype_overrides = {
\ 'coc-explorer': [ 'CoC Explorer', '' ], \ 'coc-explorer': [ 'CoC Explorer', '' ],
\ 'defx': ['defx', '%{b:defx.paths[0]}'], \ 'defx': ['defx', '%{b:defx.paths[0]}'],
\ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'], \ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'],
\ 'floggraph': [ 'Flog', '%{get(b:, "flog_status_summary", "")}' ],
\ 'gundo': [ 'Gundo', '' ], \ 'gundo': [ 'Gundo', '' ],
\ 'help': [ 'Help', '%f' ], \ 'help': [ 'Help', '%f' ],
\ 'minibufexpl': [ 'MiniBufExplorer', '' ], \ 'minibufexpl': [ 'MiniBufExplorer', '' ],
@@ -167,7 +166,7 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'gina') call add(s:loaded_ext, 'gina')
endif endif
if get(g:, 'loaded_fern', 0) && get(g:, 'airline#extensions#fern#enabled', 1) if get(g:, 'fern_loaded', 0) && get(g:, 'airline#extensions#fern#enabled', 1)
call airline#extensions#fern#init(s:ext) call airline#extensions#fern#init(s:ext)
call add(s:loaded_ext, 'fern') call add(s:loaded_ext, 'fern')
endif endif
@@ -177,11 +176,6 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'netrw') call add(s:loaded_ext, 'netrw')
endif endif
if get(g:, 'loaded_nerdfont', 0) && get(g:, 'airline#extensions#nerdfont#enabled', 1)
call airline#extensions#nerdfont#init(s:ext)
call add(s:loaded_ext, 'nerdfont')
endif
" fzf buffers are also terminal buffers, so this must be above term. " fzf buffers are also terminal buffers, so this must be above term.
if exists(':FZF') && get(g:, 'airline#extensions#fzf#enabled', 1) if exists(':FZF') && get(g:, 'airline#extensions#fzf#enabled', 1)
call airline#extensions#fzf#init(s:ext) call airline#extensions#fzf#init(s:ext)
@@ -234,17 +228,11 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'undotree') call add(s:loaded_ext, 'undotree')
endif 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) if get(g:, 'airline#extensions#hunks#enabled', 1)
\ && (exists('g:loaded_signify') \ && (exists('g:loaded_signify')
\ || exists('g:loaded_gitgutter') \ || exists('g:loaded_gitgutter')
\ || exists('g:loaded_changes') \ || exists('g:loaded_changes')
\ || exists('g:loaded_quickfixsigns') \ || exists('g:loaded_quickfixsigns')
\ || exists(':Gitsigns')
\ || exists(':CocCommand')) \ || exists(':CocCommand'))
call airline#extensions#hunks#init(s:ext) call airline#extensions#hunks#init(s:ext)
call add(s:loaded_ext, 'hunks') call add(s:loaded_ext, 'hunks')
@@ -261,10 +249,6 @@ function! airline#extensions#load()
call airline#extensions#tagbar#init(s:ext) call airline#extensions#tagbar#init(s:ext)
call add(s:loaded_ext, 'tagbar') call add(s:loaded_ext, 'tagbar')
endif 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) if get(g:, 'airline#extensions#vista#enabled', 1)
\ && exists(':Vista') \ && exists(':Vista')
@@ -278,11 +262,6 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'bookmark') call add(s:loaded_ext, 'bookmark')
endif 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) if get(g:, 'airline#extensions#csv#enabled', 1)
\ && (get(g:, 'loaded_csv', 0) || exists(':Table')) \ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
call airline#extensions#csv#init(s:ext) call airline#extensions#csv#init(s:ext)
@@ -359,8 +338,7 @@ function! airline#extensions#load()
endif endif
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1) if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && has('nvim') \ && exists(':LspInstallInfo'))
\ && luaeval('vim.lsp ~= nil'))
call airline#extensions#nvimlsp#init(s:ext) call airline#extensions#nvimlsp#init(s:ext)
call add(s:loaded_ext, 'nvimlsp') call add(s:loaded_ext, 'nvimlsp')
endif endif
@@ -400,11 +378,6 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'tabline') call add(s:loaded_ext, 'tabline')
endif endif
if get(g:, 'airline#extensions#tabpanel#enabled', 0)
call airline#extensions#tabpanel#Init(s:ext)
call add(s:loaded_ext, 'tabpanel')
endif
if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline') if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline')
call airline#extensions#tmuxline#init(s:ext) call airline#extensions#tmuxline#init(s:ext)
call add(s:loaded_ext, 'tmuxline') call add(s:loaded_ext, 'tmuxline')
@@ -430,11 +403,6 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'capslock') call add(s:loaded_ext, 'capslock')
endif 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)) if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0))
call airline#extensions#gutentags#init(s:ext) call airline#extensions#gutentags#init(s:ext)
call add(s:loaded_ext, 'gutentags') call add(s:loaded_ext, 'gutentags')
@@ -450,7 +418,7 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'grepper') call add(s:loaded_ext, 'grepper')
endif endif
if get(g:, 'airline#extensions#xkblayout#enabled', 1) && (exists('g:XkbSwitchLib') || exists('*FcitxCurrentIM') || has('nvim')) if (get(g:, 'airline#extensions#xkblayout#enabled', 1) && exists('g:XkbSwitchLib'))
call airline#extensions#xkblayout#init(s:ext) call airline#extensions#xkblayout#init(s:ext)
call add(s:loaded_ext, 'xkblayout') call add(s:loaded_ext, 'xkblayout')
endif endif
@@ -493,22 +461,17 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'battery') call add(s:loaded_ext, 'battery')
endif 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) if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution. " load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path). " (autoload/airline/extensions/*.vim outside of our s:script_path).
for file in split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n") for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
" we have to check both resolved and unresolved paths, since it's possible " we have to check both resolved and unresolved paths, since it's possible
" that they might not get resolved properly (see #187) " that they might not get resolved properly (see #187)
if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0
\ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0 \ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0
let name = fnamemodify(file, ':t:r') let name = fnamemodify(file, ':t:r')
if !get(g:, 'airline#extensions#'.name.'#enabled', 1) || if !get(g:, 'airline#extensions#'.name.'#enabled', 1) ||
\ index(s:loaded_ext, name.'*') > -1 \ index(s:loaded_ext, name) > -1
continue continue
endif endif
try try
@@ -531,16 +494,6 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'omnisharp') call add(s:loaded_ext, 'omnisharp')
endif 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
if (get(g:, 'airline#extensions#zhihu#enabled', 1) && airline#util#has_zhihu())
call airline#extensions#zhihu#init(s:ext)
call add(s:loaded_ext, 'zhihu')
endif
endfunction endfunction
function! airline#extensions#get_loaded_extensions() function! airline#extensions#get_loaded_extensions()
+1 -5
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bjorn Neergaard, w0rp et al. " MIT License. Copyright (c) 2013-2020 Bjorn Neergaard, w0rp et al.
" Plugin: https://github.com/dense-analysis/ale " Plugin: https://github.com/dense-analysis/ale
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -128,10 +128,6 @@ function! airline#extensions#ale#init(ext)
endfunction endfunction
function! s:ale_refresh() function! s:ale_refresh()
if !exists('#airline')
" airline disabled
return
endif
if get(g:, 'airline_skip_empty_sections', 0) if get(g:, 'airline_skip_empty_sections', 0)
exe ':AirlineRefresh!' exe ':AirlineRefresh!'
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2026 Mathias Andersson et al. " MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Plugin: https://github.com/lambdalisue/battery.vim " Plugin: https://github.com/lambdalisue/battery.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2026 Bjoern Petri <bjoern.petri@sundevil.de> " MIT License. Copyright (c) 2020 Bjoern Petri <bjoern.petri@sundevil.de>
" Plugin: https://github.com/MattesGroeger/vim-bookmarks " Plugin: https://github.com/MattesGroeger/vim-bookmarks
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+30 -50
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: fugitive, gina, lawrencium and vcscommand " Plugin: fugitive, gina, lawrencium and vcscommand
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -17,8 +17,8 @@ scriptencoding utf-8
let s:vcs_config = { let s:vcs_config = {
\ 'git': { \ 'git': {
\ 'exe': 'git', \ 'exe': 'git',
\ 'cmd': 'git --no-optional-locks status --porcelain -- ', \ 'cmd': 'git status --porcelain -- ',
\ 'dirty': 'git --no-optional-locks status -uno --porcelain --ignore-submodules', \ 'dirty': 'git status -uno --porcelain --ignore-submodules',
\ 'untracked_mark': '??', \ 'untracked_mark': '??',
\ 'exclude': '\.git', \ 'exclude': '\.git',
\ 'update_branch': 's:update_git_branch', \ 'update_branch': 's:update_git_branch',
@@ -86,39 +86,36 @@ let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7)
function! s:update_git_branch() function! s:update_git_branch()
call airline#util#ignore_next_focusgain() call airline#util#ignore_next_focusgain()
if airline#util#has_fugitive() if !airline#util#has_fugitive() && !airline#util#has_gina()
call s:config_fugitive_branch()
elseif airline#util#has_gina()
call s:config_gina_branch()
else
let s:vcs_config['git'].branch = '' let s:vcs_config['git'].branch = ''
return return
endif endif
endfunction if airline#util#has_fugitive()
let s:vcs_config['git'].branch = exists("*FugitiveHead") ?
function! s:config_fugitive_branch() abort \ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
let s:vcs_config['git'].branch = FugitiveHead(s:sha1size) if s:vcs_config['git'].branch is# 'master' &&
if s:vcs_config['git'].branch is# 'master' && \ airline#util#winwidth() < 81
\ airline#util#winwidth() < 81 " Shorten default a bit
" Shorten default a bit let s:vcs_config['git'].branch='mas'
let s:vcs_config['git'].branch='mas' endif
endif else
endfunction try
let g:gina#component#repo#commit_length = s:sha1size
function! s:config_gina_branch() abort let s:vcs_config['git'].branch = gina#component#repo#branch()
try catch
let g:gina#component#repo#commit_length = s:sha1size endtry
let s:vcs_config['git'].branch = gina#component#repo#branch() if s:vcs_config['git'].branch is# 'master' &&
catch \ airline#util#winwidth() < 81
endtry " Shorten default a bit
if s:vcs_config['git'].branch is# 'master' && let s:vcs_config['git'].branch='mas'
\ airline#util#winwidth() < 81 endif
" Shorten default a bit
let s:vcs_config['git'].branch='mas'
endif endif
endfunction endfunction
function! s:display_git_branch() function! s:display_git_branch()
" disable FocusGained autocommand, might cause loops because system() causes
" a refresh, which causes a system() command again #2029
call airline#util#ignore_next_focusgain()
let name = b:buffer_vcs_config['git'].branch let name = b:buffer_vcs_config['git'].branch
try try
let commit = matchstr(FugitiveParse()[0], '^\x\+') let commit = matchstr(FugitiveParse()[0], '^\x\+')
@@ -126,15 +123,8 @@ function! s:display_git_branch()
if has_key(s:names, commit) if has_key(s:names, commit)
let name = get(s:names, commit)."(".name.")" let name = get(s:names, commit)."(".name.")"
elseif !empty(commit) elseif !empty(commit)
if exists('*FugitiveExecute') let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit)
let ref = FugitiveExecute(['describe', '--all', '--exact-match', commit], bufnr('')).stdout[0] if ref !~ "^fatal: no tag exactly matches"
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.")" let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")"
else else
let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")" let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")"
@@ -328,10 +318,6 @@ endfunction
function! s:reset_untracked_cache(shellcmdpost) function! s:reset_untracked_cache(shellcmdpost)
" shellcmdpost - whether function was called as a result of ShellCmdPost hook " 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 !g:airline#init#vim_async && !has('nvim')
if a:shellcmdpost if a:shellcmdpost
" Clear cache only if there was no error or the script uses an " Clear cache only if there was no error or the script uses an
@@ -353,17 +339,11 @@ function! s:reset_untracked_cache(shellcmdpost)
endfor endfor
endfunction 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) function! airline#extensions#branch#init(ext)
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head') call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler() autocmd ShellCmdPost,CmdwinLeave * unlet! b:airline_head b:airline_do_mq_check
autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler() autocmd User AirlineBeforeRefresh unlet! b:airline_head b:airline_do_mq_check
autocmd BufWritePost * call s:reset_untracked_cache(0) autocmd BufWritePost * call s:reset_untracked_cache(0)
autocmd ShellCmdPost * call s:reset_untracked_cache(1) autocmd ShellCmdPost * call s:reset_untracked_cache(1)
endfunction endfunction
+2 -2
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/bling/vim-bufferline " Plugin: https://github.com/bling/vim-bufferline
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -20,7 +20,7 @@ function! airline#extensions#bufferline#init(ext)
endif endif
if exists("+autochdir") && &autochdir == 1 if exists("+autochdir") && &autochdir == 1
" if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well " if 'acd' is set, vim-airline uses the path section, so we need ot redefine this here as well
call airline#parts#define_raw('path', '%{bufferline#refresh_status()}'.bufferline#get_status_string()) call airline#parts#define_raw('path', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
else else
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string()) call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2026 Mathias Andersson et al. " MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Plugin: https://github.com/tpope/vim-capslock " Plugin: https://github.com/tpope/vim-capslock
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+22 -22
View File
@@ -1,10 +1,11 @@
" MIT License. Copyright (c) 2019-2026 Peng Guanwen et al. " MIT License. Copyright (c) 2019-2020 Peng Guanwen et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
" Plugin: https://github.com/neoclide/coc " Plugin: https://github.com/neoclide/coc
scriptencoding utf-8 scriptencoding utf-8
let s:show_coc_status = get(g:, 'airline#extensions#coc#show_coc_status', 1) let s:error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:')
let s:warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:')
function! airline#extensions#coc#get_warning() abort function! airline#extensions#coc#get_warning() abort
return airline#extensions#coc#get('warning') return airline#extensions#coc#get('warning')
@@ -15,40 +16,39 @@ function! airline#extensions#coc#get_error() abort
endfunction endfunction
function! airline#extensions#coc#get(type) abort function! airline#extensions#coc#get(type) abort
if !exists(':CocCommand') | return '' | endif if !exists(':CocCommand')
return ''
endif
let _backup = get(g:, 'coc_stl_format', '')
let is_err = (a:type is# 'error') 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', {}) let info = get(b:, 'coc_diagnostic_info', {})
if empty(info) | return '' | endif if empty(info) | return '' | endif
let cnt = get(info, a:type, 0) let cnt = get(info, a:type, 0)
if empty(cnt) | return '' | endif if !empty(_backup)
let g:coc_stl_format = _backup
endif
let error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:') if empty(cnt)
let warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:') return ''
let error_format = get(g:, 'airline#extensions#coc#stl_format_err', '%C(L%L)') else
let warning_format = get(g:, 'airline#extensions#coc#stl_format_warn', '%C(L%L)') return (is_err ? s:error_symbol : s:warning_symbol).cnt
endif
" 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 endfunction
function! airline#extensions#coc#get_status() abort function! airline#extensions#coc#get_status() abort
" Shorten text for windows < 91 characters " Shorten text for windows < 91 characters
let status = airline#util#shorten(get(g:, 'coc_status', ''), 91, 9) return 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 endfunction
function! airline#extensions#coc#init(ext) abort 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_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_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_status', 'airline#extensions#coc#get_status')
call airline#parts#define_function('coc_current_function', 'airline#extensions#coc#get_current_function')
endfunction endfunction
-17
View File
@@ -1,17 +0,0 @@
" MIT License. Copyright (c) 2014-2026 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
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/wincent/command-t " Plugin: https://github.com/wincent/command-t
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/csv.vim " Plugin: https://github.com/chrisbra/csv.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/ctrlpvim/ctrlp.vim " Plugin: https://github.com/ctrlpvim/ctrlp.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/szw/vim-ctrlspace " Plugin: https://github.com/szw/vim-ctrlspace
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+2 -5
View File
@@ -1,6 +1,7 @@
" MIT Licsense. " MIT Licsense.
" Plugin: https://github.com/vheon/vim-cursormode " Plugin: https://github.com/vheon/vim-cursormode
" Copyright (C) 2014-2026 Andrea Cedraro <a.cedraro@gmail.com>, Eduardo Suarez-Santana <e.suarezsantana@gmail.com> " Copyright (C) 2014 Andrea Cedraro <a.cedraro@gmail.com>,
" Copyright (C) 2017 Eduardo Suarez-Santana <e.suarezsantana@gmail.com>
scriptencoding utf-8 scriptencoding utf-8
@@ -106,10 +107,6 @@ augroup airline#extensions#cursormode
augroup END augroup END
function! airline#extensions#cursormode#activate() function! airline#extensions#cursormode#activate()
if !exists('#airline')
" airline disabled
return
endif
let s:color_map = s:get_color_map() let s:color_map = s:get_color_map()
call airline#extensions#cursormode#set() call airline#extensions#cursormode#set()
endfunction endfunction
+17 -39
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -7,15 +7,14 @@ 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', { let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
\ 'b': 79, \ 'b': 79,
\ 'x': 60, \ 'x': 60,
\ 'y': 80, \ 'y': 88,
\ 'z': 45, \ 'z': 45,
\ 'warning': 80, \ 'warning': 80,
\ 'error': 80, \ 'error': 80,
\ 'warning2': 80,
\ }) \ })
let s:layout = get(g:, 'airline#extensions#default#layout', [ let s:layout = get(g:, 'airline#extensions#default#layout', [
\ [ 'a', 'b', 'c' ], \ [ 'a', 'b', 'c' ],
\ [ 'x', 'y', 'z', 'warning', 'error', 'warning2' ] \ [ 'x', 'y', 'z', 'warning', 'error' ]
\ ]) \ ])
function! s:get_section(winnr, key, ...) function! s:get_section(winnr, key, ...)
@@ -33,24 +32,9 @@ function! s:get_section(winnr, key, ...)
return empty(text) ? '' : prefix.text.suffix return empty(text) ? '' : prefix.text.suffix
endfunction endfunction
function! s:eval_section_empty(content)
let exprlist = []
call substitute(a:content, '%{\([^}]*\)}', '\=add(exprlist, submatch(1))', 'g')
for expr in exprlist
try
if !empty(eval(expr))
return 0
endif
catch
return 0
endtry
endfor
return 1
endfunction
function! s:build_sections(builder, context, keys) function! s:build_sections(builder, context, keys)
for key in a:keys for key in a:keys
if (key == 'warning' || key == 'error' || key == 'warning2') && !a:context.active if (key == 'warning' || key == 'error') && !a:context.active
continue continue
endif endif
call s:add_section(a:builder, a:context, key) call s:add_section(a:builder, a:context, key)
@@ -65,30 +49,21 @@ if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch8
\ (v:version == 704 && !has("patch1511")) \ (v:version == 704 && !has("patch1511"))
" i have no idea why the warning section needs special treatment, but it's " i have no idea why the warning section needs special treatment, but it's
" needed to prevent separators from showing up " needed to prevent separators from showing up
if ((a:key == 'error' || a:key == 'warning' || a:key == 'warning2') if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
\ && empty(s:get_section(a:context.winnr, a:key)))
return return
endif endif
if a:key == 'warning2' && airline#util#has_multiline() if condition
let section = s:get_section(a:context.winnr, a:key) call a:builder.add_raw('%(')
if !s:eval_section_empty(section) endif
call a:builder.add_raw('%@%#airline_warning#'.section) call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
endif if condition
else call a:builder.add_raw('%)')
if condition
call a:builder.add_raw('%(')
endif
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
if condition
call a:builder.add_raw('%)')
endif
endif endif
endfunction endfunction
else else
" older version don't like the use of %(%) " older version don't like the use of %(%)
function! s:add_section(builder, context, key) function! s:add_section(builder, context, key)
if ((a:key == 'error' || a:key == 'warning') if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key)))
\ && empty(s:get_section(a:context.winnr, a:key)))
return return
endif endif
if a:key == 'warning' if a:key == 'warning'
@@ -101,14 +76,17 @@ else
endfunction endfunction
endif endif
function! airline#extensions#default#apply(builder, context) abort function! airline#extensions#default#apply(builder, context)
let winnr = a:context.winnr let winnr = a:context.winnr
let active = a:context.active let active = a:context.active
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse)) 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]) call s:build_sections(a:builder, a:context, s:layout[0])
else else
let text = !empty(s:get_section(winnr, 'c')) ? s:get_section(winnr, 'c') : ' %f%m ' let text = s:get_section(winnr, 'c')
if empty(text)
let text = ' %f%m '
endif
call a:builder.add_section('airline_c'.(a:context.bufnr), text) call a:builder.add_section('airline_c'.(a:context.bufnr), text)
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2017-2026 Thomas Dy et al. " MIT License. Copyright (c) 2017-2020 Thomas Dy et al.
" Plugin: https://github.com/Shougo/denite.nvim " Plugin: https://github.com/Shougo/denite.nvim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" PLugin: https://eclim.org " PLugin: https://eclim.org
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+3 -3
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -23,7 +23,7 @@ function! airline#extensions#example#init(ext)
call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}') 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 " Next up we add a funcref so that we can run some code prior to the
" statusline getting modified. " statusline getting modifed.
call a:ext.add_statusline_func('airline#extensions#example#apply') call a:ext.add_statusline_func('airline#extensions#example#apply')
" You can also add a funcref for inactive statuslines. " You can also add a funcref for inactive statuslines.
@@ -40,7 +40,7 @@ function! airline#extensions#example#apply(...)
" section_c. " section_c.
let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c) let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c)
" Then we just append this extension to it, optionally using separators. " Then we just append this extenion to it, optionally using separators.
let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}' let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}'
endif endif
endfunction endfunction
+21 -48
View File
@@ -1,63 +1,36 @@
" MIT License. Copyright (c) 2013-2026 " MIT License. Copyright (c) 2013-2020
" Plugin: https://github.com/lambdalisue/fern.vim " Plugin: https://github.com/lambdalisue/fern.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
if !get(g:, 'loaded_fern', 0) if !get(g:, 'fern_loaded', 0)
finish finish
endif endif
function! airline#extensions#fern#apply_active(...) abort function! airline#extensions#fern#apply(...) abort
" check if current buffer is both fern and active if (&ft =~# 'fern')
if (&ft =~# 'fern') && a:2.active ==# '1' let spc = g:airline_symbols.space
call airline#extensions#fern#configure_sections(a:1, a:2) let fri = fern#fri#parse(expand('%f'))
return 1
endif
endfunction
call a:1.add_section('airline_a', spc.'fern'.spc)
function! airline#extensions#fern#apply_inactive(...) abort if exists('*airline#extensions#branch#get_head')
" check if referenced buffer is both fern and inactive call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
if getbufvar(a:2.bufnr, '&filetype') ==# 'fern' && a:2.active ==# '0' else
call airline#extensions#fern#configure_sections(a:1, a:2) call a:1.add_section('airline_b', '')
return 1
endif
endfunction
function! airline#extensions#fern#configure_sections(win, context) abort
let spc = g:airline_symbols.space
let fri = fern#fri#parse(bufname(a:context.bufnr))
let abspath = ''
" Replace uses fern-replacer filetype, do not try to parse in that case
if &ft ==# 'fern' && fri.scheme ==# 'fern'
let abspath = fern#fri#to#filepath(fern#fri#parse(fri.path))
endif
call a:win.add_section('airline_a', spc.'fern'.spc)
if exists('*airline#extensions#branch#get_head')
" because fern navigation changes an internal _fri_ and not the working directory
" we need to give it some help so the branch name gets updated
try
if &ft ==# 'fern'
execute 'lcd' fnameescape(abspath)
endif
catch /^Vim\%((\a\+)\)\=:E344:/
call a:win.add_section('airline_b', '')
endtry
call a:win.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
else
call a:win.add_section('airline_b', '')
endif
if !(fri.authority =~# '^drawer')
call a:win.add_section('airline_c', spc.fnamemodify(abspath, ':~'))
call a:win.split()
if len(get(g:, 'fern#comparators', {}))
call a:win.add_section('airline_y', spc.'%{fern#comparator}'.spc)
endif 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 endif
endfunction endfunction
function! airline#extensions#fern#init(ext) abort function! airline#extensions#fern#init(ext) abort
let g:fern_force_overwrite_statusline = 0 let g:fern_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#fern#apply_active') call a:ext.add_statusline_func('airline#extensions#fern#apply')
call a:ext.add_inactive_statusline_func('airline#extensions#fern#apply_inactive')
endfunction endfunction
+22 -31
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2017-2026 Cimbali et al " MIT License. Copyright (c) 2017-2020 Cimbali et al
" Plugin: https://github.com/tpope/vim-fugitive " Plugin: https://github.com/tpope/vim-fugitive
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -8,54 +8,45 @@ if !airline#util#has_fugitive()
finish finish
endif endif
let s:has_percent_eval = v:version > 802 || (v:version == 802 && has("patch2854")) function! s:ModifierFlags()
return (exists("+autochdir") && &autochdir) ? ':p' : ':.'
endfunction
function! airline#extensions#fugitiveline#bufname() abort function! airline#extensions#fugitiveline#bufname()
if !exists('b:fugitive_name') if !exists('b:fugitive_name')
let b:fugitive_name = '' let b:fugitive_name = ''
try try
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal') if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
let b:fugitive_name = FugitiveReal(bufname('%')) 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 endif
catch catch
endtry endtry
endif endif
let fmod = (exists("+autochdir") && &autochdir) ? ':p' : ':.' let fmod = s:ModifierFlags()
let result=''
if empty(b:fugitive_name) if empty(b:fugitive_name)
if empty(bufname('%')) return fnamemodify(bufname('%'), fmod)
return &buftype ==# 'nofile' ? '[Scratch]' : '[No Name]'
endif
return s:has_percent_eval ? '%f' : fnamemodify(bufname('%'), fmod)
else else
return s:has_percent_eval ? '%f [git]' : (fnamemodify(b:fugitive_name, fmod). " [git]") return fnamemodify(b:fugitive_name, fmod). " [git]"
endif endif
endfunction endfunction
function! s:sh_autocmd_handler() function! airline#extensions#fugitiveline#init(ext)
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 exists("+autochdir") && &autochdir
" if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well " if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well
if get(g:, 'airline_stl_path_style', 'default') ==# 'short' call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m')
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 else
if get(g:, 'airline_stl_path_style', 'default') ==# 'short' call airline#parts#define_raw('file', '%<%{airline#extensions#fugitiveline#bufname()}%m')
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 endif
autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler() autocmd ShellCmdPost,CmdwinLeave * unlet! b:fugitive_name
autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler() autocmd User AirlineBeforeRefresh unlet! b:fugitive_name
endfunction endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/junegunn/fzf, https://github.com/junegunn/fzf.vim " Plugin: https://github.com/junegunn/fzf, https://github.com/junegunn/fzf.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2026 Mathias Andersson et al. " MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Written by Kamil Cukrowski 2020 " Written by Kamil Cukrowski 2020
" Plugin: https://github.com/jsfaint/gen_tags.vim " Plugin: https://github.com/jsfaint/gen_tags.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+2 -6
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 " MIT License. Copyright (c) 2013-2020
" Plugin: https://github.com/lambdalisue/gina.vim " Plugin: https://github.com/lambdalisue/gina.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -8,11 +8,7 @@ if !get(g:, 'loaded_gina', 0)
endif endif
function! airline#extensions#gina#apply(...) abort function! airline#extensions#gina#apply(...) abort
" gina.vim seems to set b:gina_initialized = 1 in diff buffers it open, if (&ft =~# 'gina' && &ft !~# 'blame') || &ft ==# 'diff'
" 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_a', ' gina ')
call a:1.add_section('airline_b', ' %{gina#component#repo#branch()} ') call a:1.add_section('airline_b', ' %{gina#component#repo#branch()} ')
call a:1.split() call a:1.split()
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2026 Mathias Andersson et al. " MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Plugin: https://github.com/mhinz/vim-grepper " Plugin: https://github.com/mhinz/vim-grepper
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2014-2026 Mathias Andersson et al. " MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Plugin: https://github.com/ludovicchabant/vim-gutentags " Plugin: https://github.com/ludovicchabant/vim-gutentags
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+30 -45
View File
@@ -1,6 +1,5 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: vim-gitgutter, vim-signify, changesPlugin, quickfixsigns, coc-git, " Plugin: vim-gitgutter, vim-signify, changesPlugin, quickfixsigns, coc-git
" gitsigns.nvim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -9,7 +8,6 @@ if !get(g:, 'loaded_signify', 0)
\ && !get(g:, 'loaded_gitgutter', 0) \ && !get(g:, 'loaded_gitgutter', 0)
\ && !get(g:, 'loaded_changes', 0) \ && !get(g:, 'loaded_changes', 0)
\ && !get(g:, 'loaded_quickfixsigns', 0) \ && !get(g:, 'loaded_quickfixsigns', 0)
\ && !exists(':Gitsigns')
\ && !exists("*CocAction") \ && !exists("*CocAction")
finish finish
endif endif
@@ -28,31 +26,6 @@ function! s:coc_git_enabled() abort
return 1 return 1
endfunction 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 function! s:get_hunks_signify() abort
let hunks = sy#repo#get_stats() let hunks = sy#repo#get_stats()
if hunks[0] >= 0 if hunks[0] >= 0
@@ -61,9 +34,34 @@ function! s:get_hunks_signify() abort
return [] return []
endfunction endfunction
function! s:get_hunks_coc() abort
let hunks = get(b:, 'coc_git_status', '')
if empty(hunks)
return []
endif
let result = [0, 0, 0]
for val in split(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:is_branch_empty() abort
return exists('*airline#extensions#branch#head') &&
\ empty(get(b:, 'airline_head', ''))
endfunction
function! s:get_hunks_gitgutter() abort function! s:get_hunks_gitgutter() abort
let hunks = GitGutterGetHunkSummary() if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty()
return hunks == [0, 0, 0] ? [] : hunks return ''
endif
return GitGutterGetHunkSummary()
endfunction endfunction
function! s:get_hunks_changes() abort function! s:get_hunks_changes() abort
@@ -71,16 +69,6 @@ function! s:get_hunks_changes() abort
return hunks == [0, 0, 0] ? [] : hunks return hunks == [0, 0, 0] ? [] : hunks
endfunction endfunction
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 function! s:get_hunks_empty() abort
return '' return ''
endfunction endfunction
@@ -89,14 +77,12 @@ function! airline#extensions#hunks#get_raw_hunks() abort
if !exists('b:source_func') || get(b:, 'source_func', '') is# 's:get_hunks_empty' if !exists('b:source_func') || get(b:, 'source_func', '') is# 's:get_hunks_empty'
if get(g:, 'loaded_signify') && sy#buffer_is_active() if get(g:, 'loaded_signify') && sy#buffer_is_active()
let b:source_func = 's:get_hunks_signify' let b:source_func = 's:get_hunks_signify'
elseif exists('*GitGutterGetHunkSummary') && get(g:, 'gitgutter_enabled') elseif exists('*GitGutterGetHunkSummary')
let b:source_func = 's:get_hunks_gitgutter' let b:source_func = 's:get_hunks_gitgutter'
elseif exists('*changes#GetStats') elseif exists('*changes#GetStats')
let b:source_func = 's:get_hunks_changes' let b:source_func = 's:get_hunks_changes'
elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary') elseif exists('*quickfixsigns#vcsdiff#GetHunkSummary')
let b:source_func = '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() elseif s:coc_git_enabled()
let b:source_func = 's:get_hunks_coc' let b:source_func = 's:get_hunks_coc'
else else
@@ -118,7 +104,6 @@ function! airline#extensions#hunks#get_hunks() abort
\ get(b:, 'source_func', '') isnot# 's:get_hunks_gitgutter' && \ 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_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' \ get(b:, 'source_func', '') isnot# 's:get_hunks_coc'
return b:airline_hunks return b:airline_hunks
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Doron Behar, C.Brabandt et al. " MIT License. Copyright (c) 2013-2020 Doron Behar, C.Brabandt et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bjorn Neergaard, hallettj et al. " MIT License. Copyright (c) 2013-2020 Bjorn Neergaard, hallettj et al.
" Plugin: https://github.com/autozimu/LanguageClient-neovim " Plugin: https://github.com/autozimu/LanguageClient-neovim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -35,10 +35,6 @@ function! s:record_diagnostics(state)
endfunction endfunction
function! s:get_diagnostics() function! s:get_diagnostics()
if !exists('#airline')
" airline disabled
return
endif
call LanguageClient#getState(function("s:record_diagnostics")) call LanguageClient#getState(function("s:record_diagnostics"))
endfunction endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2018-2026 mox et al. " MIT License. Copyright (c) 2018-2020 mox et al.
" Plugin: https://github.com/mox-mox/vim-localsearch " Plugin: https://github.com/mox-mox/vim-localsearch
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -45
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 François-Xavier Carton et al. " MIT License. Copyright (c) 2013-2020 François-Xavier Carton et al.
" Plugin: https://github.com/prabirshrestha/vim-lsp " Plugin: https://github.com/prabirshrestha/vim-lsp
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -61,51 +61,7 @@ function! airline#extensions#lsp#get_error() abort
return airline#extensions#lsp#get('error') return airline#extensions#lsp#get('error')
endfunction 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 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_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_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 endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/neomake/neomake " Plugin: https://github.com/neomake/neomake
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
-46
View File
@@ -1,46 +0,0 @@
" MIT License. Copyright (c) 2026-2026 Wu Zhenyu et al
" Plugin: https://github.com/lambdalisue/nerdfont.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !get(g:, 'loaded_nerdfont', 0)
finish
endif
function! airline#extensions#nerdfont#fileformat() abort
if &fileformat ==# 'dos'
return nerdfont#platform#find('windows')
endif
if &fileformat ==# 'mac'
return nerdfont#platform#find('macos')
endif
if &fileformat ==# 'unix'
if has('unix')
return nerdfont#platform#find()
else
return nerdfont#platform#find('linux')
endif
endif
endfunction
function! airline#extensions#nerdfont#ffenc() abort
let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
let bomb = &bomb ? '[BOM]' : ''
let noeolf = &eol ? '' : '[!EOL]'
let ff = strlen(&ff) ? '['.&ff.']' : ''
if expected is# &fenc.bomb.noeolf.ff
return ''
else
return &fenc.bomb.noeolf.' '.airline#extensions#nerdfont#fileformat()
endif
endfunction
function! airline#extensions#nerdfont#init(ext) abort
call airline#parts#define_function('ffenc', 'airline#extensions#nerdfont#ffenc')
call a:ext.add_statusline_func('airline#extensions#nerdfont#apply')
endfunction
function! airline#extensions#nerdfont#apply(...) abort
call airline#extensions#append_to_section('x', ' %{nerdfont#find()}')
endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: http://www.drchip.org/astronaut/vim/#NETRW " Plugin: http://www.drchip.org/astronaut/vim/#NETRW
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/NrrwRgn " Plugin: https://github.com/chrisbra/NrrwRgn
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+5 -28
View File
@@ -1,12 +1,11 @@
" Apache 2.0 license. Copyright (c) 2019-2026 Copyright Neovim contributors. " Apache 2.0 license. Copyright (c) 2019-2020 Copyright Neovim contributors.
" Plugin: https://github.com/neovim/nvim-lsp " Plugin: https://github.com/neovim/nvim-lsp
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1) if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && has('nvim') \ && exists(':LspInstallInfo'))
\ && luaeval('vim.lsp ~= nil'))
finish finish
endif endif
@@ -15,46 +14,24 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
endfunction endfunction
function! airline#extensions#nvimlsp#get(type) abort function! airline#extensions#nvimlsp#get(type) abort
if has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.get_clients({ bufnr = 0 }))') if !exists(':LspInstallInfo')
return ''
elseif !has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
return '' return ''
endif endif
let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:') let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:')
let warning_symbol = get(g:, 'airline#extensions#nvimlsp#warning_symbol', 'W:') 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 is_err = a:type ==# 'Error'
let symbol = is_err ? error_symbol : warning_symbol let symbol = is_err ? error_symbol : warning_symbol
if luaeval("pcall(require, 'vim.diagnostic')") if luaeval("pcall(require, 'vim.lsp.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) let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type)
else else
let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type) let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type)
endif endif
if show_line_numbers == 1 && luaeval("pcall(require, 'vim.diagnostic')") && num > 0 return s:airline_nvimlsp_count(num, symbol)
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 + 1
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 endfunction
function! airline#extensions#nvimlsp#get_warning() abort function! airline#extensions#nvimlsp#get_warning() abort
+2 -6
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/tpope/vim-obsession " Plugin: https://github.com/tpope/vim-obsession
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -14,14 +14,10 @@ if !exists('g:airline#extensions#obsession#indicator_text')
let g:airline#extensions#obsession#indicator_text = '$' let g:airline#extensions#obsession#indicator_text = '$'
endif endif
if !exists('g:airline#extensions#obsession#indicator_text_paused')
let g:airline#extensions#obsession#indicator_text_paused = '' " vim-obsession defaults to 'S'
endif
function! airline#extensions#obsession#init(ext) function! airline#extensions#obsession#init(ext)
call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status') call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status')
endfunction endfunction
function! airline#extensions#obsession#get_status() function! airline#extensions#obsession#get_status()
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), (g:airline#extensions#obsession#indicator_text_paused . s:spc)) return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '')
endfunction endfunction
+3 -14
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling, Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -43,10 +43,6 @@ function! airline#extensions#po#shorten()
endfunction endfunction
function! airline#extensions#po#on_winenter() function! airline#extensions#po#on_winenter()
if !exists('#airline')
" airline disabled
return
endif
" only reset cache, if the window size changed " only reset cache, if the window size changed
if get(b:, 'airline_winwidth', 0) != airline#util#winwidth() if get(b:, 'airline_winwidth', 0) != airline#util#winwidth()
let b:airline_winwidth = airline#util#winwidth() let b:airline_winwidth = airline#util#winwidth()
@@ -55,17 +51,11 @@ function! airline#extensions#po#on_winenter()
endif endif
endfunction endfunction
function! s:autocmd_handler()
if exists('#airline')
unlet! b:airline_po_stats
endif
endfunction
function! airline#extensions#po#apply(...) function! airline#extensions#po#apply(...)
if &ft ==# 'po' if &ft ==# 'po'
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}') 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 " Also reset the cache variable, if a window has been split, e.g. the winwidth changed
autocmd airline BufWritePost * call s:autocmd_handler() autocmd airline BufWritePost * unlet! b:airline_po_stats
autocmd airline WinEnter * call airline#extensions#po#on_winenter() autocmd airline WinEnter * call airline#extensions#po#on_winenter()
endif endif
endfunction endfunction
@@ -75,9 +65,8 @@ function! airline#extensions#po#stats()
return b:airline_po_stats return b:airline_po_stats
endif endif
" Write stdout to null because we only want to see warnings.
if g:airline#init#is_windows if g:airline#init#is_windows
let cmd = 'msgfmt --statistics -o /NUL ' let cmd = 'msgfmt --statistics -o NUL '
else else
let cmd = 'msgfmt --statistics -o /dev/null -- ' let cmd = 'msgfmt --statistics -o /dev/null -- '
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/petobens/poet_v " Plugin: https://github.com/petobens/poet_v
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/edkolev/promptline.vim " Plugin: https://github.com/edkolev/promptline.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
-38
View File
@@ -1,38 +0,0 @@
" 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
-37
View File
@@ -1,37 +0,0 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al.
" 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
+5 -18
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" This extension is inspired by vim-anzu <https://github.com/osyo-manga/vim-anzu>. " This extension is inspired by vim-anzu <https://github.com/osyo-manga/vim-anzu>.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -17,19 +17,6 @@ function! airline#extensions#searchcount#apply(...) abort
\ '%{v:hlsearch ? airline#extensions#searchcount#status() : ""}') \ '%{v:hlsearch ? airline#extensions#searchcount#status() : ""}')
endfunction 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 function! airline#extensions#searchcount#status() abort
try try
let result = searchcount(#{recompute: 1, maxcount: -1}) let result = searchcount(#{recompute: 1, maxcount: -1})
@@ -37,18 +24,18 @@ function! airline#extensions#searchcount#status() abort
return '' return ''
endif endif
if result.incomplete ==# 1 " timed out if result.incomplete ==# 1 " timed out
return printf('%s[?/??]', s:search_term()) return printf(' /%s [?/??]', @/)
elseif result.incomplete ==# 2 " max count exceeded elseif result.incomplete ==# 2 " max count exceeded
if result.total > result.maxcount && if result.total > result.maxcount &&
\ result.current > result.maxcount \ result.current > result.maxcount
return printf('%s[>%d/>%d]', s:search_term(), return printf('%s[>%d/>%d]', @/,
\ result.current, result.total) \ result.current, result.total)
elseif result.total > result.maxcount elseif result.total > result.maxcount
return printf('%s[%d/>%d]', s:search_term(), return printf('%s[%d/>%d]', @/,
\ result.current, result.total) \ result.current, result.total)
endif endif
endif endif
return printf('%s[%d/%d]', s:search_term(), return printf('%s[%d/%d]', @/,
\ result.current, result.total) \ result.current, result.total)
catch catch
return '' return ''
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/vim-syntastic/syntastic " Plugin: https://github.com/vim-syntastic/syntastic
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+140 -136
View File
@@ -1,5 +1,5 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 et " vim: et ts=2 sts=2 sw=2 et fdm=marker
scriptencoding utf-8 scriptencoding utf-8
@@ -12,9 +12,6 @@ let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0)
let s:tabws = get(g:, 'tabws_loaded', 0) let s:tabws = get(g:, 'tabws_loaded', 0)
let s:current_tabcnt = -1 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) function! airline#extensions#tabline#init(ext)
if has('gui_running') && match(&guioptions, 'e') > -1 if has('gui_running') && match(&guioptions, 'e') > -1
set guioptions-=e set guioptions-=e
@@ -22,14 +19,14 @@ function! airline#extensions#tabline#init(ext)
autocmd User AirlineToggledOn call s:toggle_on() autocmd User AirlineToggledOn call s:toggle_on()
autocmd User AirlineToggledOff call s:toggle_off() autocmd User AirlineToggledOff call s:toggle_off()
call s:toggle_on() call s:toggle_on()
call a:ext.add_theme_func('airline#extensions#tabline#load_theme') call a:ext.add_theme_func('airline#extensions#tabline#load_theme')
endfunction endfunction
function! airline#extensions#tabline#add_label(dict, type, right) function! airline#extensions#tabline#add_label(dict, type, right)
if get(g:, 'airline#extensions#tabline#show_tab_type', 1) 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)) \ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type))
endif endif
endfunction endfunction
@@ -43,12 +40,10 @@ function! airline#extensions#tabline#add_tab_label(dict)
endif endif
endfunction endfunction
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
if !exists(":def") || !airline#util#has_vim9_script() " Legacy VimScript implementation " {{{1
function! s:toggle_off() " {{{2
" Legacy Vim Script Implementation
function! s:toggle_off()
call airline#extensions#tabline#autoshow#off() call airline#extensions#tabline#autoshow#off()
call airline#extensions#tabline#tabs#off() call airline#extensions#tabline#tabs#off()
call airline#extensions#tabline#buffers#off() call airline#extensions#tabline#buffers#off()
@@ -59,8 +54,7 @@ if !exists(":def") || !airline#util#has_vim9_script()
call airline#extensions#tabline#tabws#off() call airline#extensions#tabline#tabws#off()
endif endif
endfunction endfunction
function! s:toggle_on() " {{{2
function! s:toggle_on()
if get(g:, 'airline_statusline_ontop', 0) if get(g:, 'airline_statusline_ontop', 0)
call airline#extensions#tabline#enable() call airline#extensions#tabline#enable()
let &tabline='%!airline#statusline('.winnr().')' let &tabline='%!airline#statusline('.winnr().')'
@@ -78,53 +72,7 @@ if !exists(":def") || !airline#util#has_vim9_script()
set tabline=%!airline#extensions#tabline#get() set tabline=%!airline#extensions#tabline#get()
endfunction endfunction
function! s:update_tabline(forceit) " {{{2
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) if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
return return
endif endif
@@ -145,8 +93,7 @@ if !exists(":def") || !airline#util#has_vim9_script()
call airline#util#doautocmd('BufMRUChange') call airline#util#doautocmd('BufMRUChange')
call airline#extensions#tabline#redraw() call airline#extensions#tabline#redraw()
endfunction endfunction
function! airline#extensions#tabline#redraw() " {{{2
function! airline#extensions#tabline#redraw()
" sometimes, the tabline is not correctly updated see #1580 " sometimes, the tabline is not correctly updated see #1580
" so force redraw here " so force redraw here
if exists(":redrawtabline") == 2 if exists(":redrawtabline") == 2
@@ -158,15 +105,60 @@ if !exists(":def") || !airline#util#has_vim9_script()
let &ro = &ro let &ro = &ro
endif endif
endfunction endfunction
function! airline#extensions#tabline#enable() " {{{2
function! airline#extensions#tabline#enable()
if &lines > 3 if &lines > 3
set showtabline=2 set showtabline=2
endif endif
endfunction endfunction
function! airline#extensions#tabline#load_theme(palette) " {{{2
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)
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
function! airline#extensions#tabline#get() " 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
function! airline#extensions#tabline#get() " {{{2
let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
@@ -195,8 +187,7 @@ if !exists(":def") || !airline#util#has_vim9_script()
return airline#extensions#tabline#tabs#get() return airline#extensions#tabline#tabs#get()
endif endif
endfunction endfunction
function! airline#extensions#tabline#title(n) " {{{2
function! airline#extensions#tabline#title(n)
let title = '' let title = ''
if s:taboo if s:taboo
let title = TabooTabTitle(a:n) let title = TabooTabTitle(a:n)
@@ -217,24 +208,18 @@ if !exists(":def") || !airline#util#has_vim9_script()
let all_buffers = airline#extensions#tabline#buflist#list() let all_buffers = airline#extensions#tabline#buflist#list()
let curbuf = filter(buflist, 'index(all_buffers, v:val) != -1') let curbuf = filter(buflist, 'index(all_buffers, v:val) != -1')
if len(curbuf) == 0 if len(curbuf) == 0
call add(curbuf, tabpagebuflist(a:n)[0]) call add(curbuf, tabpagebuflist()[0])
endif 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) return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf)
endif endif
return title return title
endfunction endfunction
function! airline#extensions#tabline#get_buffer_name(nr, ...) " {{{2
function! airline#extensions#tabline#get_buffer_name(nr, ...)
let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list() let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list()
let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers) return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers)
endfunction endfunction
function! airline#extensions#tabline#new_builder() " {{{2
function! airline#extensions#tabline#new_builder()
let builder_context = { let builder_context = {
\ 'active' : 1, \ 'active' : 1,
\ 'tabline' : 1, \ 'tabline' : 1,
@@ -248,11 +233,9 @@ if !exists(":def") || !airline#util#has_vim9_script()
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ') 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' , '|') let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
endif endif
return airline#extensions#tabline#builder#new(builder_context) return airline#extensions#tabline#builder#new(builder_context)
endfunction endfunction
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr) " {{{2
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
let cur = bufnr('%') let cur = bufnr('%')
if cur == a:bufnr if cur == a:bufnr
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
@@ -271,9 +254,30 @@ if !exists(":def") || !airline#util#has_vim9_script()
endif endif
return group return group
endfunction endfunction
finish function! airline#extensions#tabline#add_tab_label(dict) " {{{2
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
else else
def s:toggle_off(): void " Vim9 Script implementation
"def airline#extensions#tabline#init(ext: dict<any>): void # {{{2
" Seems not to work yet :(
" if has('gui_running') && match(&guioptions, 'e') > -1
" :set guioptions-=e
" endif
" autocmd User AirlineToggledOn call s:toggle_on()
" autocmd User AirlineToggledOff call s:toggle_off()
" s:toggle_on()
" try
" ext.add_theme_func('airline#extensions#tabline#load_theme')
" catch
" endtry
"enddef
def s:toggle_off(): void # {{{2
airline#extensions#tabline#autoshow#off() airline#extensions#tabline#autoshow#off()
airline#extensions#tabline#tabs#off() airline#extensions#tabline#tabs#off()
airline#extensions#tabline#buffers#off() airline#extensions#tabline#buffers#off()
@@ -284,8 +288,7 @@ else
airline#extensions#tabline#tabws#off() airline#extensions#tabline#tabws#off()
endif endif
enddef enddef
def s:toggle_on(): void # {{{2
def s:toggle_on(): void
if get(g:, 'airline_statusline_ontop', 0) if get(g:, 'airline_statusline_ontop', 0)
airline#extensions#tabline#enable() airline#extensions#tabline#enable()
&tabline = '%!airline#statusline(' .. winnr() .. ')' &tabline = '%!airline#statusline(' .. winnr() .. ')'
@@ -302,12 +305,37 @@ else
endif endif
&tabline = '%!airline#extensions#tabline#get()' &tabline = '%!airline#extensions#tabline#get()'
enddef enddef
def s:update_tabline(forceit: number): void # {{{2
def airline#extensions#tabline#load_theme(palette: dict<any>): number if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
# Needs to return a number, because it is implicitly used as extern_funcref return
# And funcrefs should return a value (see airline#util#exec_funcrefs()) endif
if !forceit && get(g:, 'SessionLoad', 0)
return
endif
var match = expand('<afile>')
if pumvisible() if pumvisible()
return 0 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 # {{{2
# TODO: Is this still needed?
:redrawtabline
enddef
def airline#extensions#tabline#enable(): void # {{{2
if &lines > 3
&showtabline = 2
endif
enddef
def airline#extensions#tabline#load_theme(palette: dict<any>): void # {{{2
if pumvisible()
return
endif endif
var colors = get(palette, 'tabline', {}) var colors = get(palette, 'tabline', {})
var tablabel = get(colors, 'airline_tablabel', palette.normal.airline_b) var tablabel = get(colors, 'airline_tablabel', palette.normal.airline_b)
@@ -348,43 +376,8 @@ else
airline#highlighter#exec('airline_tabsel_right', tabsel_right) airline#highlighter#exec('airline_tabsel_right', tabsel_right)
airline#highlighter#exec('airline_tabmod_right', tabmod_right) airline#highlighter#exec('airline_tabmod_right', tabmod_right)
airline#highlighter#exec('airline_tabhid_right', tabhid_right) airline#highlighter#exec('airline_tabhid_right', tabhid_right)
return 0
enddef enddef
def airline#extensions#tabline#get(): string # {{{2
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_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
var show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) var show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
@@ -413,8 +406,7 @@ else
return airline#extensions#tabline#tabs#get() return airline#extensions#tabline#tabs#get()
endif endif
enddef enddef
def airline#extensions#tabline#title(n: number): string # {{{2
def airline#extensions#tabline#title(n: number): string
var title = '' var title = ''
if get(g:, 'airline#extensions#taboo#enabled', 1) && if get(g:, 'airline#extensions#taboo#enabled', 1) &&
get(g:, 'loaded_taboo', 0) && exists("*TabooTabTitle") get(g:, 'loaded_taboo', 0) && exists("*TabooTabTitle")
@@ -434,21 +426,19 @@ else
var buflist = tabpagebuflist(n) var buflist = tabpagebuflist(n)
var winnr = tabpagewinnr(n) var winnr = tabpagewinnr(n)
var all_buffers = airline#extensions#tabline#buflist#list() var all_buffers = airline#extensions#tabline#buflist#list()
var curbuf = filter(buflist, (_, v) => index(all_buffers, v) != -1) var curbuf = filter(buflist, {_, v -> index(all_buffers, v) != -1})
if len(curbuf) == 0 if len(curbuf) == 0
add(curbuf, tabpagebuflist(n)[0]) add(curbuf, tabpagebuflist()[0])
endif endif
return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf) return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf)
endif endif
return title return title
enddef enddef
def airline#extensions#tabline#get_buffer_name(nr: number, buffers = airline#extensions#tabline#buflist#list()): string # {{{2
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' var Formatter = 'airline#extensions#tabline#formatters#' .. get(g:, 'airline#extensions#tabline#formatter', 'default') .. '#format'
return call(Formatter, [ nr, buffers] ) return call(Formatter, [ nr, buffers] )
enddef enddef
def airline#extensions#tabline#new_builder(): dict<any> # {{{2
def airline#extensions#tabline#new_builder(): dict<any>
var builder_context = { var builder_context = {
'active': 1, 'active': 1,
'tabline': 1, 'tabline': 1,
@@ -459,8 +449,7 @@ else
} }
return airline#extensions#tabline#builder#new(builder_context) return airline#extensions#tabline#builder#new(builder_context)
enddef enddef
def airline#extensions#tabline#group_of_bufnr(tab_bufs: list<number>, bufnr: number): string # {{{2
def airline#extensions#tabline#group_of_bufnr(tab_bufs: list<number>, bufnr: number): string
var cur = bufnr('%') var cur = bufnr('%')
var group = '' var group = ''
if cur == bufnr if cur == bufnr
@@ -480,4 +469,19 @@ else
endif endif
return group return group
enddef enddef
"def airline#extensions#tabline#add_label(dict: dict<any>, type: string, right: number): void # {{{2
" # Seems not to work yet :(
" if get(g:, 'airline#extensions#tabline#show_tab_type', 1)
" dict.add_section_spaced('airline_tablabel' .. (right ? '_right' : ''),
" get(g:, 'airline#extensions#tabline#' .. type .. '_label', type))
" endif
"enddef
" def airline#extensions#tabline#add_tab_label(dict: dict<any>): void # {{{2
" var show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1)
" if show_tab_count == 2
" dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
" elseif show_tab_count == 1 && tabpagenr('$') > 1
" dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
" endif
" enddef
endif endif
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 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 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) autocmd BufUnload * call <sid>show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()) - 1)
else else
autocmd TabNew,TabClosed * call <sid>show_tabline(s:tab_min_count, tabpagenr('$')) autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
endif endif
endif endif
+20 -92
View File
@@ -1,11 +1,11 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
let s:spc = g:airline_symbols.space let s:spc = g:airline_symbols.space
let s:current_bufnr = -1 let s:current_bufnr = -1
let s:current_tabnr = -1
let s:current_modified = 0 let s:current_modified = 0
let s:current_tabline = '' let s:current_tabline = ''
let s:current_visible_buffers = [] let s:current_visible_buffers = []
@@ -49,15 +49,14 @@ function! airline#extensions#tabline#buffers#invalidate()
endfunction endfunction
function! airline#extensions#tabline#buffers#get() function! airline#extensions#tabline#buffers#get()
let curbuf = bufnr('%')
let curtab = tabpagenr()
try try
call <sid>map_keys() call <sid>map_keys()
catch catch
" no-op " no-op
endtry endtry
if curbuf == s:current_bufnr && curtab == s:current_tabnr && &columns == s:column_width let cur = bufnr('%')
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified if cur == s:current_bufnr && &columns == s:column_width
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
return s:current_tabline return s:current_tabline
endif endif
endif endif
@@ -78,10 +77,10 @@ function! airline#extensions#tabline#buffers#get()
let b.overflow_group = 'airline_tabhid' let b.overflow_group = 'airline_tabhid'
let b.buffers = airline#extensions#tabline#buflist#list() let b.buffers = airline#extensions#tabline#buflist#list()
if get(g:, 'airline#extensions#tabline#current_first', 0) if get(g:, 'airline#extensions#tabline#current_first', 0)
if index(b.buffers, curbuf) > -1 if index(b.buffers, cur) > -1
call remove(b.buffers, index(b.buffers, curbuf)) call remove(b.buffers, index(b.buffers, cur))
endif endif
let b.buffers = [curbuf] + b.buffers let b.buffers = [cur] + b.buffers
endif endif
function! b.get_group(i) dict function! b.get_group(i) dict
@@ -97,7 +96,6 @@ function! airline#extensions#tabline#buffers#get()
endfunction endfunction
if has("tablineat") if has("tablineat")
" Neovim version
function! b.get_pretitle(i) dict function! b.get_pretitle(i) dict
let bufnum = get(self.buffers, a:i, -1) let bufnum = get(self.buffers, a:i, -1)
return '%'.bufnum.'@airline#extensions#tabline#buffers#clickbuf@' return '%'.bufnum.'@airline#extensions#tabline#buffers#clickbuf@'
@@ -108,17 +106,6 @@ function! airline#extensions#tabline#buffers#get()
endfunction endfunction
endif endif
if has("statusline_click")
" Vim version
function! b.get_pretitle(i) dict
return '%'.get(self.buffers, a:i, -1).'[airline#extensions#tabline#buffers#clickbufVim]'
endfunction
function! b.get_posttitle(i) dict
return '%[]'
endfunction
endif
function! b.get_title(i) dict function! b.get_title(i) dict
let bufnum = get(self.buffers, a:i, -1) let bufnum = get(self.buffers, a:i, -1)
let group = self.get_group(a:i) let group = self.get_group(a:i)
@@ -142,7 +129,7 @@ function! airline#extensions#tabline#buffers#get()
endif endif
endfunction endfunction
let current_buffer = max([index(b.buffers, curbuf), 0]) let current_buffer = max([index(b.buffers, cur), 0])
let last_buffer = len(b.buffers) - 1 let last_buffer = len(b.buffers) - 1
call b.insert_titles(current_buffer, 0, last_buffer) call b.insert_titles(current_buffer, 0, last_buffer)
@@ -155,8 +142,7 @@ function! airline#extensions#tabline#buffers#get()
call airline#extensions#tabline#add_tab_label(b) call airline#extensions#tabline#add_tab_label(b)
let s:current_bufnr = curbuf let s:current_bufnr = cur
let s:current_tabnr = curtab
let s:column_width = &columns let s:column_width = &columns
let s:current_tabline = b.build() let s:current_tabline = b.build()
let s:current_visible_buffers = copy(b.buffers) let s:current_visible_buffers = copy(b.buffers)
@@ -175,10 +161,13 @@ function! s:get_number(index)
return a:index return a:index
endif endif
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0) let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
let number_format = bidx_mode > 1 ? '%02d' : '%d' if bidx_mode > 1
let l:count = bidx_mode == 2 ? a:index+11 : a:index+1 let l:count = bidx_mode == 2 ? a:index+11 : a:index+1
return join(map(split(printf(number_format, l:count), '\zs'), return join(map(split(printf('%02d', l:count), '\zs'),
\ 'get(s:number_map, v:val, "")'), '') \ 'get(s:number_map, v:val, "")'), '')
else
return get(s:number_map, a:index+1, '')
endif
endfunction endfunction
function! s:select_tab(buf_index) function! s:select_tab(buf_index)
@@ -210,8 +199,8 @@ function! s:map_keys()
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1) let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
if bidx_mode > 0 if bidx_mode > 0
if bidx_mode == 1 if bidx_mode == 1
for i in range(1, 10) for i in range(1, 9)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i%10, i-1) exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i, i-1)
endfor endfor
else else
let start_idx = bidx_mode == 2 ? 11 : 1 let start_idx = bidx_mode == 2 ? 11 : 1
@@ -221,68 +210,11 @@ function! s:map_keys()
endif endif
noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR> noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR>
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR> noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
noremap <silent> <Plug>AirlineSelectFirstTab :<C-u>call <SID>select_tab(0)<CR>
noremap <silent> <Plug>AirlineSelectLastTab :<C-u>call <SID>select_tab(len(airline#extensions#tabline#buflist#list()) - 1)<CR>
" Enable this for debugging " Enable this for debugging
" com! AirlineBufferList :echo map(copy(s:current_visible_buffers), {i,k -> k.": ".bufname(k)}) " com! AirlineBufferList :echo map(copy(s:current_visible_buffers), {i,k -> k.": ".bufname(k)})
endif endif
endfunction endfunction
function! airline#extensions#tabline#buffers#clickbufVim(dict) abort
" Clickable buffers in Vim, requires v9.2.0338
" single mouse button click without modifiers pressed
if a:dict.nclicks == 1 && empty(a:dict.mods)
if a:dict.button is# 'l'
" left button - switch to buffer
try
silent execute 'buffer' a:dict.minwid
catch
call airline#util#warning("Cannot switch buffer, current buffer is modified! See :h 'hidden'")
endtry
elseif a:dict.button is# 'm'
" middle button - delete buffer
if get(g:, 'airline#extensions#tabline#middle_click_preserves_windows', 0) == 0 || winnr('$') == 1
" just simply delete the clicked buffer. This will cause windows
" associated with the clicked buffer to be closed.
silent execute 'bdelete' a:dict.minwid
else
" find windows displaying the clicked buffer and open an new
" buffer in them.
let current_window = bufwinnr("%")
let window_number = bufwinnr(a:dict.minwid)
let last_window_visited = -1
" Set to 1 if the clicked buffer was open in any windows.
let buffer_in_window = 0
" Find the next window with the clicked buffer open. If bufwinnr()
" returns the same window number, this is because we clicked a new
" buffer, and then tried editing a new buffer. Vim won't create a
" new empty buffer for the same window, so we get the same window
" number from bufwinnr(). In this case we just give up and don't
" delete the buffer.
" This could be made cleaner if we could check if the clicked buffer
" is a new buffer, but I don't know if there is a way to do that.
while window_number != -1 && window_number != last_window_visited
let buffer_in_window = 1
silent execute window_number . 'wincmd w'
silent execute 'enew'
let last_window_visited = window_number
let window_number = bufwinnr(a:minwid)
endwhile
silent execute current_window . 'wincmd w'
if window_number != last_window_visited || buffer_in_window == 0
silent execute 'bdelete' a:dict.minwid
endif
endif
endif
endif
" force a redraw
return 1
endfunction
function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, modifiers) abort function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, modifiers) abort
" Clickable buffers " Clickable buffers
" works only in recent NeoVim with has('tablineat') " works only in recent NeoVim with has('tablineat')
@@ -291,11 +223,7 @@ function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, mo
if a:clicks == 1 && a:modifiers !~# '[^ ]' if a:clicks == 1 && a:modifiers !~# '[^ ]'
if a:button is# 'l' if a:button is# 'l'
" left button - switch to buffer " left button - switch to buffer
try silent execute 'buffer' a:minwid
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' elseif a:button is# 'm'
" middle button - delete buffer " middle button - delete buffer
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -8,10 +8,6 @@ function! airline#extensions#tabline#buflist#invalidate()
endfunction endfunction
function! airline#extensions#tabline#buflist#clean() function! airline#extensions#tabline#buflist#clean()
if !exists('#airline')
" airline disabled
return
endif
call airline#extensions#tabline#buflist#invalidate() call airline#extensions#tabline#buflist#invalidate()
call airline#extensions#tabline#buffers#invalidate() call airline#extensions#tabline#buffers#invalidate()
endfunction endfunction
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -71,7 +71,7 @@ endfunction
" Compute the change in size of the tabline caused by separators " Compute the change in size of the tabline caused by separators
" "
" This should be kept up-to-date with |s:get_transitioned_separator| and " This should be kept up-to-date with |s:get_transitioned_seperator| and
" |s:get_separator| in autoload/airline/builder.vim " |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) 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 let sep_change = 0
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2026 Kevin Sapper et al. " MIT License. Copyright (c) 2016-2020 Kevin Sapper et al.
" Plugin: https://github.com/szw/vim-ctrlspace " Plugin: https://github.com/szw/vim-ctrlspace
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -24,16 +24,13 @@ function! airline#extensions#tabline#ctrlspace#on()
endfunction endfunction
function! airline#extensions#tabline#ctrlspace#invalidate() function! airline#extensions#tabline#ctrlspace#invalidate()
if !exists('#airline')
return
endif
let s:current_bufnr = -1 let s:current_bufnr = -1
let s:current_tabnr = -1 let s:current_tabnr = -1
endfunction endfunction
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right) function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right)
let pos_extension = (a:pull_right ? '_right' : '') let pos_extension = (a:pull_right ? '_right' : '')
let buffer_list = [] let buffer_list = []
for bufferindex in sort(keys(ctrlspace#api#Buffers(a:cur_tab)), 'N') for bufferindex in sort(keys(ctrlspace#api#Buffers(a:cur_tab)), 'N')
for buffer in ctrlspace#api#BufferList(a:cur_tab) for buffer in ctrlspace#api#BufferList(a:cur_tab)
@@ -1,17 +1,18 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 et " vim: et ts=2 sts=2 sw=2 et fdm=marker
scriptencoding utf-8 scriptencoding utf-8
if !exists(":def") || !airline#util#has_vim9_script() if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) " Legacy VimScript implementation {{{1
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) " {{{2
let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
let _ = '' let _ = ''
let name = bufname(a:bufnr) let name = bufname(a:bufnr)
if empty(name) if empty(name)
let _ = '[No Name]' let _ .= '[No Name]'
elseif name =~ 'term://' elseif name =~ 'term://'
" Neovim Terminal " Neovim Terminal
let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
@@ -19,9 +20,9 @@ if !exists(":def") || !airline#util#has_vim9_script()
if get(g:, 'airline#extensions#tabline#fnamecollapse', 1) if get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
" Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c' " Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
"let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') "let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
let _ = pathshorten(fnamemodify(name, fmod)) let _ .= pathshorten(fnamemodify(name, fmod))
else else
let _ = fnamemodify(name, fmod) let _ .= fnamemodify(name, fmod)
endif endif
if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate
let _ = airline#util#strcharpart(_, 0, fnametruncate) let _ = airline#util#strcharpart(_, 0, fnametruncate)
@@ -31,7 +32,7 @@ if !exists(":def") || !airline#util#has_vim9_script()
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
endfunction endfunction
function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name) function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name) " {{{2
let buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') 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 = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
@@ -43,17 +44,16 @@ if !exists(":def") || !airline#util#has_vim9_script()
endif endif
return _ return _
endfunction endfunction
finish
else else
" Vim9 Script implementation " New Vim9 script implementation {{{1
def airline#extensions#tabline#formatters#default#format(bufnr: number, buffers: list<number>): string def airline#extensions#tabline#formatters#default#format(bufnr: number, buffers: list<number>): string # {{{2
var fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
var fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') var fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
var result = '' var result = ''
var fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
var name = bufname(bufnr) var name = bufname(bufnr)
if empty(name) if empty(name)
result = '[No Name]' result = '[No Name]'
elseif name =~ 'term://' elseif name =~ 'term://'
# Neovim Terminal # Neovim Terminal
result = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') result = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
@@ -69,16 +69,13 @@ else
endif endif
return airline#extensions#tabline#formatters#default#wrap_name(bufnr, result) return airline#extensions#tabline#formatters#default#wrap_name(bufnr, result)
enddef enddef
def airline#extensions#tabline#formatters#default#wrap_name(bufnr: number, buffer_name: string): string # {{{2
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) var buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
var buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
var result = buf_nr_show ? printf(buf_nr_format, bufnr) : '' var result = buf_nr_show ? printf(buf_nr_format, bufnr) : ''
result ..= substitute(buffer_name, '\\', '/', 'g') result = result .. substitute(buffer_name, '\\', '/', 'g')
if getbufvar(bufnr, '&modified') == 1
if getbufvar(bufnr, '&modified') result = result .. g:airline_symbols.modified
result ..= g:airline_symbols.modified
endif endif
return result return result
enddef enddef
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -7,7 +7,7 @@ function! airline#extensions#tabline#formatters#jsformatter#format(bufnr, buffer
let buf = bufname(a:bufnr) let buf = bufname(a:bufnr)
let filename = fnamemodify(buf, ':t') let filename = fnamemodify(buf, ':t')
if filename ==# 'index.js' || filename ==# 'index.jsx' || filename ==# 'index.ts' || filename ==# 'index.tsx' || filename ==# 'index.vue' if filename == 'index.js' || filename == 'index.jsx' || filename == 'index.ts' || filename == 'index.tsx'
return fnamemodify(buf, ':p:h:t') . '/i' return fnamemodify(buf, ':p:h:t') . '/i'
else else
return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers) return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers)
@@ -1,7 +0,0 @@
let g:airline#extensions#tabline#formatters#nerdfont#formatter = get(g:, 'airline#extensions#tabline#formatters#nerdfont#formatter', 'default')
function! airline#extensions#tabline#formatters#nerdfont#format(bufnr, buffers) abort
" Call original formatter.
let originalFormatter = airline#extensions#tabline#formatters#{g:airline#extensions#tabline#formatters#nerdfont#formatter}#format(a:bufnr, a:buffers)
return originalFormatter . printf(' %s', nerdfont#find(bufname(a:bufnr)))
endfunction
@@ -1,10 +1,11 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
function! airline#extensions#tabline#formatters#short_path#format(bufnr, buffers) function! airline#extensions#tabline#formatters#short_path#format(bufnr, buffers)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:h:t')
let _ = '' let _ = ''
let name = bufname(a:bufnr) let name = bufname(a:bufnr)
@@ -14,7 +15,7 @@ function! airline#extensions#tabline#formatters#short_path#format(bufnr, buffers
" Neovim Terminal " Neovim Terminal
let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
else else
let _ .= fnamemodify(name, fmod) . '/' . fnamemodify(name, ':t') let _ .= fnamemodify(name, ':p:h:t') . '/' . fnamemodify(name, ':t')
endif endif
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
@@ -1,36 +0,0 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt 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
@@ -1,18 +1,15 @@
" MIT License. Copyright (c) 2017-2026 Christian Brabandt et al. " MIT License. Copyright (c) 2017-2020 Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist) function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
let spc=g:airline_symbols.space let spc=g:airline_symbols.space
let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) if a:tab_nr_type == 0 " nr of splits
if tab_nr_type == 0 " nr of splits return spc. '%{len(tabpagebuflist('.a:nr.'))}'
return spc. len(tabpagebuflist(a:tab_nr)) elseif a:tab_nr_type == 1 " tab number
elseif tab_nr_type == 1 " tab number return spc. a:nr
" Return only the current tab number else "== 2 splits and tab number
return spc. a:tab_nr return spc. a:nr. '.%{len(tabpagebuflist('.a: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 endif
endfunction endfunction
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
+11 -20
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -22,9 +22,7 @@ function! airline#extensions#tabline#tabs#on()
endfunction endfunction
function! airline#extensions#tabline#tabs#invalidate() function! airline#extensions#tabline#tabs#invalidate()
if exists('#airline') let s:current_bufnr = -1
let s:current_bufnr = -1
endif
endfunction endfunction
function! airline#extensions#tabline#tabs#get() function! airline#extensions#tabline#tabs#get()
@@ -41,8 +39,6 @@ function! airline#extensions#tabline#tabs#get()
endif endif
endif endif
let s:filtered_buflist = airline#extensions#tabline#buflist#list()
let b = airline#extensions#tabline#new_builder() let b = airline#extensions#tabline#new_builder()
call airline#extensions#tabline#add_label(b, 'tabs', 0) call airline#extensions#tabline#add_label(b, 'tabs', 0)
@@ -54,10 +50,8 @@ function! airline#extensions#tabline#tabs#get()
let group = 'airline_tabsel' let group = 'airline_tabsel'
if g:airline_detect_modified if g:airline_detect_modified
for bi in tabpagebuflist(curtab) for bi in tabpagebuflist(curtab)
if index(s:filtered_buflist,bi) != -1 if getbufvar(bi, '&modified')
if getbufvar(bi, '&modified') let group = 'airline_tabmod'
let group = 'airline_tabmod'
endif
endif endif
endfor endfor
endif endif
@@ -70,7 +64,8 @@ function! airline#extensions#tabline#tabs#get()
let val = '%(' let val = '%('
if get(g:, 'airline#extensions#tabline#show_tab_nr', 1) if get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
let val .= airline#extensions#tabline#tabs#tabnr_formatter(a:i, tabpagebuflist(a:i)) 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)
endif endif
return val.'%'.a:i.'T %{airline#extensions#tabline#title('.a:i.')} %)' return val.'%'.a:i.'T %{airline#extensions#tabline#title('.a:i.')} %)'
@@ -84,16 +79,14 @@ function! airline#extensions#tabline#tabs#get()
if get(g:, 'airline#extensions#tabline#show_close_button', 1) if get(g:, 'airline#extensions#tabline#show_close_button', 1)
call b.add_section('airline_tab_right', ' %999X'. call b.add_section('airline_tab_right', ' %999X'.
\ get(g:, 'airline#extensions#tabline#close_symbol', 'X').'%X ') \ get(g:, 'airline#extensions#tabline#close_symbol', 'X').' ')
endif endif
if get(g:, 'airline#extensions#tabline#show_splits', 1) == 1 if get(g:, 'airline#extensions#tabline#show_splits', 1) == 1
let buffers = tabpagebuflist(curtab) let buffers = tabpagebuflist(curtab)
for nr in buffers for nr in buffers
if index(s:filtered_buflist,nr) != -1 let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right"
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right" call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
endif
endfor endfor
if get(g:, 'airline#extensions#tabline#show_buffers', 1) if get(g:, 'airline#extensions#tabline#show_buffers', 1)
call airline#extensions#tabline#add_label(b, 'buffers', 1) call airline#extensions#tabline#add_label(b, 'buffers', 1)
@@ -114,8 +107,8 @@ function! airline#extensions#tabline#tabs#map_keys()
endif endif
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1) let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
if bidx_mode == 1 if bidx_mode == 1
for i in range(1, 10) for i in range(1, 9)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i%10, i) exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i, i)
endfor endfor
else else
for i in range(11, 99) for i in range(11, 99)
@@ -125,8 +118,6 @@ function! airline#extensions#tabline#tabs#map_keys()
noremap <silent> <Plug>AirlineSelectPrevTab gT noremap <silent> <Plug>AirlineSelectPrevTab gT
" tabn {count} goes to count tab does not go {count} tab pages forward! " tabn {count} goes to count tab does not go {count} tab pages forward!
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr> noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>
noremap <silent> <Plug>AirlineSelectFirstTab :<C-u>:tabfirst<CR>
noremap <silent> <Plug>AirlineSelectLastTab :<C-u>:tablast<CR>
endfunction endfunction
function! airline#extensions#tabline#tabs#tabnr_formatter(nr, i) abort function! airline#extensions#tabline#tabs#tabnr_formatter(nr, i) abort
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2026 Kevin Sapper et al. " MIT License. Copyright (c) 2016-2020 Kevin Sapper et al.
" PLugin: https://github.com/s1341/vim-tabws " PLugin: https://github.com/s1341/vim-tabws
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -24,10 +24,8 @@ function! airline#extensions#tabline#tabws#on()
endfunction endfunction
function! airline#extensions#tabline#tabws#invalidate() function! airline#extensions#tabline#tabws#invalidate()
if exists('#airline') let s:current_bufnr = -1
let s:current_bufnr = -1 let s:current_tabnr = -1
let s:current_tabnr = -1
endif
endfunction endfunction
function! airline#extensions#tabline#tabws#add_buffer_section(builder, cur_tab, cur_buf, pull_right) function! airline#extensions#tabline#tabws#add_buffer_section(builder, cur_tab, cur_buf, pull_right)
@@ -1,11 +1,11 @@
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" xTabline - Reduced version for vim-airline " xTabline - Reduced version for vim-airline
" Plugin: https://github.com/mg979/vim-xtabline " Plugin: https://github.com/mg979/vim-xtabline
" MIT License Copyright (C) 2018-2021 Gianmaria Bajo <mg1979.git@gmail.com> " MIT License Copyright (C) 2018-2020 Gianmaria Bajo <mg1979.git@gmail.com>
" tabpagecd: " tabpagecd:
" expanded version by mg979 " expanded version by mg979
" MIT License Copyright (C) 2012-2013 Kana Natsuno <http://whileimautomaton.net/> " MIT License Copyright (C) 2012-2013 Kana Natsuno <http://whileimautomaton.net/>
" MIT License Copyright (C) 2018-2021 Gianmaria Bajo <mg1979.git@gmail.com> " MIT License Copyright (C) 2018-2020 Gianmaria Bajo <mg1979.git@gmail.com>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -44,7 +44,7 @@ function! airline#extensions#tabline#xtabline#init()
autocmd TabLeave * call s:Do('leave') autocmd TabLeave * call s:Do('leave')
autocmd TabClosed * call s:Do('close') autocmd TabClosed * call s:Do('close')
autocmd BufEnter * if exists('#airline') | let g:xtabline_changing_buffer = 0 | endif autocmd BufEnter * let g:xtabline_changing_buffer = 0
autocmd BufAdd,BufDelete,BufWrite * call airline#extensions#tabline#xtabline#filter_buffers() autocmd BufAdd,BufDelete,BufWrite * call airline#extensions#tabline#xtabline#filter_buffers()
augroup END augroup END
@@ -180,10 +180,6 @@ function! airline#extensions#tabline#xtabline#filter_buffers()
" 'accepted' is a list of buffer numbers, for quick access. " '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. " '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 if !s:xtabline_filtering | return | endif
let g:airline#extensions#tabline#exclude_buffers = [] let g:airline#extensions#tabline#exclude_buffers = []
@@ -355,10 +351,6 @@ endfunction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:Do(action) function! s:Do(action)
if !exists('#airline')
" airline disabled
return
endif
let arg = a:action let arg = a:action
if !s:state | call s:InitCwds() | return | endif if !s:state | call s:InitCwds() | return | endif
@@ -1,13 +0,0 @@
let g:airline#extensions#tabline#formatters#zhihu#formatter = get(g:, 'airline#extensions#tabline#formatters#zhihu#formatter', 'default')
function! airline#extensions#tabline#formatters#zhihu#format(bufnr, buffers)
let l:name = bufname(a:bufnr)
if match(l:name, 'zhihu://') == -1
return airline#extensions#tabline#formatters#{g:airline#extensions#tabline#formatters#zhihu#formatter}#format(a:bufnr, a:buffers)
endif
let l:prefix = matchstr(fnamemodify(l:name, ':h'), '\d\+')
if l:prefix !=# ''
let l:prefix .= '/'
endif
return l:prefix . fnamemodify(l:name, ':t')
endfunction
-154
View File
@@ -1,154 +0,0 @@
vim9script
# MIT License. Copyright (c) 2013-2026 Christian Brabandt et al.
# vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
var spc = g:airline_symbols.space
var mouse_support = has('patch-9.2.0386')
def IsTabModified(tabnr: number): bool
if !g:airline_detect_modified
return false
endif
for bi in tabpagebuflist(tabnr)
if getbufvar(bi, '&modified')
return true
endif
endfor
return false
enddef
export def Get(): string
var tabnr = get(g:, 'actual_curtabpage', tabpagenr())
var curtab = tabpagenr()
var label = ''
if tabnr == 1
label ..= '%#airline_tabfill#'
label ..= get(g:, 'airline#extensions#tabpanel#label', '[tabs]') .. "\n"
endif
var buflist = tabpagebuflist(tabnr)
var winnr = tabpagewinnr(tabnr)
var bufnr = buflist[winnr - 1]
var title = fnamemodify(bufname(bufnr), ':t')
if empty(title)
title = '[No Name]'
endif
if tabnr == curtab
if IsTabModified(tabnr)
label ..= '%#airline_tabmod#'
else
label ..= '%#airline_tabsel#'
endif
else
if IsTabModified(tabnr)
label ..= '%#airline_tabmod_unsel#'
else
label ..= '%#airline_tab#'
endif
endif
if mouse_support
label ..= '%' .. tabnr .. '[airline#extensions#tabpanel#ClickTab]'
endif
if get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
label ..= spc .. tabnr
label ..= spc
endif
label ..= title .. spc
if mouse_support
label ..= '%[]'
endif
return label
enddef
export def ClickTab(info: dict<any>): number
if info.nclicks != 1 || !empty(info.mods)
return 0
endif
if info.button ==# 'l'
try
silent execute 'tabnext' info.minwid
catch
airline#util#warning('Cannot switch tab')
endtry
elseif info.button ==# 'm'
try
silent execute 'tabclose' info.minwid
catch
airline#util#warning('Cannot close tab')
endtry
endif
return 0
enddef
def LinkHighlights(): void
highlight! link TabPanelFill airline_tabfill
highlight! link TabPanelSel airline_tabsel
highlight! link TabPanel airline_tab
enddef
export def LoadTheme(palette: dict<any>): number
airline#extensions#tabline#load_theme(palette)
LinkHighlights()
return 0
enddef
def Enable(): void
LinkHighlights()
&tabpanel = '%!airline#extensions#tabpanel#Get()'
var cols = get(g:, 'airline#extensions#tabpanel#columns', 20)
var align = get(g:, 'airline#extensions#tabpanel#align', '')
var scrollbar = get(g:, 'airline#extensions#tabpanel#scrollbar', 1)
var opts = 'columns:' .. cols
if !empty(align)
opts ..= ',align:' .. align
endif
if mouse_support
if scrollbar
opts ..= ',scrollbar'
endif
endif
&tabpanelopt = opts
&showtabpanel = 2
enddef
def Disable(): void
highlight! link TabPanelFill NONE
highlight! link TabPanelSel NONE
highlight! link TabPanel NONE
&tabpanel = ''
&tabpanelopt = ''
&showtabpanel = 0
enddef
export def Init(ext: dict<any>): void
if !exists('+tabpanel')
return
endif
autocmd_add([{
group: 'airline_tabpanel',
event: 'User',
pattern: 'AirlineToggledOn',
cmd: 'Enable()',
replace: true,
}])
autocmd_add([{
group: 'airline_tabpanel',
event: 'User',
pattern: 'AirlineToggledOff',
cmd: 'Disable()',
replace: true,
}])
ext.add_theme_func('airline#extensions#tabpanel#LoadTheme')
Enable()
enddef
+4 -9
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/majutsushi/tagbar " Plugin: https://github.com/majutsushi/tagbar
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -8,6 +8,7 @@ if !exists(':TagbarToggle')
finish finish
endif endif
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
let s:spc = g:airline_symbols.space let s:spc = g:airline_symbols.space
let s:init=0 let s:init=0
@@ -34,21 +35,15 @@ function! airline#extensions#tagbar#currenttag()
try try
" try to load the plugin, if filetypes are disabled, " try to load the plugin, if filetypes are disabled,
" this will cause an error, so try only once " this will cause an error, so try only once
let a = tagbar#currenttag('%s', '', '') let a=tagbar#currenttag('%', '', '')
catch catch
endtry endtry
unlet! a unlet! a
let s:init=1 let s:init=1
endif 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 " function tagbar#currenttag does not exist, if filetype is not enabled
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag") if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', flags, let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
\ get(g:, 'airline#extensions#tagbar#searchmethod', 'nearest-stl'))
let s:airline_tagbar_last_lookup_time = localtime() let s:airline_tagbar_last_lookup_time = localtime()
endif endif
return s:airline_tagbar_last_lookup_val return s:airline_tagbar_last_lookup_val
-37
View File
@@ -1,37 +0,0 @@
" 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
+10 -25
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -6,46 +6,31 @@ scriptencoding utf-8
call airline#parts#define_function('tmode', 'airline#extensions#term#termmode') 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'}) call airline#parts#define('terminal', {'text': get(g:airline_mode_map, 't', 't'), 'accent': 'bold'})
let s:spc = g:airline_symbols.space
function! s:GetAirlineSection() let s:section_a = airline#section#create_left(['terminal', 'tmode'])
if exists("g:airline_section_z_term") let s:section_z = airline#section#create(['linenr', 'maxlinenr'])
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 function! airline#extensions#term#apply(...) abort
if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!' if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!'
let sections = s:GetAirlineSection() call a:1.add_section_spaced('airline_a', s:section_a)
let spc = g:airline_symbols.space
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_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.add_section('airline_term', s:spc.s:termname(a:2.bufnr))
call a:1.split() call a:1.split()
call a:1.add_section('airline_y', '') call a:1.add_section('airline_y', '')
call a:1.add_section_spaced('airline_z', sections[1]) call a:1.add_section_spaced('airline_z', s:section_z)
return 1 return 1
endif endif
endfunction endfunction
function! airline#extensions#term#inactive_apply(...) abort function! airline#extensions#term#inactive_apply(...) abort
if getbufvar(a:2.bufnr, '&buftype') ==? 'terminal' if getbufvar(a:2.bufnr, '&buftype') ==? 'terminal'
let sections = s:GetAirlineSection() call a:1.add_section_spaced('airline_a', s:section_a)
let spc = g:airline_symbols.space
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_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.add_section('airline_term', s:spc.s:termname(a:2.bufnr))
call a:1.split() call a:1.split()
call a:1.add_section('airline_y', '') call a:1.add_section('airline_y', '')
call a:1.add_section_spaced('airline_z', sections[1]) call a:1.add_section_spaced('airline_z', s:section_z)
return 1 return 1
endif endif
endfunction endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/edkolev/tmuxline.vim " Plugin: https://github.com/edkolev/tmuxline.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/mbbill/undotree " Plugin: https://github.com/mbbill/undotree
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+2 -2
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling, Christian Brabandt et al.
" Plugin: https://github.com/chrisbra/unicode.vim " Plugin: https://github.com/chrisbra/unicode.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -9,7 +9,7 @@ if !get(g:, 'loaded_unicodePlugin', 0)
endif endif
function! airline#extensions#unicode#apply(...) function! airline#extensions#unicode#apply(...)
if exists(':UnicodeTable') == 2 && bufname('') =~# '/UnicodeTable.txt' if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable'
call airline#parts#define('unicode', { call airline#parts#define('unicode', {
\ 'text': '[UnicodeTable]', \ 'text': '[UnicodeTable]',
\ 'accent': 'bold' }) \ 'accent': 'bold' })
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/Shougo/unite.vim " Plugin: https://github.com/Shougo/unite.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
-27
View File
@@ -1,27 +0,0 @@
" 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
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2016-2026 Jerome Reybert et al. " MIT License. Copyright (c) 2016-2020 Jerome Reybert et al.
" Plugin: https://github.com/jreybert/vimagit " Plugin: https://github.com/jreybert/vimagit
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/cdelledonne/vim-cmake " Plugin: https://github.com/cdelledonne/vim-cmake
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
-25
View File
@@ -1,25 +0,0 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt 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
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/lervag/vimtex " Plugin: https://github.com/lervag/vimtex
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+3 -3
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/jmcantrell/vim-virtualenv " Plugin: https://github.com/jmcantrell/vim-virtualenv
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
@@ -11,7 +11,7 @@ function! airline#extensions#virtualenv#init(ext)
endfunction endfunction
function! airline#extensions#virtualenv#apply(...) function! airline#extensions#virtualenv#apply(...)
if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1 if &filetype =~# "python"
if get(g:, 'virtualenv_loaded', 0) if get(g:, 'virtualenv_loaded', 0)
let statusline = virtualenv#statusline() let statusline = virtualenv#statusline()
else else
@@ -25,7 +25,7 @@ function! airline#extensions#virtualenv#apply(...)
endfunction endfunction
function! airline#extensions#virtualenv#update() function! airline#extensions#virtualenv#update()
if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1 if &filetype =~# "python"
call airline#extensions#virtualenv#apply() call airline#extensions#virtualenv#apply()
call airline#update_statusline() call airline#update_statusline()
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2021 s1341 (github@shmarya.net) " MIT License. Copyright (c) 2020 s1341 (github@shmarya.net)
" Plugin: https://github.com/liuchengxu/vista.vim " Plugin: https://github.com/liuchengxu/vista.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+8 -46
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html " http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
@@ -8,14 +8,10 @@ scriptencoding utf-8
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1) let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace) let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts'] let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts']
let s:searchcount = exists('*searchcount')
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1) 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'], \ 'csv': ['indent', 'mixed-indent-file']}
\ 'mail': ['trailing'],
\ 'diff': ['trailing'],
\ 'gitcommit': ['trailing']}
function! s:check_mixed_indent() function! s:check_mixed_indent()
let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0) let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
@@ -54,9 +50,8 @@ endfunction
function! s:conflict_marker() function! s:conflict_marker()
" Checks for git conflict markers " Checks for git conflict markers
" space required for jj conflict marker: #2727 let annotation = '\%([0-9A-Za-z_.:]\+\)\?'
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?' if &ft is# 'rst'
if match(['rst', 'markdown', 'rmd'], &ft) >= 0
" rst filetypes use '=======' as header " rst filetypes use '=======' as header
let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(>\{7\} '.annotation.'\)\)$' let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(>\{7\} '.annotation.'\)\)$'
else else
@@ -65,19 +60,6 @@ function! s:conflict_marker()
return search(pattern, 'nw') return search(pattern, 'nw')
endfunction endfunction
function! s:conflict_marker_count()
if !s:searchcount
return 0
endif
" Checks for git conflict markers
" space required for jj conflict marker: #2727
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'
let pattern = '^<\{7} '.annotation. '$'
let cnt = searchcount(#{pattern: pattern, recompute: 1, timeout: 10})
return has_key(cnt, 'total') ? cnt.total : 0
endfunction
function! airline#extensions#whitespace#check() function! airline#extensions#whitespace#check()
let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000) let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
if &readonly || !&modifiable || !s:enabled || line('$') > max_lines if &readonly || !&modifiable || !s:enabled || line('$') > max_lines
@@ -95,8 +77,7 @@ function! airline#extensions#whitespace#check()
let check = 'trailing' let check = 'trailing'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0 if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
try try
let regexp = get(b:, 'airline_whitespace_trailing_regexp', let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
\ get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$'))
let trailing = search(regexp, 'nw') let trailing = search(regexp, 'nw')
catch catch
call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp)) call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp))
@@ -125,7 +106,6 @@ function! airline#extensions#whitespace#check()
let conflicts = 0 let conflicts = 0
if index(checks, 'conflicts') > -1 if index(checks, 'conflicts') > -1
let conflicts = s:conflict_marker() let conflicts = s:conflict_marker()
let conflicts_count = s:conflict_marker_count()
endif endif
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file) || conflicts != 0 if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file) || conflicts != 0
@@ -156,16 +136,10 @@ function! airline#extensions#whitespace#check()
if conflicts != 0 if conflicts != 0
let conflicts_fmt = get(g:, 'airline#extensions#whitespace#conflicts_format', '[%s]conflicts') let conflicts_fmt = get(g:, 'airline#extensions#whitespace#conflicts_format', '[%s]conflicts')
let b:airline_whitespace_check .= space.printf(conflicts_fmt, conflicts) let b:airline_whitespace_check .= space.printf(conflicts_fmt, conflicts)
if conflicts_count > 1
let b:airline_whitespace_check .= printf('*%d', conflicts_count)
endif
endif endif
endif endif
endif endif
endif endif
if airline#util#has_multiline()
return b:airline_whitespace_check
endif
return airline#util#shorten(b:airline_whitespace_check, 120, 9) return airline#util#shorten(b:airline_whitespace_check, 120, 9)
endfunction endfunction
@@ -183,16 +157,8 @@ function! airline#extensions#whitespace#toggle()
if exists("g:airline#extensions#whitespace#enabled") if exists("g:airline#extensions#whitespace#enabled")
let g:airline#extensions#whitespace#enabled = s:enabled let g:airline#extensions#whitespace#enabled = s:enabled
if s:enabled if s:enabled && match(g:airline_section_warning, '#whitespace#check') < 0
if airline#util#has_multiline() && exists('g:airline_section_warning2') let g:airline_section_warning .= airline#section#create(['whitespace'])
if match(g:airline_section_warning2, '#whitespace#check') < 0
let g:airline_section_warning2 .= airline#section#create(['whitespace'])
endif
else
if match(g:airline_section_warning, '#whitespace#check') < 0
let g:airline_section_warning .= airline#section#create(['whitespace'])
endif
endif
call airline#update_statusline() call airline#update_statusline()
endif endif
endif endif
@@ -216,15 +182,11 @@ function! airline#extensions#whitespace#init(...)
endfunction endfunction
function! s:ws_refresh() function! s:ws_refresh()
if !exists('#airline')
" airline disabled
return
endif
if get(b:, 'airline_ws_changedtick', 0) == b:changedtick if get(b:, 'airline_ws_changedtick', 0) == b:changedtick
return return
endif endif
unlet! b:airline_whitespace_check unlet! b:airline_whitespace_check
if get(g:, 'airline_skip_empty_sections', 0) || airline#util#has_multiline() if get(g:, 'airline_skip_empty_sections', 0)
exe ':AirlineRefresh!' exe ':AirlineRefresh!'
endif endif
let b:airline_ws_changedtick = b:changedtick let b:airline_ws_changedtick = b:changedtick
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" Plugin: https://github.com/wesQ3/vim-windowswap " Plugin: https://github.com/wesQ3/vim-windowswap
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
+5 -15
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 fdm=marker " vim: et ts=2 sts=2 sw=2 fdm=marker
scriptencoding utf-8 scriptencoding utf-8
@@ -9,18 +9,8 @@ if exists('*wordcount')
if get(g:, 'actual_curbuf', '') != bufnr('') if get(g:, 'actual_curbuf', '') != bufnr('')
return return
endif endif
if &filetype ==# 'tex' && exists('b:vimtex') && get(g:, 'airline#extensions#vimtex#wordcount', 0) let query = a:visual_mode_active ? 'visual_words' : 'words'
" We're in a TeX file and vimtex is a plugin, so use vimtex's wordcount... return get(wordcount(), query, 0)
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 endfunction
else " Pull wordcount from the g_ctrl-g stats else " Pull wordcount from the g_ctrl-g stats
function! s:get_wordcount(visual_mode_active) function! s:get_wordcount(visual_mode_active)
@@ -96,8 +86,8 @@ endfunction
" airline functions {{{1 " airline functions {{{1
" default filetypes: " default filetypes:
function! airline#extensions#wordcount#apply(...) function! airline#extensions#wordcount#apply(...)
let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', let filetypes = get(g:, 'airline#extensions#wordcount#filetypes',
\ ['asciidoc', 'help', 'mail', 'markdown', 'rmd', 'nroff', 'org', 'rst', 'plaintex', 'tex', 'text']) \ ['asciidoc', 'help', 'mail', 'markdown', 'nroff', 'org', 'rst', 'plaintex', 'tex', 'text'])
" export current filetypes settings to global namespace " export current filetypes settings to global namespace
let g:airline#extensions#wordcount#filetypes = filetypes let g:airline#extensions#wordcount#filetypes = filetypes
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2013-2026 Bailey Ling, Christian Brabandt et al. " MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
+5 -25
View File
@@ -1,37 +1,17 @@
" MIT License. Copyright (c) 2017-2026 YoungHoon Rhiu et al. " MIT License. Copyright (c) 2017-2020 YoungHoon Rhiu et al.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
scriptencoding utf-8 scriptencoding utf-8
if !exists('g:XkbSwitchLib') && !exists('*FcitxCurrentIM') && !has('nvim') if !exists('g:XkbSwitchLib')
finish finish
endif endif
function! airline#extensions#xkblayout#status() function! airline#extensions#xkblayout#status()
if exists('g:XkbSwitchLib') let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '') let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '')
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'}) let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
if has_key(short_codes, keyboard_layout) if has_key(short_codes, keyboard_layout)
let keyboard_layout = short_codes[keyboard_layout] let keyboard_layout = short_codes[keyboard_layout]
endif endif
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2015-2026 Evgeny Firsov et al. " MIT License. Copyright (c) 2015-2020 Evgeny Firsov et al.
" Plugin: https://github.com/ycm-core/YouCompleteMe " Plugin: https://github.com/ycm-core/YouCompleteMe
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
-45
View File
@@ -1,45 +0,0 @@
" MIT License. Copyright (c) 2026-2026 Wu Zhenyu et al
" Plugin: https://github.com/pxwg/zhihu.nvim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !airline#util#has_zhihu()
finish
endif
let s:has_percent_eval = v:version > 802 || (v:version == 802 && has("patch2854"))
function! airline#extensions#zhihu#bufname() abort
let fmod = (exists("+autochdir") && &autochdir) ? ':p' : ':.'
let name = fnamemodify(bufname('%'), fmod)
if empty(name)
return ''
endif
if match(name, 'zhihu://') == -1
return s:has_percent_eval ? '%f' : name
endif
return get(get(b:, 'article', {}), 'title', name)
endfunction
function! airline#extensions#zhihu#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
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
call airline#parts#define_raw('path', '%<%{'. prct. 'pathshorten(airline#extensions#zhihu#bufname())' . prct . '}%m')
else
call airline#parts#define_raw('path', '%<%{' . prct . 'airline#extensions#zhihu#bufname()' . prct . '}%m')
endif
else
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
call airline#parts#define_raw('file', '%<%{' . prct . 'pathshorten(airline#extensions#zhihu#bufname())' . prct . '}%m')
else
call airline#parts#define_raw('file', '%<%{' . prct . 'airline#extensions#zhihu#bufname()' . prct . '}%m')
endif
endif
endfunction
+1 -1
View File
@@ -1,4 +1,4 @@
" MIT License. Copyright (c) 2021-2026 Dmitry Geurkov (d.geurkov@gmail.com) " MIT License. Copyright (c) 2020 Dmitry Geurkov (d.geurkov@gmail.com)
" Plugin: https://github.com/troydm/zoomwintab.vim " Plugin: https://github.com/troydm/zoomwintab.vim
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2

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