-
Make sure you have
Package Control
installed first. -
Install the latest versions of:
cd "~/Library/Application Support/Sublime Text/Packages"
git clone [email protected]:sublimelsp/LSP.git
git clone git://github.com/elixir-lang/elixir-tmbundle Elixir
- Restart Sublime and run the command
Package Control: Satisfy Dependencies
to make sure everything is installed.
- Clone the Elixir Language Server repo and compile:
git clone [email protected]:elixir-lsp/elixir-ls.git
cd elixir-ls
mix deps.get
mix compile
mix elixir_ls.release -o release/
- Configure
LSP.sublime-settings
to point to the Elixir LS "release" we just compiled:
"clients": {
"elixir-ls": {
"command": [
"/ABSOLUTE_ELIXIR_LS_PATH/release/language_server.sh"
],
"enabled": true,
"languageId": "elixir",
"scopes": [
"source.elixir"
],
"settings": {
},
"syntaxes": [
"Packages/Elixir/Syntaxes/Elixir.tmLanguage"
]
}
}
- Turn on auto formatting in
Preferences.sublime-settings
:
"lsp_format_on_save": true,
- Hide
.beam
files inPreferences.sublime-settings
:
"binary_file_patterns": [
"*.beam"
]
- Hide un-needed directories in
Preferences.sublime-settings
:
"folder_exclude_patterns": [
"deps",
"_build",
".elixir_ls"
]
- Setup
ctrl+click
to open function definition inDefault.sublime-mousemap
:
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "lsp_symbol_definition"
}
]
(Use button3
for middle-click)