Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatter for js files #1617

Merged
merged 2 commits into from
Jan 4, 2018
Merged

Add formatter for js files #1617

merged 2 commits into from
Jan 4, 2018

Conversation

avegancafe
Copy link
Contributor

@avegancafe avegancafe commented Dec 22, 2017

It's a little rough using vim-airline in javascript, as many many files are called index.js or index.jsx, which means every open file in the tab bar just says index.js or whatever. This PR creates another tabline formatter so that you can see what the parent folder is called if you're editing one of those files. Based off of this gist: https://gist.github.com/valerybugakov/c85dcc802548f6585db3ef3060b293a7
and then changed the default to be the unique_tail_improved formatter that's already in vim-airline

Side note: I realize this is super specific for javascript, but I think it'd be awesome if we had some sort of standard for different languages! I'm sure there are other languages that have this similar problem, maybe we could a. generalize this method so it works in more than just js, or b. have some sort of standard for creating new formatters for different languages

@chrisbra
Copy link
Member

the function name is not correct. Please place the function in a new file tabline/formatters/jsformatter.vim

then I think in the documentation should be mentioned that a new formatter is available. Thanks.

@avegancafe
Copy link
Contributor Author

D'oh. I forgot to rename the file. I'll add a section about tabline formatting to the readme, good call

@avegancafe
Copy link
Contributor Author

@chrisbra updated the docs as well 👍 lmk what ya think

@avegancafe
Copy link
Contributor Author

Bump @chrisbra 😄

@chrisbra
Copy link
Member

chrisbra commented Jan 4, 2018

lookgs good, thanks!

@chrisbra chrisbra merged commit 73d8abf into vim-airline:master Jan 4, 2018
@avegancafe
Copy link
Contributor Author

Awesome, no problem!

YCbCr pushed a commit to YCbCr/vim-airline that referenced this pull request May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants