Show loading indicator in prompt whilst plugins are loading
This commit is contained in:
parent
83b6e927c6
commit
95153292ea
4 changed files with 29 additions and 2 deletions
11
jmb.omp.toml
11
jmb.omp.toml
|
@ -56,8 +56,15 @@ console_title_template = '{{ .Folder }}'
|
||||||
always_enabled = true
|
always_enabled = true
|
||||||
|
|
||||||
[[blocks]]
|
[[blocks]]
|
||||||
type = 'prompt'
|
type = 'rprompt'
|
||||||
alignment = 'right'
|
alignment = 'left'
|
||||||
|
|
||||||
|
[[blocks.segments]]
|
||||||
|
type = "text"
|
||||||
|
style = "plain"
|
||||||
|
foreground = "black"
|
||||||
|
background = "transparent"
|
||||||
|
template = "{{ if .Env.SHELL_LOADING }} loading {{ end }}"
|
||||||
|
|
||||||
[[blocks.segments]]
|
[[blocks.segments]]
|
||||||
type = "executiontime"
|
type = "executiontime"
|
||||||
|
|
12
sheldon.toml
12
sheldon.toml
|
@ -10,6 +10,11 @@ shell = "zsh"
|
||||||
defer = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}"""
|
defer = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}"""
|
||||||
defer-more = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer -t 0.5 source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}"""
|
defer-more = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer -t 0.5 source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}"""
|
||||||
|
|
||||||
|
# Loading indicator
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
[plugins.show]
|
||||||
|
local = "~/.zsh/plugins/loading"
|
||||||
|
|
||||||
# Completions
|
# Completions
|
||||||
# -----------
|
# -----------
|
||||||
|
@ -96,3 +101,10 @@ apply = ["defer-more"]
|
||||||
[plugins.ngrok]
|
[plugins.ngrok]
|
||||||
local = "~/.zsh/plugins"
|
local = "~/.zsh/plugins"
|
||||||
apply = ["defer-more"]
|
apply = ["defer-more"]
|
||||||
|
|
||||||
|
# Loading indicator
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
[plugins.hide]
|
||||||
|
local = "~/.zsh/plugins/loading"
|
||||||
|
apply = ["defer-more"]
|
||||||
|
|
4
zsh/plugins/loading/hide.plugin.zsh
Normal file
4
zsh/plugins/loading/hide.plugin.zsh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Hide the loading indicator
|
||||||
|
unset SHELL_LOADING
|
4
zsh/plugins/loading/show.plugin.zsh
Normal file
4
zsh/plugins/loading/show.plugin.zsh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Show the loading indicator
|
||||||
|
export SHELL_LOADING=true
|
Loading…
Add table
Reference in a new issue