mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-27 02:33:56 +08:00
Add formatter for js files
This commit is contained in:
parent
c386332570
commit
a3d5e84417
|
@ -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
|
Loading…
Reference in New Issue
Block a user