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

16 lines
569 B
VimL
Raw Normal View History

2021-01-01 20:57:00 +08:00
" MIT License. Copyright (c) 2013-2021 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')
if filename ==# 'index.js' || filename ==# 'index.jsx' || filename ==# 'index.ts' || filename ==# 'index.tsx' || filename ==# 'index.vue'
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