Open K-NRS opened 4 years ago
Which plugin are you using for highlighting TypeScript now?
# Plug 'leafgarland/typescript-vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'peitalin/vim-jsx-typescript'
These are. But so bad. Almost like syntax off.
@K-NRS Maybe you have something else in your config that disturbs language highlighting for typescript. Check, if you have this command set regexpengine = 1
, and better delete it for good, because that broke my ts highlight with any plugin.
Currently I'm using this trio,
Plug 'yuezk/vim-js'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'maxmellon/vim-jsx-pretty'
and it covers all my needs in webdev, even in complex files, like in the picture
@zorgick I dont think the problem is about regexpengine and i couldn't see anything related to typescript in your picture. I have no problem with js files. I just wanted to ask, "will this plugin have TypeScript support?"
My vim shows .ts and .tsx files like this:
It doesn't even look like javascript files colorized by yuezk/vim-js and happens "'redrawtime' exceeded, syntax highlighting disabled" in some .ts and .tsx files. Not comfortable at all.
@K-NRS How about replace Plug 'peitalin/vim-jsx-typescript'
with Plug 'maxmellon/vim-jsx-pretty'
and try again?
@K-NRS the point is in the separation of concerns. Vim-js is a wonderful plugin that can't treat your js file any better. Yats is a reliable plugin that will do the same for your ts files. Thus, it is a redundancy to repeat the funtionality of yats in vimjs plugin.
Please reconsider your config, and try to make it as minimalistic as possible. You'd rather leave ONLY these 3 plugins, that I use, and check if your highlighting works.
Refer to this problem about regexengine click.
The picture I provided is a tsx file of 1200 lines. Without yats vim would highlight only exports, this and const/let, leaving jsx as simple text.
@yuezk still it's almost the same.
When i look at scriptnames, i only see yats and vim-jsx-pretty as typescript plugin. And does not colorize function names, dots and operators (?. , || , &&) etc...
My vimrc file is already pretty minimal. But I will try with a much simpler vimrc in a container. I saw /usr/share/nvim/runtime/syntax/typescript.vim
at the end of the scriptnames.
@K-NRS Just curious, which plugin do you use to add this?
@zorgick I also want to know which plugin are you using for adding the lint message here?
I was looking for this feature for a long time.
@yuezk Neovim with coc.nvim. Enable its codeLens or make diagnostic.virtualText: true
@yuezk it's vim-lsp. I switched to it after coc, and it's really fast and easy to set up
@K-NRS I also use them, these is behavior on my vim
HerringtonDarkholme/yats.vim,
MaxMEllon/vim-jsx-pretty,on_ft
Notice that the vim and neovim had add the typescript syntax based on HerringtonDarkholme/yats.vim, https://github.com/neovim/neovim/commit/bd23fefb391816648ebd701096bf9973f6256750 https://github.com/vim/vim/commit/12ee7ff00b91d852e060bb24951d1c94239863eb ,
@K-NRS I also use them, these is behavior on my vim
HerringtonDarkholme/yats.vim, MaxMEllon/vim-jsx-pretty,on_ft
My current configuration too is like that now. The syntax could not be colored like VSCode in Vim. I accepted this until there is a new change.
@K-NRS you can get the current cursor word syntaxt group then check what color set and config it.You may not be able to get the same colorscheme as vscode. Syntax highlight via regular configuration in vim may conflict with other highlight plugins, such as rainbow.vim. The current highlighting is easier for me to accept. This is my colorscheme and i config typescript support you can reference it.
Hello, the plugin is the best in vim javascript syntaxes. It would be nice to have a syntax plugin for TypeScript too. What do you think about this?