mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-05-17 05:49:41 +08:00
9bf0c3de43
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 lines
589 B
VimL
16 lines
589 B
VimL
" 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#jsformatter#format(bufnr, buffers)
|
|
let buf = bufname(a:bufnr)
|
|
let filename = fnamemodify(buf, ':t')
|
|
|
|
if filename ==# 'index.js' || filename ==# 'index.jsx' || filename ==# 'index.ts' || filename ==# 'index.tsx' || filename ==# 'index.vue'
|
|
return fnamemodify(buf, ':p:h:t') . '/i'
|
|
else
|
|
return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers)
|
|
endif
|
|
endfunction
|