Add formatter for js files

This commit is contained in:
Kyle Holzinger 2017-12-22 12:13:22 -05:00
parent c386332570
commit a3d5e84417

View File

@ -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