Skip to content

Commit 9b404ef

Browse files
committed
feat(omz): customize prompt
1 parent 8df6a04 commit 9b404ef

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

_all.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# - import_playbook: customization-text.yaml
1515
- import_playbook: customization-ui.yaml
16+
- import_playbook: omz/customization.yaml
1617
- import_playbook: vscode/customization.yaml
1718
- import_playbook: docker/customization.yaml
1819
- import_playbook: dotnet/customization.yaml

omz/customization.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
- name: Oh my zsh
2+
hosts: 127.0.0.1
3+
connection: local
4+
5+
tasks:
6+
- name: Enhance terminal prompt
7+
blockinfile:
8+
dest: ~/.zshrc
9+
marker: "### {mark} Ansible managed: prompt"
10+
block: |
11+
# remove name from prompt
12+
prompt_context() {}
13+
BULLETTRAIN_PROMPT_ORDER=(
14+
uptime
15+
status
16+
custom
17+
context
18+
dir
19+
nvm
20+
git
21+
cmd_exec_time
22+
)
23+
24+
prompt_uptime(){
25+
on=${${${(s: :)"$(uptime)"}[3]}%,}
26+
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG "[$on]"
27+
}
28+
29+
- name: Setup aliases
30+
blockinfile:
31+
dest: ~/.zshrc
32+
marker: "### {mark} Ansible managed: aliases"
33+
block: |
34+
alias zshconfig='vim ~/.zshrc'
35+
alias ohmyzsh='vim ~/.oh-my-zsh'
36+
alias home='deactivate; cd ~; clear'
37+
alias sgid-index='>&2 echo "starting sgid index update" && workon gis.utah.gov && >&2 echo "switching to master branch" && git checkout master && >&2 echo "updating from remote" && git up && >&2 echo "running python" && python datatable.py
38+
if git commit -am ":package: update sgid-index"
39+
then git push
40+
fi
41+
>&2 echo "done" && deactivate && cd ~/'
42+
alias clip='pbcopy'
43+
alias grep='grep --colour=auto'
44+
alias ls='ls -GFh'

0 commit comments

Comments
 (0)