26 Commits

Author SHA1 Message Date
Christian Brabandt
7a552f415c highlighter: remove stale separator entries on buffer unload
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
fixes: #2701

Co-authored-by: Mina Nagy Zaki <mnzaki@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-05 06:49:09 +01:00
laburnumT
25635ab504 symbols: Update symbol used for maxlinenr (#2690)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
U+2630 is a full width character. Replace it with U+2261.

closes: #2691

Signed-off-by: laburnumT <laburnumtec@gmail.com>
2024-11-18 21:07:35 +01:00
Neil Lambert
6c704f4b78 fix vim-airline/fern does not update the branch name as you navigate through fern, and theme fern inactive windows too (#2698)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Co-authored-by: Neil Lambert <nlambert@pm.me>
2024-10-30 18:21:02 +01:00
Bob Conan
3ddcab16c2 Update CHANGELOG.md, fix a typo (#2695)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
2024-10-24 20:56:04 +02:00
IK
81eca99486 Merge pull request #2688 from vim-airline/fix-test
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
chore: update test
2024-09-11 02:39:31 +09:00
IK
f706e7c486 Merge pull request #2689 from vim-airline/update-ci
chore: update ci
2024-09-11 02:38:35 +09:00
get-me-power
d7edaf8fd0 chore: update ci 2024-09-11 02:31:50 +09:00
get-me-power
3cb60641e7 chore: update test 2024-09-11 02:28:20 +09:00
wzy
d25c049e61 xkblayout: support ime.nvim (#2682)
Improve document
2024-07-23 16:10:19 +02:00
wzy
02894b6ef4 xkblayout: support fcitx5-ui.nvim (#2680)
https://github.com/black-desk/fcitx5-ui.nvim
2024-06-16 16:57:43 +02:00
Dionisio E Alonso
16c1638f93 nvimlsp: Correct deprecation warning on nvimlsp plugin (#2678)
Also correct regression introduced in #2676 with #2677
2024-05-20 13:51:17 +02:00
Christian Brabandt
6cc2c5c9e9 nvimlsp: Use vim.lsp.buf_get_clients() for Neovim < 0.11
closes: #2676

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

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

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

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

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

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

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

closes #2651

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

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

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

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

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

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

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

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

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

That also appears to fix the issue.

This flag was introduced to git in 2017 which would make airline fail on
older gits:
27344d6a6c
There's also GIT_OPTIONAL_LOCKS=0 environment variable, but that
requires more infra work.
2023-07-19 11:14:10 -07:00
Christian Brabandt
cead8efb48 term: allow to customize section_a and section_z
closes: #2647
2023-07-13 16:48:04 +02:00
18 changed files with 265 additions and 108 deletions

View File

@@ -11,10 +11,11 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
vim:
- v9.1.0000
- v9.0.0000
- v8.2.1000
- v8.2.0000

View File

@@ -85,7 +85,7 @@ This is the Changelog for the vim-airline project.
- [fugitive](https://github.com/tpope/vim-fugitive) plugin has been refactored
causing adjustments for vim-airline, also uses Fugitives new API calls
- some improvements to Vims terminal mode
- Allow to use alternative seperators for inactive windows ([#1236](https://github.com/vim-airline/vim-airline/issues/1236))
- Allow to use alternative separators 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)
## [0.9] - 2018-01-15
@@ -135,7 +135,7 @@ This is the Changelog for the vim-airline project.
## [0.8] - 2016-03-09
- Changes
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
- Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Themes have been split into a separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Improvements
- Extensions
- branch: support Git and Mercurial simultaneously, untracked files

View File

@@ -370,3 +370,4 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[61]: http://github.com/lambdalisue/battery.vim/
[62]: http://github.com/rbong/vim-flog/
[63]: https://github.com/lewis6991/gitsigns.nvim
[64]: https://github.com/VimfanTPdvorak/vimodoro

View File

@@ -229,6 +229,11 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'undotree')
endif
if exists(':RTM')
call airline#extensions#vimodoro#init(s:ext)
call add(s:loaded_ext, 'vimodoro')
endif
if get(g:, 'airline#extensions#hunks#enabled', 1)
\ && (exists('g:loaded_signify')
\ || exists('g:loaded_gitgutter')
@@ -415,6 +420,11 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'capslock')
endif
if (get(g:, 'airline#extensions#codeium#enabled', 1) && get(g:, 'loaded_codeium', 0))
call airline#extensions#codeium#init(s:ext)
call add(s:loaded_ext, 'codeium')
endif
if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0))
call airline#extensions#gutentags#init(s:ext)
call add(s:loaded_ext, 'gutentags')
@@ -430,7 +440,7 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'grepper')
endif
if get(g:, 'airline#extensions#xkblayout#enabled', 1) && (exists('g:XkbSwitchLib') || exists('*FcitxCurrentIM'))
if get(g:, 'airline#extensions#xkblayout#enabled', 1) && (exists('g:XkbSwitchLib') || exists('*FcitxCurrentIM') || has('nvim'))
call airline#extensions#xkblayout#init(s:ext)
call add(s:loaded_ext, 'xkblayout')
endif

View File

@@ -17,8 +17,8 @@ scriptencoding utf-8
let s:vcs_config = {
\ 'git': {
\ 'exe': 'git',
\ 'cmd': 'git status --porcelain -- ',
\ 'dirty': 'git status -uno --porcelain --ignore-submodules',
\ 'cmd': 'git --no-optional-locks status --porcelain -- ',
\ 'dirty': 'git --no-optional-locks status -uno --porcelain --ignore-submodules',
\ 'untracked_mark': '??',
\ 'exclude': '\.git',
\ 'update_branch': 's:update_git_branch',

View File

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

View File

@@ -7,30 +7,47 @@ if !get(g:, 'loaded_fern', 0)
finish
endif
function! airline#extensions#fern#apply(...) abort
if (&ft =~# 'fern')
let spc = g:airline_symbols.space
let fri = fern#fri#parse(expand('%f'))
call a:1.add_section('airline_a', spc.'fern'.spc)
if exists('*airline#extensions#branch#get_head')
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
else
call a:1.add_section('airline_b', '')
endif
if !(fri.authority =~# '^drawer')
let abspath = substitute(fri.path, 'file://', '', '')
call a:1.add_section('airline_c', spc.fnamemodify(abspath, ':~'))
call a:1.split()
if len(get(g:, 'fern#comparators', {}))
call a:1.add_section('airline_y', spc.'%{fern#comparator}'.spc)
endif
endif
function! airline#extensions#fern#apply_active(...) abort
" check if current buffer is both fern and active
if (&ft =~# 'fern') && a:2.active ==# '1'
call airline#extensions#fern#configure_sections(a:1, a:2)
return 1
endif
endfunction
function! airline#extensions#fern#apply_inactive(...) abort
" check if referenced buffer is both fern and inactive
if getbufvar(a:2.bufnr, '&filetype') ==# 'fern' && a:2.active ==# '0'
call airline#extensions#fern#configure_sections(a:1, a:2)
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 = substitute(fri.path, 'file://', '', '')
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
execute 'lcd' abspath
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
endfunction
function! airline#extensions#fern#init(ext) abort
let g:fern_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#fern#apply')
call a:ext.add_statusline_func('airline#extensions#fern#apply_active')
call a:ext.add_inactive_statusline_func('airline#extensions#fern#apply_inactive')
endfunction

View File

@@ -15,7 +15,9 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
endfunction
function! airline#extensions#nvimlsp#get(type) abort
if luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
if has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.get_clients({ bufnr = 0 }))')
return ''
elseif !has('nvim-0.11') && luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
return ''
endif

View File

@@ -6,31 +6,46 @@ scriptencoding utf-8
call airline#parts#define_function('tmode', 'airline#extensions#term#termmode')
call airline#parts#define('terminal', {'text': get(g:airline_mode_map, 't', 't'), 'accent': 'bold'})
let s:spc = g:airline_symbols.space
let s:section_a = airline#section#create_left(['terminal', 'tmode'])
let s:section_z = airline#section#create(['linenr', 'maxlinenr'])
function! s:GetAirlineSection()
if exists("g:airline_section_z_term")
let section_z = g:airline_section_z_term
else
let section_z = airline#section#create(['linenr', 'maxlinenr'])
endif
if exists("g:airline_section_a_term")
let section_a = g:airline_section_a_term
else
let section_a = airline#section#create_left(['terminal', 'tmode'])
endif
return [section_a, section_z]
endfunction
function! airline#extensions#term#apply(...) abort
if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!'
call a:1.add_section_spaced('airline_a', s:section_a)
let sections = s:GetAirlineSection()
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('airline_term', s:spc.s:termname(a:2.bufnr))
call a:1.add_section('airline_term', spc.s:termname(a:2.bufnr))
call a:1.split()
call a:1.add_section('airline_y', '')
call a:1.add_section_spaced('airline_z', s:section_z)
call a:1.add_section_spaced('airline_z', sections[1])
return 1
endif
endfunction
function! airline#extensions#term#inactive_apply(...) abort
if getbufvar(a:2.bufnr, '&buftype') ==? 'terminal'
call a:1.add_section_spaced('airline_a', s:section_a)
let sections = s:GetAirlineSection()
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('airline_term', s:spc.s:termname(a:2.bufnr))
call a:1.add_section('airline_term', spc.s:termname(a:2.bufnr))
call a:1.split()
call a:1.add_section('airline_y', '')
call a:1.add_section_spaced('airline_z', s:section_z)
call a:1.add_section_spaced('airline_z', sections[1])
return 1
endif
endfunction

View File

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

View File

@@ -3,7 +3,7 @@
scriptencoding utf-8
if !exists('g:XkbSwitchLib') && !exists('*FcitxCurrentIM')
if !exists('g:XkbSwitchLib') && !exists('*FcitxCurrentIM') && !has('nvim')
finish
endif
@@ -11,10 +11,25 @@ function! airline#extensions#xkblayout#status()
if exists('g:XkbSwitchLib')
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '')
elseif exists('*FcitxCurrentIMwithRime')
let keyboard_layout = FcitxCurrentIMwithRime()
elseif exists('*FcitxCurrentIM')
let keyboard_layout = FcitxCurrentIM()
elseif has('nvim')
try
let keyboard_layout = luaeval('require"ime".current()')
catch /.*/
try
let keyboard_layout = luaeval('require"fcitx5-ui".displayCurrentIM()')
catch /.*/
let keyboard_layout = ''
endtry
endtry
else
" substitute keyboard-us to us
let keyboard_layout = substitute(FcitxCurrentIM(), 'keyboard-', '', 'g')
let keyboard_layout = ''
endif
" substitute keyboard-us to us
let keyboard_layout = substitute(keyboard_layout, 'keyboard-', '', 'g')
let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
if has_key(short_codes, keyboard_layout)

View File

@@ -186,6 +186,13 @@ if !exists(":def") || !airline#util#has_vim9_script()
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
endfunction
function! airline#highlighter#remove_separators_for_bufnr(bufnr) abort
" remove all separators, that have the buffer number in their name,
" but do not be too greedy!
let pat = 'c' . a:bufnr . '\(\D\|$\)'
call filter(s:separators, 'v:key !~# pat')
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix) abort
if pumvisible()
return
@@ -529,6 +536,13 @@ else
s:exec_separator({}, from, to, inverse, '')
enddef
def airline#highlighter#remove_separators_for_bufnr(bufnr: string): void
# remove all separators, that have the bufnr in its name, make sure we
# have a full match here
const pat = $'c{bufnr}\(\D\|$\)'
filter(s:separators, (k, v) => k !~# pat)
enddef
def s:exec_separator(dict: dict<any>, from_arg: string, to_arg: string, inverse: bool, suffix: string): void
if pumvisible()
return
@@ -681,5 +695,5 @@ else
endfor
endif
endfor
enddef
enddef
endif

View File

@@ -129,7 +129,7 @@ function! airline#init#bootstrap()
call extend(g:airline_symbols, {
\ 'readonly': "\ue0a2",
\ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630 ",
\ 'maxlinenr': "\u2261 ",
\ 'linenr': " \ue0a1:",
\ 'colnr': " \u2105:",
\ 'branch': "\ue0a0",
@@ -148,7 +148,7 @@ function! airline#init#bootstrap()
call extend(g:airline_symbols, {
\ 'readonly': "\u229D",
\ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630",
\ 'maxlinenr': "\u2261",
\ 'linenr': " \u33d1:",
\ 'colnr': " \u2105:",
\ 'branch': "\u16A0",
@@ -234,6 +234,7 @@ function! airline#init#bootstrap()
call airline#parts#define_text('bookmark', '')
call airline#parts#define_text('capslock', '')
call airline#parts#define_text('codeium', '')
call airline#parts#define_text('gutentags', '')
call airline#parts#define_text('gen_tags', '')
call airline#parts#define_text('grepper', '')
@@ -267,7 +268,7 @@ function! airline#init#sections()
let g:airline_section_gutter = airline#section#create(['%='])
endif
if !exists('g:airline_section_x')
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'codeium', 'filetype'])
endif
if !exists('g:airline_section_y')
let g:airline_section_y = airline#section#create_right(['ffenc'])

View File

@@ -191,7 +191,7 @@ endfunction
function! airline#parts#filetype()
return (airline#util#winwidth() < 90 && strlen(&filetype) > 3)
\ ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>')
\ ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? "\u2026" : '>')
\ : &filetype
endfunction

View File

@@ -498,19 +498,19 @@ ale <https://github.com/dense-analysis/ale>
let g:airline#extensions#ale#enabled = 1
* ale error_symbol >
let airline#extensions#ale#error_symbol = 'E:'
let g:airline#extensions#ale#error_symbol = 'E:'
<
* ale warning >
let airline#extensions#ale#warning_symbol = 'W:'
let g:airline#extensions#ale#warning_symbol = 'W:'
* ale show_line_numbers >
let airline#extensions#ale#show_line_numbers = 1
let g:airline#extensions#ale#show_line_numbers = 1
<
* ale open_lnum_symbol >
let airline#extensions#ale#open_lnum_symbol = '(L'
let g:airline#extensions#ale#open_lnum_symbol = '(L'
<
* ale close_lnum_symbol >
let airline#extensions#ale#close_lnum_symbol = ')'
let g:airline#extensions#ale#close_lnum_symbol = ')'
------------------------------------- *airline-battery*
vim-battery <https://github.com/lambdalisue/battery.vim>
@@ -643,20 +643,26 @@ coc <https://github.com/neoclide/coc.nvim>
let g:airline#extensions#coc#enabled = 1
<
* change error symbol: >
let airline#extensions#coc#error_symbol = 'E:'
let g:airline#extensions#coc#error_symbol = 'E:'
<
* change warning symbol: >
let airline#extensions#coc#warning_symbol = 'W:'
let g:airline#extensions#coc#warning_symbol = 'W:'
<
* enable/disable coc status display >
g:airline#extensions#coc#show_coc_status = 1
let g:airline#extensions#coc#show_coc_status = 1
* change the error format (%C - error count, %L - line number): >
let airline#extensions#coc#stl_format_err = '%C(L%L)'
let g:airline#extensions#coc#stl_format_err = '%C(L%L)'
<
* change the warning format (%C - error count, %L - line number): >
let airline#extensions#coc#stl_format_warn = '%C(L%L)'
let g:airline#extensions#coc#stl_format_warn = '%C(L%L)'
<
------------------------------------- *airline-codeium*
vim-codeium <https://github.com/Exafunction/codeium.vim>
* enable/disable codeium.vim integration >
let g:airline#extensions#codeium#enabled = 1
------------------------------------- *airline-commandt*
command-t <https://github.com/wincent/command-t>
@@ -754,7 +760,7 @@ you can use.
<
* configure the layout to not use %(%) grouping items in the statusline.
Try setting this to zero, if you notice bleeding color artifacts >
let airline#extensions#default#section_use_groupitems = 1
let g:airline#extensions#default#section_use_groupitems = 1
<
------------------------------------- *airline-denite*
Denite <https://github.com/Shougo/denite.nvim>
@@ -883,19 +889,19 @@ LanguageClient <https://github.com/autozimu/LanguageClient-neovim>
let g:airline#extensions#languageclient#enabled = 1
* languageclient error_symbol >
let airline#extensions#languageclient#error_symbol = 'E:'
let g:airline#extensions#languageclient#error_symbol = 'E:'
<
* languageclient warning_symbol >
let airline#extensions#languageclient#warning_symbol = 'W:'
let g:airline#extensions#languageclient#warning_symbol = 'W:'
* languageclient show_line_numbers >
let airline#extensions#languageclient#show_line_numbers = 1
let g:airline#extensions#languageclient#show_line_numbers = 1
<
* languageclient open_lnum_symbol >
let airline#extensions#languageclient#open_lnum_symbol = '(L'
let g:airline#extensions#languageclient#open_lnum_symbol = '(L'
<
* languageclient close_lnum_symbol >
let airline#extensions#languageclient#close_lnum_symbol = ')'
let g:airline#extensions#languageclient#close_lnum_symbol = ')'
------------------------------------- *airline-localsearch*
localsearch <https://github.com/mox-mox/vim-localsearch>
@@ -915,25 +921,25 @@ lsp <https://github.com/prabirshrestha/vim-lsp>
let g:airline#extensions#lsp#enabled = 1
* lsp error_symbol >
let airline#extensions#lsp#error_symbol = 'E:'
let g:airline#extensions#lsp#error_symbol = 'E:'
<
* lsp warning >
let airline#extensions#lsp#warning_symbol = 'W:'
let g:airline#extensions#lsp#warning_symbol = 'W:'
* lsp show_line_numbers >
let airline#extensions#lsp#show_line_numbers = 1
let g:airline#extensions#lsp#show_line_numbers = 1
<
* lsp open_lnum_symbol >
let airline#extensions#lsp#open_lnum_symbol = '(L'
let g:airline#extensions#lsp#open_lnum_symbol = '(L'
<
* lsp close_lnum_symbol >
let airline#extensions#lsp#close_lnum_symbol = ')'
let g:airline#extensions#lsp#close_lnum_symbol = ')'
<
* lsp progress skip time
Suppresses the frequency of status line updates.
Prevents heavy operation when using a language server that sends frequent progress notifications.
Set 0 to disable. >
g:airline#extensions#lsp#progress_skip_time = 0.3 (default)
let g:airline#extensions#lsp#progress_skip_time = 0.3 (default)
<
------------------------------------- *airline-neomake*
@@ -943,10 +949,10 @@ neomake <https://github.com/neomake/neomake>
let g:airline#extensions#neomake#enabled = 1
* neomake error_symbol >
let airline#extensions#neomake#error_symbol = 'E:'
let g:airline#extensions#neomake#error_symbol = 'E:'
<
* neomake warning >
let airline#extensions#neomake#warning_symbol = 'W:'
let g:airline#extensions#neomake#warning_symbol = 'W:'
<
------------------------------------- *airline-nerdtree*
NerdTree <https://github.com/preservim/nerdtree.git>
@@ -972,19 +978,19 @@ nvimlsp <https://github.com/neovim/nvim-lsp>
let g:airline#extensions#nvimlsp#enabled = 1
* nvimlsp error_symbol >
let airline#extensions#nvimlsp#error_symbol = 'E:'
let g:airline#extensions#nvimlsp#error_symbol = 'E:'
<
* nvimlsp warning - needs v:lua.vim.diagnostic.get
let airline#extensions#nvimlsp#warning_symbol = 'W:'
let g:airline#extensions#nvimlsp#warning_symbol = 'W:'
* nvimlsp show_line_numbers - needs v:lua.vim.diagnostic.get
let airline#extensions#nvimlsp#show_line_numbers = 1
let g:airline#extensions#nvimlsp#show_line_numbers = 1
* nvimlsp open_lnum_symbol - needs v:lua.vim.diagnostic.get
let airline#extensions#nvimlsp#open_lnum_symbol = '(L'
let g:airline#extensions#nvimlsp#open_lnum_symbol = '(L'
* nvimlsp close_lnum_symbol - needs v:lua.vim.diagnostic.get
let airline#extensions#nvimlsp#close_lnum_symbol = ')'
let g:airline#extensions#nvimlsp#close_lnum_symbol = ')'
------------------------------------- *airline-obsession*
vim-obsession <https://github.com/tpope/vim-obsession>
@@ -1028,7 +1034,7 @@ promptline <https://github.com/edkolev/promptline.vim>
* configure the path to the snapshot .sh file. Mandatory option. The created
file should be sourced by the shell on login >
" in .vimrc
airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh"
let g:airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh"
" in .bashrc/.zshrc
[ -f ~/.shell_prompt.sh ] && source ~/.shell_prompt.sh
@@ -1037,10 +1043,10 @@ promptline <https://github.com/edkolev/promptline.vim>
let g:airline#extensions#promptline#enabled = 0
<
* configure which mode colors should be used in prompt >
let airline#extensions#promptline#color_template = 'normal' (default)
let airline#extensions#promptline#color_template = 'insert'
let airline#extensions#promptline#color_template = 'visual'
let airline#extensions#promptline#color_template = 'replace'
let g:airline#extensions#promptline#color_template = 'normal' (default)
let g:airline#extensions#promptline#color_template = 'insert'
let g:airline#extensions#promptline#color_template = 'visual'
let g:airline#extensions#promptline#color_template = 'replace'
<
------------------------------------- *airline-quickfix*
The quickfix extension is a simple built-in extension which determines
@@ -1091,16 +1097,16 @@ syntastic <https://github.com/vim-syntastic/syntastic>
adjusting the statusline.
* syntastic error_symbol >
let airline#extensions#syntastic#error_symbol = 'E:'
let g:airline#extensions#syntastic#error_symbol = 'E:'
<
* syntastic statusline error format (see |syntastic_stl_format|) >
let airline#extensions#syntastic#stl_format_err = '%E{[%fe(#%e)]}'
let g:airline#extensions#syntastic#stl_format_err = '%E{[%fe(#%e)]}'
* syntastic warning >
let airline#extensions#syntastic#warning_symbol = 'W:'
let g:airline#extensions#syntastic#warning_symbol = 'W:'
<
* syntastic statusline warning format (see |syntastic_stl_format|) >
let airline#extensions#syntastic#stl_format_warn = '%W{[%fw(#%w)]}'
let g:airline#extensions#syntastic#stl_format_warn = '%W{[%fw(#%w)]}'
<
------------------------------------- *airline-tabline*
Note: If you're using the ctrlspace tabline only the option marked with (c)
@@ -1108,6 +1114,11 @@ are supported!
* enable/disable enhanced tabline. (c) >
let g:airline#extensions#tabline#enabled = 0
<
* enable/disable displaying buffers with a single tab. (c) >
let g:airline#extensions#tabline#show_buffers = 1
Note: With `show_buffers = 0`, tabs behave like the vim default tabline.
* enable/disable displaying open splits per tab (only when tabs are opened) >
let g:airline#extensions#tabline#show_splits = 1
@@ -1115,9 +1126,6 @@ are supported!
* switch position of buffers and tabs on splited tabline (c)
(only supported for ctrlspace plugin). >
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
<
* enable/disable displaying buffers with a single tab. (c) >
let g:airline#extensions#tabline#show_buffers = 1
Note: If you are using neovim (has('tablineat') = 1), then you can click
on the tabline with the left mouse button to switch to that buffer, and
@@ -1134,6 +1142,8 @@ with the middle mouse button to delete that buffer.
* enable/disable displaying tabs, regardless of number. (c) >
let g:airline#extensions#tabline#show_tabs = 1
Note: To display only tabs and no buffers, set `show_buffers=0` in addition.
* enable/disable displaying number of tabs in the right side (c) >
let g:airline#extensions#tabline#show_tab_count = 1
@@ -1186,7 +1196,7 @@ Note: Not displayed if the number of tabs is less than 1
let g:airline#extensions#tabline#overflow_marker = '…'
* always show current tabpage/buffer first >
let airline#extensions#tabline#current_first = 1
let g:airline#extensions#tabline#current_first = 1
< default: 0
* enable/disable displaying index of the buffer.
@@ -1388,7 +1398,7 @@ Note: Not displayed if the number of tabs is less than 1
* configure pattern to be ignored on BufAdd autocommand >
" fixes unnecessary redraw, when e.g. opening Gundo window
let airline#extensions#tabline#ignore_bufadd_pat =
let g:airline#extensions#tabline#ignore_bufadd_pat =
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree'
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
@@ -1396,11 +1406,11 @@ Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
* enable Refresh of tabline buffers on |BufAdd| autocommands
(set this to one, if you note 'AirlineTablineRefresh', however, this
won't update airline on |:badd| commands) >
let airline#extensions#tabline#disable_refresh = 0
let g:airline#extensions#tabline#disable_refresh = 0
* preserve windows when closing a buffer from the bufferline
(neovim specific, only works with buffers and not real tabs, default: 0) >
let airline#extensions#tabline#middle_click_preserves_windows = 1
let g:airline#extensions#tabline#middle_click_preserves_windows = 1
<
*airline-tabline-hlgroups*
When the tabline is enabled, vim-airline exposes the following highlighting
@@ -1446,6 +1456,14 @@ Vim-Airline comes with a small extension for the styling the builtin
let g:airline#extensions#term#enabled = 1
default: 1
* Use custom section_z >
let g:airline_section_z_term = '%p%% ☰ %l/%L, %v'
default: airline#section#create(['linenr', 'maxlinenr'])
* Use custom section_a >
let g:airline_section_a_term = '%p%% ☰ %l/%L, %v'
default: airline#section#create_left(['terminal', 'tmode'])
------------------------------------- *airline-tabws*
vim-tabws <https://github.com/s1341/vim-tabws>
@@ -1486,15 +1504,15 @@ tmuxline <https://github.com/edkolev/tmuxline.vim>
let g:airline#extensions#tmuxline#enabled = 0
<
* configure which mode colors should be used in tmux statusline >
let airline#extensions#tmuxline#color_template = 'normal' (default)
let airline#extensions#tmuxline#color_template = 'insert'
let airline#extensions#tmuxline#color_template = 'visual'
let airline#extensions#tmuxline#color_template = 'replace'
let g:airline#extensions#tmuxline#color_template = 'normal' (default)
let g:airline#extensions#tmuxline#color_template = 'insert'
let g:airline#extensions#tmuxline#color_template = 'visual'
let g:airline#extensions#tmuxline#color_template = 'replace'
<
* if specified, setting this option will trigger writing to the file whenever the
airline theme is applied, i.e. when :AirlineTheme is executed and on vim
startup >
airline#extensions#tmuxline#snapshot_file =
let g:airline#extensions#tmuxline#snapshot_file =
\ "~/.tmux-statusline-colors.conf"
<
------------------------------------- *airline-undotree*
@@ -1517,13 +1535,13 @@ Unite <https://github.com/Shougo/unite.vim>
vim9lsp <https://github.com/yegappan/lsp>
* enable/disable vim9lsp integration >
let airline#extensions#vim9lsp#enabled = 1
let g:airline#extensions#vim9lsp#enabled = 1
<
* vim9lsp error_symbol >
let airline#extensions#vim9lsp#error_symbol = 'E:'
let g:airline#extensions#vim9lsp#error_symbol = 'E:'
<
* vim9lsp warning >
let airline#extensions#vim9lsp#warning_symbol = 'W:'
let g:airline#extensions#vim9lsp#warning_symbol = 'W:'
<
------------------------------------- *airline-vimagit*
vimagit <https://github.com/jreybert/vimagit>
@@ -1537,6 +1555,11 @@ Vim-CMake <https://github.com/cdelledonne/vim-cmake>
* enable/disable Vim-CMake integration >
let g:airline#extensions#vimcmake#enabled = 1
<
------------------------------------- *airline-vimodoro*
Vimodoro <https://github.com/VimfanTPdvorak/vimodoro>
No configuration available.
------------------------------------- *airline-vimtex*
vimtex <https://github.com/lervag/vimtex>
@@ -1653,7 +1676,7 @@ vista.vim <https://github.com/liuchengxu/vista.vim>
* configure, which filetypes have special treatment of /* */ comments,
matters for mix-indent-file algorithm: >
let airline#extensions#c_like_langs =
let g:airline#extensions#c_like_langs =
\ ['arduino', 'c', 'cpp', 'cuda', 'go', 'javascript', 'ld', 'php']
<
* disable whitespace checking for an individual buffer >
@@ -1752,7 +1775,11 @@ details on how to use it, see e.g. <https://github.com/ierton/xkb-switch>
let g:XkbSwitchLib = '/usr/local/lib/libInputSourceSwitcher.dylib'
<
Linux with fcitx (Install https://github.com/fcitx/fcitx5):
Install https://github.com/lilydjwg/fcitx.vim) to get `FcitxCurrentIM()`
Install https://github.com/lilydjwg/fcitx.vim to get `FcitxCurrentIM()`
or https://github.com/black-desk/fcitx5-ui.nvim to get
`luaeval('require"fcitx5-ui".displayCurrentIM()')`
or https://github.com/Freed-Wu/ime.nvim to get
`luaeval('require"ime".current()')`
------------------------------------- *airline-xtabline*
xtabline <https://github.com/mg979/vim-xtabline>

View File

@@ -48,6 +48,7 @@ function! s:init()
endfunction
let s:active_winnr = -1
function! s:on_window_changed(event)
" don't trigger for Vim popup windows
if &buftype is# 'popup'
@@ -67,11 +68,20 @@ function! s:on_window_changed(event)
\ && &ft !~? 'gitcommit'
" fugitive is special, it changes names and filetypes several times,
" make sure the caching does not get into its way
if a:event ==# 'BufUnload'
" in the BufUnload event, make sure the cacheing does not prevent
" removing stale entries
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
endif
return
endif
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline()
if a:event ==# 'BufUnload'
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
endif
endfunction
function! s:on_focus_gained()

View File

@@ -38,7 +38,7 @@ Describe init.vim
End
It section x should be filetype
Assert Equals(g:airline_section_x, '%#__accent_bold#%#__restore__#%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#wrap(airline#parts#filetype(),0)}')
Assert Equals(g:airline_section_x, '%#__accent_bold#%#__restore__#%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#wrap(airline#parts#filetype(),0)}')
End
It section y should be fenc and ff

View File

@@ -4,14 +4,16 @@ Describe themes.vim
highlight clear Normal
End
It should extract correct colors
call airline#highlighter#reset_hlcache()
highlight Foo ctermfg=1 ctermbg=2
let colors = airline#themes#get_highlight('Foo')
Assert Equals(colors[0], 'NONE')
Assert Equals(colors[1], 'NONE')
Assert Equals(colors[2], '1')
Assert Equals(colors[3], '2')
It should extract correct colors with No termguicolors
if !exists("+termguicolors")
call airline#highlighter#reset_hlcache()
highlight Foo ctermfg=1 ctermbg=2
let colors = airline#themes#get_highlight('Foo')
Assert Equals(colors[0], 'NONE')
Assert Equals(colors[1], 'NONE')
Assert Equals(colors[2], '1')
Assert Equals(colors[3], '2')
endif
End
if exists("+termguicolors")