Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 2.26 KB

File metadata and controls

111 lines (82 loc) · 2.26 KB

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!

Bash Zsh Fish
Vim/NeoVim link link link
VSCode link link link
Emacs link link link
TextMate link link link

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