瀏覽代碼

fix git repo name logic to remove '.git' properly

Weiyi Lou 13 年之前
父節點
當前提交
b2bc969461
共有 2 個文件被更改,包括 3 次插入23 次删除
  1. 1 1
      vim/bundle/fugitive
  2. 2 22
      zsh/omz-custom/cinaeco.zsh-theme

+ 1 - 1
vim/bundle/fugitive

@@ -1 +1 @@
-Subproject commit b0c74e2289a1c1617a6446184f6de77b88750133
+Subproject commit 0abe1fb12232abe5b7bdfa4d244f04faf3450ba3

+ 2 - 22
zsh/omz-custom/cinaeco.zsh-theme

@@ -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//')
 }
 }