Emily

Emily

Setting Up Visual Studio Code For Max Elixir/Phoenix Efficiency?

It’s been awhile since I’ve coded in Elixir/Phoenix & behind the curve.

i’m setting up an updated coding environment in Visual Studio Code.

Any pros have some suggestions for best plugins & settings for Elixir/Phoenix?

Most Liked

frigidcode

frigidcode

If you are using Elixir <= 1.5 the vscode-elixir plugin will work well. ElixirLS is for >= Elixir 1.6 and utilizes changes within 1.6 for inline reporting of build warnings and errors. I listed my plugins and posted config below. Very basic setup, making use of the keyboard shortcuts, especially vim command mode, save, switch to terminal, switch to code window.

One Dark Pro
Project Manager
Vim
vscode-elixir
vscode-icons

Settings

{
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"vim.disableAnnoyingNeovimMessage": true,
"editor.fontFamily": "'Input Mono'",
"editor.fontLigatures": true,
"editor.fontSize": 16,
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"editor.cursorStyle": "block-outline",
"editor.tabCompletion": true,
"editor.rulers": [
    80, 100
],
"editor.autoIndent": true,
"editor.cursorBlinking": "phase",
"editor.minimap.enabled": false,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
    {
        "before": ["j","j"],
        "after": ["<Esc>"]
    }
],
"vim.leader": "<space>",
"vim.otherModesKeyBindingsNonRecursive": [
    {
        "before": ["<leader>","w"],
        "after": [],
        "commands": [
            {
                "command": "workbench.action.files.save",
                "args": []
            }
        ]
    },
    {
        "before": ["<leader>","t"],
        "after": [],
        "commands": [
            {
                "command": "workbench.action.terminal.focus",
                "args": []
            }
        ]
    }
],
"vsicons.dontShowNewVersionMessage": true,
"window.zoomLevel": 0
}
10
Post #2
michallepicki

michallepicki

I like VSCode with the elixir-ls extension because it gives me fast incremental dialyzer, formatter integration, documentation tooltips on hover and decent Intellisense out of the box without much config tinkering. TBH I’d use vim if I could get it all there that easily.

My VSCode config with some comments:

{
  // Elixir:
  "elixirLS.fetchDeps": false,
  "elixirLS.dialyzerWarnOpts": [
    "error_handling",
    "underspecs",
    "unknown",
    "unmatched_returns",
    // "overspecs",
    // "specdiffs"  // disabled because ecto / phoenix produce too many warnings
  ],

  // Privacy:
  "telemetry.enableTelemetry": false,
  "telemetry.enableCrashReporter": false,
  "workbench.settings.enableNaturalLanguageSearch": false,

  // Editor:
  "editor.minimap.enabled": false,
  "editor.overviewRulerBorder": false,
  "editor.glyphMargin": false,
  "editor.tabSize": 2,
  "editor.folding": false,

  // UI & general behaviour
  "terminal.integrated.fontFamily": "Ubuntu mono", // fixes invisible underscores in terminal on Ubuntu
  "window.menuBarVisibility": "toggle", // show menu only after clicking Alt
  "git.autorefresh": false, // I don't use the integration anyway
  "workbench.editor.enablePreview": false,

  // Search:
  "search.exclude": {
    "**/node_modules": true,
    "**/.elixir_ls": true
  },
  "explorer.autoReveal": false, // Prevents the browser from jumping around when switching files
}
frigidcode

frigidcode

Elixir-LS provides syntax highlighting and has the option to format on save which is awesome.

editor.formatOnSave

Where Next?

Popular in Questions Top

Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&amp;query=perfume&amp;page=2, I would like to get: ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
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
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
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
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

We're in Beta

About us Mission Statement