mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
Update demo gif (#143)
This commit is contained in:
parent
72f75b6f24
commit
434ab57dc2
3 changed files with 6 additions and 5 deletions
|
@ -6,7 +6,7 @@ An interactive cheatsheet tool for the command-line so that you won't say the fo
|
|||
— *Oh, it's not in my shell history*<br>
|
||||
— *Geez, it's almost what I wanted but I need to change some args*
|
||||
|
||||
![Demo](https://user-images.githubusercontent.com/3226564/66068076-4b36a800-e523-11e9-8f20-f5111522cba2.gif)
|
||||
![Demo](https://user-images.githubusercontent.com/3226564/67786208-40513380-fa4d-11e9-9962-75e5cfe552f1.gif)
|
||||
|
||||
**navi** allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands, with argument values prompted to you.
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ opts::eval() {
|
|||
local values=""
|
||||
local col_widths="15,50,0"
|
||||
local fzf_overrides="--with-nth 3,1,2 --exact"
|
||||
local fzf_opts="${FZF_DEFAULT_OPTS:---height 70% --reverse --border --inline-info --cycle}"
|
||||
|
||||
case "${1:-}" in
|
||||
--version|version) entry_point="version"; shift ;;
|
||||
|
@ -73,4 +74,5 @@ opts::eval() {
|
|||
col-widths "$col_widths")"
|
||||
|
||||
export NAVI_PATH="$path"
|
||||
export FZF_DEFAULT_OPTS="$fzf_opts"
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ ui::fzf() {
|
|||
local -r autoselect="$(dict::get "$OPTIONS" autoselect)"
|
||||
local -r with_nth="$(dict::get "$OPTIONS" with-nth)"
|
||||
local -r nth="$(dict::get "$OPTIONS" nth)"
|
||||
local -r fzf_overrides="$(dict::get "$OPTIONS" fzf-overrides)"
|
||||
|
||||
local args
|
||||
args+=("--height")
|
||||
|
@ -13,9 +12,6 @@ ui::fzf() {
|
|||
args+=("--select-1")
|
||||
fi
|
||||
|
||||
local -r fzf_opts="${FZF_DEFAULT_OPTS:---height 70% --reverse --border --inline-info --cycle}"
|
||||
export FZF_DEFAULT_OPTS="${fzf_opts} ${fzf_overrides}"
|
||||
|
||||
local -r fzf_cmd="$([ $NAVI_ENV == "test" ] && echo "fzf_mock" || echo "fzf")"
|
||||
"$fzf_cmd" ${args[@]:-} --inline-info "$@"
|
||||
}
|
||||
|
@ -30,6 +26,7 @@ ui::select() {
|
|||
local -r entry_point="$(dict::get "$OPTIONS" entry_point)"
|
||||
local -r preview="$(dict::get "$OPTIONS" preview)"
|
||||
local -r best="$(dict::get "$OPTIONS" best)"
|
||||
local -r fzf_overrides="$(dict::get "$OPTIONS" fzf-overrides)"
|
||||
|
||||
local args=()
|
||||
args+=("-i")
|
||||
|
@ -48,6 +45,8 @@ ui::select() {
|
|||
fi
|
||||
args+=("--delimiter"); args+=('\s\s+');
|
||||
|
||||
export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS} ${fzf_overrides}"
|
||||
|
||||
echo "$cheats" \
|
||||
| cheat::prettify \
|
||||
| str::as_column $(printf "$ESCAPE_CHAR_3") \
|
||||
|
|
Loading…
Reference in a new issue