numbered pj, in-docker prompt indicator
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
add_newline = false
|
add_newline = false
|
||||||
format = """${custom.docker_compose}$git_branch$git_status$fill$directory
|
format = """${custom.in_docker}${custom.docker_compose}$git_branch$git_status$fill$directory
|
||||||
$character"""
|
$character"""
|
||||||
right_format = """$cmd_duration$username[@](red)$hostname $time"""
|
right_format = """$cmd_duration$username[@](red)$hostname $time"""
|
||||||
|
|
||||||
@@ -41,6 +41,14 @@ symbol = " "
|
|||||||
success_symbol = "[➤](green)"
|
success_symbol = "[➤](green)"
|
||||||
error_symbol = "[➤](red)"
|
error_symbol = "[➤](red)"
|
||||||
|
|
||||||
|
[custom.in_docker]
|
||||||
|
command = "echo \"🙆 $HOSTNAME\""
|
||||||
|
when = "test -f /.dockerenv"
|
||||||
|
shell = ["bash", "--noprofile", "--norc"]
|
||||||
|
style = "yellow bold"
|
||||||
|
symbol = ""
|
||||||
|
format = "[$output ]($style)"
|
||||||
|
|
||||||
[custom.docker_compose]
|
[custom.docker_compose]
|
||||||
command = '''docker compose ps --format json 2>/dev/null | jq -rse 'if length == 0 then halt_error(1) else [group_by(.State) | .[] | "\(if .[0].State == "running" then "▲" else "▼" end)\(length)"] | "🐳 " + join("/") end' '''
|
command = '''docker compose ps --format json 2>/dev/null | jq -rse 'if length == 0 then halt_error(1) else [group_by(.State) | .[] | "\(if .[0].State == "running" then "▲" else "▼" end)\(length)"] | "🐳 " + join("/") end' '''
|
||||||
detect_files = ["docker-compose.yml", "docker-compose.yaml", "compose.yml", "compose.yaml"]
|
detect_files = ["docker-compose.yml", "docker-compose.yaml", "compose.yml", "compose.yaml"]
|
||||||
|
|||||||
2
.zshrc
2
.zshrc
@@ -168,7 +168,7 @@ function pj {
|
|||||||
[[ -d $d ]] && roots+=(${d:A})
|
[[ -d $d ]] && roots+=(${d:A})
|
||||||
done
|
done
|
||||||
(( ${#roots} )) || { echo "no project dirs found"; return 1 }
|
(( ${#roots} )) || { echo "no project dirs found"; return 1 }
|
||||||
dir=$(find -L ${(u)roots} -mindepth 1 -maxdepth 1 -type d 2>/dev/null | fzf --reverse --prompt="project> " --query="$1" --select-1 --exit-0) && cd "$dir"
|
dir=$(find -L ${(u)roots} -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sort | awk '{printf "%3d %s\n", NR, $0}' | fzf --reverse --prompt="project> " --query="$1" --select-1 --exit-0 --with-nth=2.. | sed 's/^ *[0-9]* //') && cd "$dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
function mkcd {
|
function mkcd {
|
||||||
|
|||||||
Reference in New Issue
Block a user