mix composer.step.edit (composer v0.2.0)

Copy Markdown View Source

Opens the source file of a step in your editor, at its use Composer.Step line.

$ mix composer.step.edit core:setup/credo

The editor command comes from COMPOSER_EDITOR, then VISUAL, then EDITOR; __FILE__ and __LINE__ in it are replaced with the file and line (see Composer.Editor):

# Neovim in the current terminal
export COMPOSER_EDITOR="nvim +__LINE__ __FILE__"

# Neovim in a new Ghostty window
export COMPOSER_EDITOR="ghostty -e 'nvim +__LINE__ __FILE__'"

The step is found as mix composer.step.run finds it. A step from a dependency's cookbook (including the built-in core steps) opens too, with a warning: edits under deps/ are lost when the dependency is updated. A hex: package has no step file, so it cannot be edited.

Options

  • -c, --config - the local config directory (see Composer.Local)
  • --print - print path:line instead of opening an editor