-
Notifications
You must be signed in to change notification settings - Fork 61
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
An alternative to vue-mode with polymode #109
Comments
I've been using polymode also here's my configuration for my vue-mode
|
@SjB I'll have to try your version! Looks much more refined. |
Wow, this is just in time, thanks for sharing! I tried it and it seems to work! In terms of stability it is much better than vue-mode. |
Here I'll be keeping (and hopefully updating) a list of things that don't work yet in the solution provided by @SjB:
|
@AlexDaniel Are you sure about number 2? When I tried it (admittedly using my configuration, but essentially it's the same thing as what @SjB posted):
Are you sure the auto-fix actually works on the lsp end for the suggestion you try to invoke? I think I've noticed that not all code actions work. |
@RKBK not sure about number 2. I'm seeing some weird bugs but I think they're related to other packages. |
replace the poly-vue-style-tag-lang-innermode and poly-vue-style-innermode with this
|
@AlexDaniel, @RKBK I'm creating a gist of my polymode configuration for vue-mode https://gist.github.com/SjB/07cdce0f1fba171704d93c2989077f4d |
For those that switched to polymode, how are you finding it for working with vue? I forked this repo to look at fixing some of the issues but if there is an alternative that exists then I'll try that out. |
I liked the speed of the polymode, but at the time I wasn't able to debug and fix the sorts of issues that @Artawower mentioned. In the end, I gave up on the polymode and went to web-mode. That just works for vue files. I'm not sure if vue-mode does anything extra in excess of what web-mode allows for. The one thing I don't love about web-mode is that it feels a smidge slow sometimes (and recently I've had to refresh the connection to the vls server more often, but I'm not sure if that's because of web-mode or something else). |
The same situation. Now I am using web mode, there are also some problems like poor pug mode support and wrong indentation in sass mode, but this is better than other solutions |
Yeah. I've moved back to web-mode as well. I couldn't quite gel with polymode. So far, I just been playing around with this current config. Still rough around the edges.
Not settings. Source here: https://github.com/jerryhsieh/Emacs-config/blob/master/init.el I'm just seeing what sticks and possibly will adjust to my needs. |
@SjB do you use polymode with your config as replacement for vue-mode ? |
does this config still work ?
@AdrianDeveloper |
@AdrianDeveloper above reply |
Sorry for the late reply. This worked ok, but in the end, I just moved back to neovim and that's where I'm at. Good luck. |
I've had several issues getting vue-mode to work right with lsp. I work in vue with typescript and scss. I couldn't get typescript-mode working right (it wouldn't style (font lock?) the code without first entering a .ts file) in the ts section of the vue file, and I couldn't get syntax checking (lsp and then eslint) working right. I'm sure this is all my own fault, and because I don't understand emacs well enough. However, yesterday I gave up, and since I'd heard about emacs "polymode" (https://polymode.github.io/), I gave that a try. The following blog post was also helpful https://masteringemacs.org/article/polymode-multiple-major-modes-how-to-use-sql-python-in-one-buffer . This SE answer helped me with the regexps: https://superuser.com/a/1553876 .
The big advantage is that you define each section of the code by regexps for the start and end of the section, and you then define the major mode in each section freely. No major mode defining multiple major modes, just three separate major modes which you configure in whatever way you want.
The code that follows, from my init.el/.emacs, made that work for a vue file. This is terribly quick and dirty, but I still wanted to share it. Lsp and flycheck is only set up the way I want for the typescript section, so far.
It assumes the script section will always be typescript. It assumes the style section will always be scss. That's pretty lazy in comparison with what vue-mode does.
However, then I can separately define lsp, typescript-mode and scss-mode, with whatever settings I want. I get the vetur lsp server (I think that's because I've selected vetur in lsp-mode when I first opened a .vue file).
For example
This gets me typescript-mode with lsp and eslint checking.
This sets up lsp-mode, and enables lsp for typescript-mode, html-mode and scss mode. Note that I don't know if the :config section is reasonable or correct, but it's what I've got right now.
It seems to just work!
The text was updated successfully, but these errors were encountered: