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

16 lines
537 B
VimL
Raw Normal View History

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