@@ -255,24 +255,32 @@ defmodule IEx.Helpers do
255
255
and falls back to `EDITOR` if the former is not available.
256
256
257
257
By default, it attempts to open the file and line using the
258
- `file:line` notation. For example, if your editor is called
259
- `subl`, it will open the file as:
258
+ `file:line` notation. For example, for Sublime Text you can
259
+ set it as:
260
260
261
+ ELIXIR_EDITOR="subl"
262
+
263
+ Which will then try to open it as:
264
+
261
265
subl path/to/file:line
262
266
267
+ For Visual Studio Code, once enabled on the command line,
268
+ you can set it to:
269
+
270
+ ELIXIR_EDITOR="code --goto"
271
+
263
272
It is important that you choose an editor command that does
264
273
not block nor that attempts to run an editor directly in the
265
274
terminal. Command-line based editors likely need extra
266
275
configuration so they open up the given file and line in a
267
276
separate window.
268
277
269
- Custom editors are supported by using the `__FILE__` and
270
- `__LINE__` notations, for example:
278
+ For more complex use cases, you can use the `__FILE__` and
279
+ `__LINE__` notations to explicitly interpolate the file and
280
+ line into the command:
271
281
272
282
ELIXIR_EDITOR="my_editor +__LINE__ __FILE__"
273
283
274
- and Elixir will properly interpolate values.
275
-
276
284
Since this function prints the result returned by the editor,
277
285
`ELIXIR_EDITOR` can be set "echo" if you prefer to display the
278
286
location rather than opening it.
0 commit comments