tmux improvements + starship supports docker compose
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
add_newline = true
|
add_newline = true
|
||||||
format = """$git_branch$git_status$character"""
|
format = """${custom.docker_compose}$git_branch$git_status$character"""
|
||||||
right_format = """$username[@](red)$hostname $cmd_duration$time $directory"""
|
right_format = """$username[@](red)$hostname $cmd_duration$time $directory"""
|
||||||
|
|
||||||
[git_branch]
|
[git_branch]
|
||||||
@@ -36,3 +36,11 @@ style = "green"
|
|||||||
[character]
|
[character]
|
||||||
success_symbol = "[➤](green)"
|
success_symbol = "[➤](green)"
|
||||||
error_symbol = "[➤](red)"
|
error_symbol = "[➤](red)"
|
||||||
|
|
||||||
|
[custom.docker_compose]
|
||||||
|
command = '''docker compose ps --format json 2>/dev/null | jq -rs 'if length == 0 then halt 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"]
|
||||||
|
shell = ["bash", "--noprofile", "--norc"]
|
||||||
|
style = "blue bold"
|
||||||
|
symbol = ""
|
||||||
|
format = "[$output]($style) "
|
||||||
|
|||||||
10
.tmux.conf
10
.tmux.conf
@@ -15,9 +15,13 @@ setw -q -g utf8 on
|
|||||||
bind - split-window -v -c "#{pane_current_path}"
|
bind - split-window -v -c "#{pane_current_path}"
|
||||||
bind _ split-window -h -c "#{pane_current_path}"
|
bind _ split-window -h -c "#{pane_current_path}"
|
||||||
|
|
||||||
# shift+arrow window switching
|
# shift+arrow window switching (no wrap)
|
||||||
bind -n S-Left previous-window
|
bind -n S-Left if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | head -1) ]" "previous-window"
|
||||||
bind -n S-Right next-window
|
bind -n S-Right if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | tail -1) ]" "next-window"
|
||||||
|
|
||||||
|
# swap windows left/right with Ctrl+Shift+Arrow
|
||||||
|
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
|
||||||
|
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
|
||||||
|
|
||||||
# sensible defaults
|
# sensible defaults
|
||||||
set -s escape-time 10
|
set -s escape-time 10
|
||||||
|
|||||||
Reference in New Issue
Block a user