Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Bash = Shell(`# Put the line below in ~/.bashrc or ~/bash_profile:
#
# eval "$(jump shell bash)"
#
# The following lines are autogenerated:
__jump_prompt_command() {
local status=$?
jump chdir && return $status
}
__jump_hint() {
local term="${COMP_LINE/#{{.Bind}} /}"
jump hint $term
}
{{.Bind}}() {
local dir="$(jump cd $@)"
test -d "$dir" && cd "$dir"
}
[[ "$PROMPT_COMMAND" =~ __jump_prompt_command ]] || {
PROMPT_COMMAND="__jump_prompt_command;$PROMPT_COMMAND"
}
complete -o dirnames -C '__jump_hint' {{.Bind}}
`)
Bash is the bash shell integration.
View Source
var Fish = Shell(`# Put the line below in ~/.config/fish/config.fish:
#
# status --is-interactive; and source (jump shell fish | psub)
#
# The following lines are autogenerated:
function __jump_add --on-variable PWD
status --is-command-substitution; and return
jump chdir
end
function __jump_hint
set -l term (string replace -r '^{{.Bind}} ' '' -- (commandline -cp))
jump hint $term
end
function {{.Bind}}
set -l dir (jump cd $argv)
test -d "$dir"; and cd "$dir"
end
complete --command {{.Bind}} --exclusive --arguments '(__jump_hint)'
`)
Fish is the fish shell integration.
View Source
var Zsh = Shell(`# Put the line below in ~/.zshrc:
#
# eval "$(jump shell zsh)"
#
# The following lines are autogenerated:
__jump_chpwd() {
jump chdir
}
jump_completion() {
reply=(${(f)"$(jump hint $@)"})
}
{{.Bind}}() {
local dir="$(jump cd $@)"
test -d "$dir" && cd "$dir"
}
typeset -gaU chpwd_functions
chpwd_functions+=__jump_chpwd
compctl -U -K jump_completion {{.Bind}}
`)
Zsh is the zsh shell integration.
Functions ¶
This section is empty.
Types ¶
type Shell ¶
type Shell string
Shell is a small wrapper around string that can pretty print the shell integration scripts.
func (Shell) MustCompile ¶ added in v0.10.0
MustCompile compiles the shell template script to ready to execute (read copy and paste) shell integration.
Click to show internal directories.
Click to hide internal directories.