sublimecoder

sublimecoder

Vim interfering with Phoenix recompile after saving

So I’m having some trouble. Recently my phoenix code stopped reloading, when I would make a change to backend code. So I’ve been having to flip back a forth killing the server and reloading after every change. I’m currently using Vim and Ale for linting, I read a github issue that said this was an issue a couple years ago, not sure if its still an issue but It does go away if I switch to emacs or atom or another editor so it makes me think its most likely the same issue.

I’d like to keep using vim since most of my muscle memory is there, anyone have any work arounds or solutions for this? Any help would be appreciated.

Thanks

First Post!

NobbZ

NobbZ

Deactivate compile on save or any plugin that does it to lint. Or if you are able to, change them to use different folders than the project folder to temporary save, compile and lint.

You could tell vim to use an :editor MIX_ENV which is equal to :dev but does end up in ./_build/editor/ instead.

Those are the workarounds that I’m aware of. You can use those workarounds for any editor-plugin that compiles on save.

Most Liked

gregvaughn

gregvaughn

I have this in my init.vim file to work around the issue:

  let $MIX_ENV = 'test'
NobbZ

NobbZ

My assumption is, that he starts his editor with MIX_ENV=test, similar to how I proposed MIX_ENV=edit in this thread.

How to actually do this depends on your operating system, your shell and the editor.

sublimecoder

sublimecoder

Thanks, not sure how to do that for Ale. I did confirm it is Ale doing it. I just removed it and the issue cleared itself up. Once I find the settings or another solution I’ll post it here.

Thanks for pointing me in the right direction.

Last Post!

jvoegele

jvoegele

I do the same, @gregvaughn. The only problem I’ve found with doing this is that it effectively breaks mix test --stale, so just be aware of that.

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement