The instructions for language support for Vue doesn't work on Windows.
I did this:
npm install -g vue-language-server
And then this
export const configuration = {
//add custom config here, such as
"ui.colorscheme": "nord",
//"oni.useDefaultConfig": true,
//"oni.bookmarks": ["~/Documents"],
//"oni.loadInitVim": false,
"editor.fontSize": "16px",
"editor.fontFamily": "Fantasque Sans Mono",
// UI customizations
"ui.animations.enabled": true,
"ui.fontSmoothing": "auto",
// Custom
"language.vue.languageServer.command": "vls"
My Vue files still don't have highlight: https://i.stack.imgur.com/7FulC.png
Note: I'm using Windows 7 and I installed Oni with Oni-0.3.1-ia32-win.exe.
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
@alexcheninfo thanks for the issue, unfortunately the vue language server unfortunately doesn't include syntax highlighting we currently dont have a textmate grammar loaded for vue files, personally I currently use a vim plugin called vim-polyglot which add vim syntax highlighting.
I think its worth using this issue to track getting that setup. Are you getting the quickinfo window opening though and completion etc?
@Akin909 Thanks for the fast reply. So Vim plugins can be used with Oni? I'm a bit confused about this.
(I haven't checked the other features.)
@alexcheninfo, yes they do 😄 the editor is actually just a full neovim instance (basically wrapped in react) so you can set "oni.loadInitVim": true, which will load in your init.vim and all your vim plugins 👍(depending on how complex your init.vim is you might need to add a if !g:gui_oni to wrap some of the more complex not gui friendly bits
Any updates about highlighting on .vue files without a vim plugin?
I found this. https://gist.github.com/yyx990803/98b00c3bea972349375a How I can include manually?
It is a bit confusing that it talks about language support for .vue files in the documentation, only to find out that they are not really supported by this?!
@avstudio a textmate grammar can be added in a similar way as this PR #2539 basically you create a folder inside of the oni/extensions/ dir called vue and add the grammar to subfolder called syntaxes (this is an approx. instruction I'm at work so this is off the top of my head, the PR shows how), then you add the path of the grammar with the filetype to the default configuration in Oni and submit a PR.
@tbsvttr Oni does not come bundled with vue support what the docs are getting at is that to add language-server support for vue you need to install the vue lsp and configure it in your config.tsx then this would provide things like autocompletion, re. highlighting we are currently in the process of accumulating textmate grammars for different filetypes but were still in alpha and the process is laborious so we dont have grammars for a lot of languages still, but we could do with updating the docs, there just aren't very many of us so these things take time
@Akin909 Thanx. One more question pls. How I can combine textmate grammar with custom syntax highlighting for some file types for ex. vue files. When I load my init file, and set syntax on, It seams that oni ignore textmate grammar even I have "editor.textMateHighlighting.enabled": true. Thanx in advanced.
@avstudio have you added the grammar to the oni/extensions/dir and loaded it into the DefaultConfiguration on your local machine? the extension you use in the DefaultConfiguration has to match the filetype extension that vim uses for vue I dont know what that is but if its .vue then in the default config it should be something like language.vue.... see #2539 for an example of how it was done for csharp