mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-03-05 06:34:13 +08:00
Compare commits
15 Commits
c7704c6bc7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ab7c731fe | ||
|
|
b03fdc542f | ||
|
|
72acbef146 | ||
|
|
499ae85357 | ||
|
|
e06b45a870 | ||
|
|
6b51799f26 | ||
|
|
159573187e | ||
|
|
e40a696db0 | ||
|
|
5ca7f0b7fe | ||
|
|
41c5f54507 | ||
|
|
7fc376a4d5 | ||
|
|
2e2afc1056 | ||
|
|
45003f9451 | ||
|
|
0694335daa | ||
|
|
7ad8c717c6 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
vim:
|
vim:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ This is the Changelog for the vim-airline project.
|
|||||||
- coc extensions can also show additional status messages as well as the current function
|
- coc extensions can also show additional status messages as well as the current function
|
||||||
- [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension
|
- [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension
|
||||||
- rewrote parts using Vim9 Script for performance improvements
|
- rewrote parts using Vim9 Script for performance improvements
|
||||||
|
- [vim-obsession](https://github.com/tpope/vim-obsession) allow to set paused indicator
|
||||||
- Other
|
- Other
|
||||||
- Changed CI from travis-ci.org to GitHub Actions
|
- 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)
|
||||||
|
|||||||
@@ -526,6 +526,11 @@ function! airline#extensions#load()
|
|||||||
call add(s:loaded_ext, 'rufo')
|
call add(s:loaded_ext, 'rufo')
|
||||||
endif
|
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()
|
||||||
|
|||||||
@@ -27,12 +27,22 @@ endfunction
|
|||||||
function! airline#extensions#fern#configure_sections(win, context) abort
|
function! airline#extensions#fern#configure_sections(win, context) abort
|
||||||
let spc = g:airline_symbols.space
|
let spc = g:airline_symbols.space
|
||||||
let fri = fern#fri#parse(bufname(a:context.bufnr))
|
let fri = fern#fri#parse(bufname(a:context.bufnr))
|
||||||
let abspath = substitute(fri.path, 'file://', '', '')
|
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)
|
call a:win.add_section('airline_a', spc.'fern'.spc)
|
||||||
if exists('*airline#extensions#branch#get_head')
|
if exists('*airline#extensions#branch#get_head')
|
||||||
" because fern navigation changes an internal _fri_ and not the working directory
|
" 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
|
" we need to give it some help so the branch name gets updated
|
||||||
execute 'lcd' abspath
|
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)
|
call a:win.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
|
||||||
else
|
else
|
||||||
call a:win.add_section('airline_b', '')
|
call a:win.add_section('airline_b', '')
|
||||||
|
|||||||
@@ -14,10 +14,14 @@ 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), '')
|
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), (g:airline#extensions#obsession#indicator_text_paused . s:spc))
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
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,14 +49,15 @@ 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
|
||||||
let cur = bufnr('%')
|
if curbuf == s:current_bufnr && curtab == s:current_tabnr && &columns == s:column_width
|
||||||
if cur == s:current_bufnr && &columns == s:column_width
|
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
||||||
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
|
||||||
return s:current_tabline
|
return s:current_tabline
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -77,10 +78,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, cur) > -1
|
if index(b.buffers, curbuf) > -1
|
||||||
call remove(b.buffers, index(b.buffers, cur))
|
call remove(b.buffers, index(b.buffers, curbuf))
|
||||||
endif
|
endif
|
||||||
let b.buffers = [cur] + b.buffers
|
let b.buffers = [curbuf] + b.buffers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! b.get_group(i) dict
|
function! b.get_group(i) dict
|
||||||
@@ -129,7 +130,7 @@ function! airline#extensions#tabline#buffers#get()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let current_buffer = max([index(b.buffers, cur), 0])
|
let current_buffer = max([index(b.buffers, curbuf), 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)
|
||||||
|
|
||||||
@@ -142,7 +143,8 @@ 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 = cur
|
let s:current_bufnr = curbuf
|
||||||
|
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)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ 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'],
|
||||||
@@ -51,7 +52,8 @@ endfunction
|
|||||||
|
|
||||||
function! s:conflict_marker()
|
function! s:conflict_marker()
|
||||||
" Checks for git conflict markers
|
" Checks for git conflict markers
|
||||||
let annotation = '\%([0-9A-Za-z_.:]\+\)\?'
|
" space required for jj conflict marker: #2727
|
||||||
|
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'
|
||||||
if match(['rst', 'markdown', 'rmd'], &ft) >= 0
|
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.'\)\)$'
|
||||||
@@ -61,6 +63,19 @@ 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
|
||||||
@@ -108,6 +123,7 @@ 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
|
||||||
@@ -138,6 +154,9 @@ 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
|
||||||
|
|||||||
45
autoload/airline/extensions/zhihu.vim
Normal file
45
autoload/airline/extensions/zhihu.vim
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
" 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
|
||||||
@@ -136,6 +136,7 @@ function! airline#init#bootstrap()
|
|||||||
\ 'notexists': "\u0246",
|
\ 'notexists': "\u0246",
|
||||||
\ 'dirty': "\u26a1",
|
\ 'dirty': "\u26a1",
|
||||||
\ 'crypt': nr2char(0x1F512),
|
\ 'crypt': nr2char(0x1F512),
|
||||||
|
\ 'executable': "\u2699",
|
||||||
\ }, 'keep')
|
\ }, 'keep')
|
||||||
" Note: If "\u2046" (Ɇ) does not show up, try to use "\u2204" (∄)
|
" Note: If "\u2046" (Ɇ) does not show up, try to use "\u2204" (∄)
|
||||||
if exists("*setcellwidths")
|
if exists("*setcellwidths")
|
||||||
@@ -160,6 +161,7 @@ function! airline#init#bootstrap()
|
|||||||
\ 'notexists': "\u0246",
|
\ 'notexists': "\u0246",
|
||||||
\ 'crypt': nr2char(0x1F512),
|
\ 'crypt': nr2char(0x1F512),
|
||||||
\ 'dirty': '!',
|
\ 'dirty': '!',
|
||||||
|
\ 'executable': "\u2699",
|
||||||
\ }, 'keep')
|
\ }, 'keep')
|
||||||
else
|
else
|
||||||
" Symbols for ASCII terminals
|
" Symbols for ASCII terminals
|
||||||
@@ -177,6 +179,7 @@ function! airline#init#bootstrap()
|
|||||||
\ 'notexists': '?',
|
\ 'notexists': '?',
|
||||||
\ 'crypt': 'cr',
|
\ 'crypt': 'cr',
|
||||||
\ 'dirty': '!',
|
\ 'dirty': '!',
|
||||||
|
\ 'executable': 'x',
|
||||||
\ }, 'keep')
|
\ }, 'keep')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -189,6 +192,7 @@ function! airline#init#bootstrap()
|
|||||||
call airline#parts#define_function('crypt', 'airline#parts#crypt')
|
call airline#parts#define_function('crypt', 'airline#parts#crypt')
|
||||||
call airline#parts#define_function('spell', 'airline#parts#spell')
|
call airline#parts#define_function('spell', 'airline#parts#spell')
|
||||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||||
|
call airline#parts#define_function('executable', 'airline#parts#executable')
|
||||||
call airline#parts#define('readonly', {
|
call airline#parts#define('readonly', {
|
||||||
\ 'function': 'airline#parts#readonly',
|
\ 'function': 'airline#parts#readonly',
|
||||||
\ 'accent': 'red',
|
\ 'accent': 'red',
|
||||||
@@ -253,7 +257,7 @@ endfunction
|
|||||||
function! airline#init#sections()
|
function! airline#init#sections()
|
||||||
let spc = g:airline_symbols.space
|
let spc = g:airline_symbols.space
|
||||||
if !exists('g:airline_section_a')
|
if !exists('g:airline_section_a')
|
||||||
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert'])
|
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert', 'executable'])
|
||||||
endif
|
endif
|
||||||
if !exists('g:airline_section_b')
|
if !exists('g:airline_section_b')
|
||||||
if airline#util#winwidth() > 99
|
if airline#util#winwidth() > 99
|
||||||
|
|||||||
@@ -206,3 +206,11 @@ function! airline#parts#ffenc()
|
|||||||
return &fenc.bomb.noeolf.ff
|
return &fenc.bomb.noeolf.ff
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! airline#parts#executable()
|
||||||
|
if exists("*getfperm") && getfperm(bufname('%')) =~ 'x'
|
||||||
|
return g:airline_symbols.executable
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|||||||
@@ -149,6 +149,18 @@ function! airline#util#has_fugitive()
|
|||||||
return s:has_fugitive
|
return s:has_fugitive
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! airline#util#has_zhihu()
|
||||||
|
if !has('nvim')
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
try
|
||||||
|
call v:lua.require'zhihu'.setup()
|
||||||
|
catch
|
||||||
|
return 0
|
||||||
|
endtry
|
||||||
|
return 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! airline#util#has_gina()
|
function! airline#util#has_gina()
|
||||||
if !exists("s:has_gina")
|
if !exists("s:has_gina")
|
||||||
let s:has_gina = (exists(':Gina') && v:version >= 800)
|
let s:has_gina = (exists(':Gina') && v:version >= 800)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*airline.txt* Lean and mean status/tabline that's light as air
|
*airline.txt* Lean and mean status/tabline that's light as air
|
||||||
*airline* *vim-airline*
|
*airline* *vim-airline*
|
||||||
_ _ _ _ ~
|
_ _ _ _ ~
|
||||||
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
|
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
|
||||||
@@ -374,6 +374,7 @@ its contents. >
|
|||||||
let g:airline_symbols.colnr = ' ㏇:'
|
let g:airline_symbols.colnr = ' ㏇:'
|
||||||
let g:airline_symbols.colnr = ' ℅:'
|
let g:airline_symbols.colnr = ' ℅:'
|
||||||
let g:airline_symbols.crypt = '🔒'
|
let g:airline_symbols.crypt = '🔒'
|
||||||
|
let g:airline_symbols.executable = '⚙'
|
||||||
let g:airline_symbols.linenr = '☰'
|
let g:airline_symbols.linenr = '☰'
|
||||||
let g:airline_symbols.linenr = ' ␊:'
|
let g:airline_symbols.linenr = ' ␊:'
|
||||||
let g:airline_symbols.linenr = ' :'
|
let g:airline_symbols.linenr = ' :'
|
||||||
@@ -427,7 +428,7 @@ window.
|
|||||||
>
|
>
|
||||||
variable names default contents
|
variable names default contents
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
let g:airline_section_a (mode, crypt, paste, spell, iminsert)
|
let g:airline_section_a (mode, crypt, paste, spell, iminsert, executable)
|
||||||
let g:airline_section_b (hunks, branch)[*]
|
let g:airline_section_b (hunks, branch)[*]
|
||||||
let g:airline_section_c (bufferline or filename, readonly)
|
let g:airline_section_c (bufferline or filename, readonly)
|
||||||
let g:airline_section_gutter (csv)
|
let g:airline_section_gutter (csv)
|
||||||
@@ -998,8 +999,11 @@ vim-obsession <https://github.com/tpope/vim-obsession>
|
|||||||
* enable/disable vim-obsession integration >
|
* enable/disable vim-obsession integration >
|
||||||
let g:airline#extensions#obsession#enabled = 1
|
let g:airline#extensions#obsession#enabled = 1
|
||||||
|
|
||||||
* set marked window indicator string >
|
* set marked window indicator string when recording session>
|
||||||
let g:airline#extensions#obsession#indicator_text = '$'
|
let g:airline#extensions#obsession#indicator_text = '$'
|
||||||
|
|
||||||
|
* set marked window indicator string when recording session is paused>
|
||||||
|
let g:airline#extensions#obsession#indicator_text_paused = ''
|
||||||
<
|
<
|
||||||
------------------------------------- *airline-omnisharp*
|
------------------------------------- *airline-omnisharp*
|
||||||
OmniSharp <https://github.com/OmniSharp/omnisharp-vim>
|
OmniSharp <https://github.com/OmniSharp/omnisharp-vim>
|
||||||
@@ -1207,7 +1211,7 @@ Note: Not displayed if the number of tabs is less than 1
|
|||||||
In default mode, when the variable is 1 Up to 10 mappings will be
|
In default mode, when the variable is 1 Up to 10 mappings will be
|
||||||
exposed. Note: As 10 and 1 have same prefix, we use 0 to replace 10. So,
|
exposed. Note: As 10 and 1 have same prefix, we use 0 to replace 10. So,
|
||||||
<leader>0 will jump to tenth buffer. Those mappings are not automatically
|
<leader>0 will jump to tenth buffer. Those mappings are not automatically
|
||||||
created, vim-airline just exposes those `<Plug>AirlineSeelctTab` keys
|
created, vim-airline just exposes those `<Plug>AirlineSelectTab` keys
|
||||||
for you to map to a convenient key >
|
for you to map to a convenient key >
|
||||||
|
|
||||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||||
@@ -1879,6 +1883,13 @@ default: '> Zoomed'
|
|||||||
|
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
|
------------------------------------- *airline-zhihu*
|
||||||
|
zhihu.nvim <https://github.com/pxwg/zhihu.nvim>
|
||||||
|
|
||||||
|
* enable/disable zhihu integration >
|
||||||
|
let g:airline#extensions#zhihu#enabled = 1
|
||||||
|
|
||||||
|
|
||||||
=============================================================================
|
=============================================================================
|
||||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||||
|
|
||||||
@@ -1918,6 +1929,7 @@ The following list of parts are predefined by vim-airline.
|
|||||||
* `iminsert` displays the current insert method
|
* `iminsert` displays the current insert method
|
||||||
* `paste` displays the paste indicator
|
* `paste` displays the paste indicator
|
||||||
* `crypt` displays the crypted indicator
|
* `crypt` displays the crypted indicator
|
||||||
|
* `exectuable` displays the executable indicator
|
||||||
* `spell` displays the spell indicator
|
* `spell` displays the spell indicator
|
||||||
* `filetype` displays the file type
|
* `filetype` displays the file type
|
||||||
* `readonly` displays the read only indicator
|
* `readonly` displays the read only indicator
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Describe init.vim
|
|||||||
|
|
||||||
It section z should be line numbers
|
It section z should be line numbers
|
||||||
Assert Match(g:airline_section_z, '%p%%')
|
Assert Match(g:airline_section_z, '%p%%')
|
||||||
Assert Match(g:airline_section_z, '%l')
|
Assert Match(g:airline_section_z, '%2l')
|
||||||
Assert Match(g:airline_section_z, '%v')
|
Assert Match(g:airline_section_z, '%v')
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user