vim-airline/autoload/airline/extensions/tabline/formatters/jsformatter.vim

16 lines
537 B
VimL
Raw Normal View History

" MIT License. Copyright (c) 2013-2020 Bailey Ling et al.
2018-01-05 17:37:59 +08:00
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
2017-12-23 01:13:22 +08:00
function! airline#extensions#tabline#formatters#jsformatter#format(bufnr, buffers)
let buf = bufname(a:bufnr)
let filename = fnamemodify(buf, ':t')
2018-04-02 23:29:18 +08:00
if filename == 'index.js' || filename == 'index.jsx' || filename == 'index.ts' || filename == 'index.tsx'
2017-12-23 01:13:22 +08:00
return fnamemodify(buf, ':p:h:t') . '/i'
else
return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers)
endif
endfunction