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

Copy Markdown View Source

Opens the group file that holds a recipe in your editor, at the line where the recipe starts.

$ mix composer.recipe.edit local:phx/app

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 -c __LINE__ __FILE__"

The recipe is found as mix composer.recipe.run finds it, but is not evaluated, so a recipe that fails to load can still be opened, as long as its group file parses. A recipe from a dependency's cookbook opens too, with a warning: edits under deps/ are lost when the dependency is updated.

Options

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