|
@@ -1,29 +1,9 @@
|
|
|
## Set tab title to hostname
|
|
## Set tab title to hostname
|
|
|
print -Pn "\e]1;`hostname | cut -d. -f1`\a"
|
|
print -Pn "\e]1;`hostname | cut -d. -f1`\a"
|
|
|
|
|
|
|
|
-## single line prompt
|
|
|
|
|
-#PROMPT='%{$fg[cyan]%}[%n@%m] %{$fg[yellow]%}%3~ %{$fg[magenta]%}→ %{$reset_color%}'
|
|
|
|
|
-#RPROMPT='$(vi_mode_prompt_info) $(git_prompt_info) %{$reset_color%}%T %{$fg[white]%}%h%{$reset_color%}'
|
|
|
|
|
-
|
|
|
|
|
-# Using precmd instead of having a multiline prompt reduces the number of
|
|
|
|
|
-# `%{` and `%}` escape sequences needed. Actions like changing mode in vi-mode
|
|
|
|
|
-# and using tab completion need the escapes to know the right number of printed
|
|
|
|
|
-# characters in the prompt or rprompt, otherwise, they will offset displayed
|
|
|
|
|
-# characters by too many or too few. The precmd text is just printed text.
|
|
|
|
|
-#
|
|
|
|
|
-# UPDATE: was told that precmd slows things down. Sure enough, after building a
|
|
|
|
|
-# new prompt not based on precmd, found that prompt renders half a second faster
|
|
|
|
|
-# which is much less annoying over prolonged usage. Have moved git status to the
|
|
|
|
|
-# right prompt. Less exciting, but more functional. Drats.
|
|
|
|
|
-#
|
|
|
|
|
-# UPDATE2: have found a modification to the vi-mode plugin that allows for
|
|
|
|
|
-# better catering for multiline prompts, without overwriting history lines.
|
|
|
|
|
-# Refer to custom directory for more details
|
|
|
|
|
-#function precmd() {}
|
|
|
|
|
-
|
|
|
|
|
## multi line prompt
|
|
## multi line prompt
|
|
|
PROMPT='
|
|
PROMPT='
|
|
|
-%{$fg[cyan]%}[%m] %{$fg[yellow]%}%3~ $(git_prompt_info)
|
|
|
|
|
|
|
+%{$fg[cyan]%}[%m] %{$fg[yellow]%}%3~ $(git_prompt_info)
|
|
|
%{$fg[magenta]%}%n → %{$reset_color%}'
|
|
%{$fg[magenta]%}%n → %{$reset_color%}'
|
|
|
RPROMPT='$(vi_mode_prompt_info) %{$reset_color%}%T %{$fg[white]%}%h%{$reset_color%}'
|
|
RPROMPT='$(vi_mode_prompt_info) %{$reset_color%}%T %{$fg[white]%}%h%{$reset_color%}'
|
|
|
|
|
|
|
@@ -101,5 +81,5 @@ git_prompt_status() {
|
|
|
## also, the built-in function cannot cope with non-ssh repos because it relies
|
|
## also, the built-in function cannot cope with non-ssh repos because it relies
|
|
|
## on there being a ':' before the repo name
|
|
## on there being a ':' before the repo name
|
|
|
function current_repository() {
|
|
function current_repository() {
|
|
|
- echo $(git remote -v | head -1 | grep -o '[^/]*\.git' | sed 's/.git//')
|
|
|
|
|
|
|
+ echo $(git remote -v | head -1 | grep -o '[^/]*\.git' | sed 's/\.git//')
|
|
|
}
|
|
}
|