66bae5a5deb7a053adfb05b38a93fe47295841eb
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/themes/pure.zsh-theme b/themes/pure.zsh-theme
2index 0e5681cc7f887bb0e80f5dd708c6ab85e31c5de1..98c1312af12e88a73ce773f479b6fe08b013b589 100644
3--- a/themes/pure.zsh-theme
4+++ b/themes/pure.zsh-theme
5@@ -1,106 +1,10 @@
6-#!/usr/bin/env zsh
7+print -P '%F{yellow}'Oh My Zsh pure theme:
8+cat <<-EOF
9
10-# ------------------------------------------------------------------------------
11-#
12-# Pure - A minimal and beautiful theme for oh-my-zsh
13-#
14-# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
15-# thanks goes out to him for designing the fantastic Pure prompt in the first
16-# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from
17-# which I've borrowed both some ideas and some actual code. You can find out
18-# more about both of these fantastic two people here:
19-#
20-# Sindre Sorhus
21-# Github: https://github.com/sindresorhus
22-# Twitter: https://twitter.com/sindresorhus
23-#
24-# Julien Nicoulaud
25-# Github: https://github.com/nicoulaj
26-# Twitter: https://twitter.com/nicoulaj
27-#
28-# ------------------------------------------------------------------------------
29+ The pure theme has been renamed as 'refined' as per the original author's
30+ request. Change your ZSH_THEME to 'refined' to avoid seeing this warning.
31
32-# Set required options
33-#
34-setopt prompt_subst
35+EOF
36+print -P '%f'
37
38-# Load required modules
39-#
40-autoload -Uz vcs_info
41-
42-# Set vcs_info parameters
43-#
44-zstyle ':vcs_info:*' enable hg bzr git
45-zstyle ':vcs_info:*:*' unstagedstr '!'
46-zstyle ':vcs_info:*:*' stagedstr '+'
47-zstyle ':vcs_info:*:*' formats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%%u%c"
48-zstyle ':vcs_info:*:*' actionformats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%u%c (%a)"
49-zstyle ':vcs_info:*:*' nvcsformats "%~" "" ""
50-
51-# Fastest possible way to check if repo is dirty
52-#
53-git_dirty() {
54- # Check if we're in a git repo
55- command git rev-parse --is-inside-work-tree &>/dev/null || return
56- # Check if it's dirty
57- command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo "*"
58-}
59-
60-# Display information about the current repository
61-#
62-repo_information() {
63- echo "%F{blue}${vcs_info_msg_0_%%/.} %F{8}$vcs_info_msg_1_`git_dirty` $vcs_info_msg_2_%f"
64-}
65-
66-# Displays the exec time of the last command if set threshold was exceeded
67-#
68-cmd_exec_time() {
69- local stop=`date +%s`
70- local start=${cmd_timestamp:-$stop}
71- let local elapsed=$stop-$start
72- [ $elapsed -gt 5 ] && echo ${elapsed}s
73-}
74-
75-# Get the initial timestamp for cmd_exec_time
76-#
77-preexec() {
78- cmd_timestamp=`date +%s`
79-}
80-
81-# Output additional information about paths, repos and exec time
82-#
83-precmd() {
84- vcs_info # Get version control info before we start outputting stuff
85- print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f"
86-}
87-
88-# Define prompts
89-#
90-PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure
91-RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH
92-
93-# ------------------------------------------------------------------------------
94-#
95-# List of vcs_info format strings:
96-#
97-# %b => current branch
98-# %a => current action (rebase/merge)
99-# %s => current version control system
100-# %r => name of the root directory of the repository
101-# %S => current path relative to the repository root directory
102-# %m => in case of Git, show information about stashes
103-# %u => show unstaged changes in the repository
104-# %c => show staged changes in the repository
105diff --git a/themes/refined.zsh-theme b/themes/refined.zsh-theme
106new file mode 100644
107index 0000000000000000000000000000000000000000..0e5681cc7f887bb0e80f5dd708c6ab85e31c5de1
108--- /dev/null
109+++ b/themes/refined.zsh-theme
110@@ -0,0 +1,106 @@
111+#!/usr/bin/env zsh
112+
113+# ------------------------------------------------------------------------------
114+#
115+# Pure - A minimal and beautiful theme for oh-my-zsh
116+#
117+# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
118+# thanks goes out to him for designing the fantastic Pure prompt in the first
119+# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from
120+# which I've borrowed both some ideas and some actual code. You can find out
121+# more about both of these fantastic two people here:
122+#
123+# Sindre Sorhus
124+# Github: https://github.com/sindresorhus
125+# Twitter: https://twitter.com/sindresorhus
126+#
127+# Julien Nicoulaud
128+# Github: https://github.com/nicoulaj
129+# Twitter: https://twitter.com/nicoulaj
130+#
131+# ------------------------------------------------------------------------------
132+
133+# Set required options
134+#
135+setopt prompt_subst
136+
137+# Load required modules
138+#
139+autoload -Uz vcs_info
140+
141+# Set vcs_info parameters
142+#
143+zstyle ':vcs_info:*' enable hg bzr git
144+zstyle ':vcs_info:*:*' unstagedstr '!'
145+zstyle ':vcs_info:*:*' stagedstr '+'
146+zstyle ':vcs_info:*:*' formats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%%u%c"
147+zstyle ':vcs_info:*:*' actionformats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%u%c (%a)"
148+zstyle ':vcs_info:*:*' nvcsformats "%~" "" ""
149+
150+# Fastest possible way to check if repo is dirty
151+#
152+git_dirty() {
153+ # Check if we're in a git repo
154+ command git rev-parse --is-inside-work-tree &>/dev/null || return
155+ # Check if it's dirty
156+ command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo "*"
157+}
158+
159+# Display information about the current repository
160+#
161+repo_information() {
162+ echo "%F{blue}${vcs_info_msg_0_%%/.} %F{8}$vcs_info_msg_1_`git_dirty` $vcs_info_msg_2_%f"
163+}
164+
165+# Displays the exec time of the last command if set threshold was exceeded
166+#
167+cmd_exec_time() {
168+ local stop=`date +%s`
169+ local start=${cmd_timestamp:-$stop}
170+ let local elapsed=$stop-$start
171+ [ $elapsed -gt 5 ] && echo ${elapsed}s
172+}
173+
174+# Get the initial timestamp for cmd_exec_time
175+#
176+preexec() {
177+ cmd_timestamp=`date +%s`
178+}
179+
180+# Output additional information about paths, repos and exec time
181+#
182+precmd() {
183+ vcs_info # Get version control info before we start outputting stuff
184+ print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f"
185+}
186+
187+# Define prompts
188+#
189+PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure
190+RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH
191+
192+# ------------------------------------------------------------------------------
193+#
194+# List of vcs_info format strings:
195+#
196+# %b => current branch
197+# %a => current action (rebase/merge)
198+# %s => current version control system
199+# %r => name of the root directory of the repository
200+# %S => current path relative to the repository root directory
201+# %m => in case of Git, show information about stashes
202+# %u => show unstaged changes in the repository
203+# %c => show staged changes in the repository
204+#
205+# List of prompt format strings:
206+#
207+# prompt:
208+# %F => color dict
209+# %f => reset color