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

filetype typescriptreact on nvim doesn't highlight at all #52

Closed
unphased opened this issue Jul 1, 2020 · 2 comments
Closed

filetype typescriptreact on nvim doesn't highlight at all #52

unphased opened this issue Jul 1, 2020 · 2 comments

Comments

@unphased
Copy link

unphased commented Jul 1, 2020

I've followed instructions and eliminated all other javascript and typescript related plugins, but when I open my TSX files in neovim, they are 100% unhighlighted. I have to change them manually to filetype=typescript to get some sort of highlighting to appear. Although that does not look correct either. On further testing it looks like this just applies plain vim highlighting, which is very lacking.

I have tried erasing everything else from my vim configuration. the behavior is the same, so this should eliminate any other config I have from conflicting.

My vim config:

set nocompatible                   
set encoding=utf-8                 
set showcmd                        
                                   
set autoindent                     
                                   
filetype plugin indent on          
                                   
call plug#begin('~/.vim/plugged')  
                                   
Plug 'chemzqm/vim-jsx-improve'     
                                   
call plug#end()                    

neovim v0.5.0-553-gd8c5d122f

image

vim 8.2 patches up to 512

image

Could somebody recommend troubleshooting steps?

@unphased unphased changed the title filetype typescriptreact filetype typescriptreact on nvim doesnt work right, am confused Jul 1, 2020
@unphased unphased changed the title filetype typescriptreact on nvim doesnt work right, am confused filetype typescriptreact on nvim doesn't highlight at all Jul 1, 2020
@unphased
Copy link
Author

unphased commented Jul 1, 2020

I think I'll have to return to the config I had before which was looking fine, I was only trying to modernize it with this because matchit.vim was being confused by ES6 arrow function angle brackets.

For what it's worth, it was the trio of these plugins:

leafgarland/typescript-vim
peitalin/vim-jsx-typescript
pangloss/vim-javascript

I'm currently finding that removing vim-javascript seems to be a net positive but it leaves my plain javascript files a bit bare. Still not sure what the proper setup is.

@chemzqm chemzqm closed this as completed in 2c8a999 Jul 2, 2020
@unphased
Copy link
Author

unphased commented Jul 4, 2020

Hi @chemzqm thanks for the update.

I have now tested it. It still does not work. I have looked, and it looks like my typescriptreact buffers in neovim do not have b:current_syntax defined. I will be sure to test this again once I update my neovim to a new version, in case it is a neovim bug.

So, that should be why it is failing to source the syntaxfile. I have also found once I manually source the syntaxfile, that many of the trailing close braces in tsx files are highlighted bright red similar to #39.

I am also still confused why most users seem to still see their tsx/jsx files load up in filetype javascript. Maybe I'm on really new versions of vim/nvim? I only update every few months...

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

No branches or pull requests

1 participant