For .js files, I set a particular filetype in order to enable snippets, like this:
augroup project
autocmd!
autocmd BufRead,BufNewFile *.js set filetype=javascript.javascript-es6-react.jsx
augroup END
Of course, I get the section_x that then reads all of the filetype. I wanted to set up sexction_x for *.js files to "js" or "javascript" only and added the following to the augroup:
au BufRead,BufNewFile *.js let g:airline_section_x='js'
and it kind of works. When I load the file via NERDTree, section_x stays the same, but when I switch from buffer to NERDTree and back to buffer, it then registers the new section_x and it works... but, airline doesn't do the 'normal' thing if I load any other filetype then. It stays 'js' throughout the vim session.
I am aware that I am most probably doing the stupid thing here, but I'm asking how should I do the right thing. How can I make this happen only for 'js' files and have it all work?