diff --git a/autoload/airline/extensions/tabline/formatters/jsformatter.vim b/autoload/airline/extensions/tabline/formatters/jsformatter.vim new file mode 100644 index 0000000..4fd7f45 --- /dev/null +++ b/autoload/airline/extensions/tabline/formatters/jsformatter.vim @@ -0,0 +1,10 @@ +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' + return fnamemodify(buf, ':p:h:t') . '/i' + else + return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers) + endif +endfunction