Currently you have to type the opening <%= and it will automatically add the closing %> but this is more key presses than in other editors.
Also, html tags - usually you can type something like p then tab and it will give you the opening and closing <p> tags… but this doesn’t work in Spacemacs. Typing p seems to give you the option but pressing enter doesn’t seem to do anything
The p + tab is done using emmet mode and I got it working with eex, haml and react files. My .spacemacs file is pretty messy but I think I got it working with this customization or this one. Hope it helps.
And these lines are to enable it in react and haml.
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(setq web-mode-content-types-alist
'(("jsx" . "\\.js[x]?\\'")))
;; Use emmet mode in other modes (React and Haml)
(add-hook 'react-mode-hook 'emmet-mode)
(add-hook 'haml-mode-hook 'emmet-mode)
What is necessary for supporting jump-to-definitions (SPC m g g)? I recently install GNU global tags to get this function to work in the Elixir layer. However, Spacemacs keeps asking for the Tags file even after I generated the tag file in the project root. Then I read Alchemist should be all I need. I feel I am holding it wrong.
Anyone have a helpful blog article or forum post on properly configuring Spacemacs/Elixir to jump to definitions and symbol searching?
I wrote about this on the erlang channel on Slack a while ago and was told that Alchemist may have issues not working with the latest Elixir. All you should need in a spacemacs setup is to add the Elixir layer and go and this used to work beautifully, but as I said I’ve had issues lately too.
For the time being I’m using neovim with Alchemist.vim instead and I’m having a good time. Then again, I usually switch back and forth every now and then, so I have no issue switching to neovim for a language or two.
@bill.c@gon782 My jump to definition also seems broken, but you can use “dump-jump-go” instead, which is a separate package from Alchemist and works fine with Elixir. I’ve defined the following shortcut:
This will add a hook that will perform a lsp-format-buffer before saving the file.
If that does not work check if SPCSPClsp-format-buffer lints your buffer.
For lsp-Integration and code suggestions I think the following lines helped me to allow my lsp to watch all files, prefer flycheck instead of flymake and enable its lsp integration.
Mh,
strange…
I just tried that and when I create a new file I’ve got the same problem like you.
However, after lsp-restart-workspace it worked as it should. Maybe the language server is running stale after some time and does not include the right file? Is there any command to force “add” a buffer to a lsp session?
Oh, and does lsp-format-buffer do anything for you?