Last active
July 29, 2017 00:56
-
-
Save valerybugakov/c85dcc802548f6585db3ef3060b293a7 to your computer and use it in GitHub Desktop.
Vim-airline-tabline formatter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Drop this file into ~/.vim_bundle/vim-airline/autoload/airline/extensions/tabline/formatters | |
| " And add to your .vimrc: | |
| " :let g:airline#extensions#tabline#formatter = 'jsformatter' | |
| 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 filename | |
| endif | |
| endfunction | |
| " ~/.vim/bundle/vundle/autoload/airline/extensions/tabline/formatters/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment