Editor Alias

May 14, 2022 ยท View on GitHub

This file shows examples of shell functions that consumes output of ea print. It is recommended to include them as part of your ea workflow.

Editor Alias

This shell function enables typing e NUM in shell to open the path corrsponding to NUM in your default editor.

Find the shell/editor combination you need below!

BashZshFish
Vim/NeoVimlinklinklink
VSCodelinklinklink
Emacslinklinklink
TextMatelinklinklink

Bash and Vim or NeoVim

e() {
    eval $(ea p \$1 "$EDITOR '{path}' '+call cursor({line}, {column})'")
}

Zsh and Vim or NeoVim

function e {
    eval $(ea p \$1 "$EDITOR '{path}' '+call cursor({line}, {column})'")
}

Fish and Vim or NeoVim

function e
  eval (ea p $argv '$EDITOR "{path}" "+call cursor({line}, {column})"')
end

Bash and VSCode

e() {
    eval $(ea p \$1 "code --goto '{path}:{line}:{column}'")
}

Zsh and VSCode

function e {
    eval $(ea p \$1 "code --goto '{path}:{line}:{column}'")
}

Fish and VSCode

function e
  eval (ea p $argv "code --goto '{path}:{line}:{column}'")
end

Bash and Emacs

e() {
    eval $(ea p \$1 "emacs +{line}:{column} '{path}'")
}

Zsh and Emacs

function e {
    eval $(ea p \$1 "emacs +{line}:{column} '{path}'")
}

Fish and Emacs

function e
    eval (ea p $argv "emacs +{line}:{column} '{path}'")
end

Bash and TextMate

e() {
    eval $(ea p \$1 "mate -l {line}:{column} '{path}'")
}

Zsh and TextMate

function e {
    eval $(ea p \$1 "mate -l {line}:{column} '{path}'")
}

Fish and TextMate

function e
    eval (ea p $argv "mate -l {line}:{column} '{path}'")
end