Beautifying Elixir code in Windows

Is there any Windows tool (Notepad++ plug-in etc…) or any on-line tool available to format Elixir code, i.e. code beautifier?

Alternatively, is there any Linux command/script that takes a .ex file and pretty formats it?

Thank you very much.

I am not aware of any automatic code beautifier, but most IDEs or smart-editors that have a proper elixir mode do a good job at indentation while you type your code.

I have found vim-elixir that pretty formats elixir code perfectly…

I have tested most popular Windows IDE’s, no one actually provides code formatting for Elixir… What I have done eventually was to install vim-for-windows and vim-elixir and develop a C++ plugin for Notepad++. The plugin runs vim in the background to format the code in the editor. The cool thing was that I eventually made it and built something in what I had always avoided, C++.

1 Like

Is the code available publicly?

Atom works great. Check Rod Watkins post for some tips to set up your dev environment in Windows

I looked for it on my local machine but could not find it. What I have done recently is to switch to VS Code and create a small script (loaded via vs-script-commands extension) which:

  1. Checks if current file is .ex
  2. Runs cmd command which runs vim and beautifies the file.
  3. All can be called by a customized key board shortcut.

If this can be helpful, I will happily post the source code. Let me know.