Imagine all the things you could have done with your life instead of typing end
!
That worked for do end
but not fn -> end
!
I know it sounds so silly, but what happens is that if I type end myself, it triggers autocomplete, which then captures my up arrow keypress. So you have to press escape or something to get out of autocomplete, which also takes you out of insert mode. So then you have to press i again, then up, then tab. Itās many keypresses for something that happens all the time.
Also, if you just leave a block open without the corresponding end, then everything gets colored bright red cuz itās a syntax error. Not only that, but indent just completely stops working.
See screenshot for an example. My cursor (which you canāt see because of other neovim related reasons) is on column 1, i.e. autoindent just completely fails.
Ah, dang! You could try regular olā endwise, though I remember when I was trying out NeoVim it didnāt work and I had to use the treesitter one. Sorry, Iām going off recent knowledgeāI actually gave up on NeoVim and back with regular olā classic Vim (aka, Vim). I just keep up with this thread because itās the closest I get to Vim content 'round here.
Gah, that sounds super frustrating. Sorry I canāt be of more help.
If you have a snippet plugin installed, youāll get snippet type options from the autocomplete list. And if I remembered correctly, the elixir-ls provides some builtin snippets for do
block and anonymous function.
So you just need to type do
or fn
and then select the snippet from autocomplete options. It will expand to something like do | end
or fn | -> end
.
If you want an experience more like auto pairs, you can try nvim-autopairs and roll your own rules.
The neovim ecosystem is moving fast, and this post is kind of outdated already. Iāll update the post later when I get more free time.
This is a more tricky problem. LSP client in Neovim needs a project root directory to work. When you open a .ex
file from an elixir project, the current working directory will be set to the elixir project root.
Thereās some related discussions and possible solutions here: https://www.reddit.com/r/neovim/comments/16kkeq1/neotree_keeps_switching_working_directory_in_a/ .
I only just started using snippets recently after 20+ years ofā¦ not using snippets. Itās the same feeling I had after not wearing sunglasses until I was 25. What the $#%@ was I thinking this whole time???
exactly! this is my personal beef with at least some of pre-packaged Neovim distributions - i feel like maintenance cost on my side and amount of paper cuts is just not worth it.
skipping aside the fact i am losing opportunity to learn bit of Lua and finally have an excuse to poke around Neovimās plugin API (sure, itās a subjective matter, i get it).
I only just started using snippets recently after 20+ years ofā¦ not using snippets.
guilty!
Hey there
I am having troubles trying to make the elixir ls understand the root of my project.
I have a single repo with multiple elixir projects. When I enter one of the projects I expect the elixirls to understand that the root should be that subfolder, but it keeps going up to the root of the mono repo.
Any suggestions?
Is it an umbrella? Or is it a directory containing several independent projects in sub-directories?