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

16 lines
537 B
VimL
Raw Normal View History

2019-03-25 19:27:10 +08:00
" MIT License. Copyright (c) 2013-2019 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