]> arthur.barton.de Git - OhMyZshExtensions.git/commitdiff
Initial commit
authorAlexander Barton <alex@barton.de>
Sat, 14 Mar 2015 13:07:40 +0000 (14:07 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 14 Mar 2015 13:07:40 +0000 (14:07 +0100)
.gitignore [new file with mode: 0644]
alex.zsh-theme [new file with mode: 0644]
plugins/ssh/ssh.plugin.zsh [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..6eacc5f
--- /dev/null
@@ -0,0 +1,2 @@
+example.zsh
+plugins/example/
diff --git a/alex.zsh-theme b/alex.zsh-theme
new file mode 100644 (file)
index 0000000..0c08595
--- /dev/null
@@ -0,0 +1,35 @@
+# Alex "oh my ZSH" theme
+# Based on the "Sunrise" theme, thanks!
+# 2015-03-08, alex@barton.de
+
+# Color shortcuts; %B sets bold text
+B=$fg_no_bold[blue]
+C=$fg_no_bold[cyan]
+G=$fg_no_bold[green]
+M=$fg_no_bold[magenta]
+R=$fg_no_bold[red]
+Y=$fg_no_bold[yellow]
+RESET=$reset_color
+
+[ "$UID" -eq 0 ] \
+       && PREFIX="%B%{$R%}-!-%{$RESET%} " \
+       || PREFIX=""
+
+ZSH_THEME_GIT_PROMPT_PREFIX="(%{$Y%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$RESET%}) "
+
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$G%}✔"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}✘"
+ZSH_THEME_GIT_PROMPT_AHEAD="%{$C%}➔"
+
+function custom_git_prompt() {
+       ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+       echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/} $(parse_git_dirty)$(git_prompt_ahead)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
+
+PROMPT='${PREFIX}%B%2~%b $(custom_git_prompt)%{$G%}%B$%b%{$RESET%} '
+RPS1="${return_code}"
+
+unset LSCOLORS
diff --git a/plugins/ssh/ssh.plugin.zsh b/plugins/ssh/ssh.plugin.zsh
new file mode 100644 (file)
index 0000000..b84f4b7
--- /dev/null
@@ -0,0 +1,12 @@
+# ssh.plugin.zsh
+# 2015-03-10, alex@barton.de
+
+sshnew ()
+{
+    ssh -o "StrictHostKeyChecking no" "$@"
+}
+
+sshtmp ()
+{
+    ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "$@"
+}