[add] a better git log.
I completely stole this from Gary Bernhardt. But it's a start.
This commit is contained in:
parent
910847c3b1
commit
8f13108ece
5 changed files with 505 additions and 0 deletions
58
bin/max-git-log
Executable file
58
bin/max-git-log
Executable file
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Log output:
|
||||||
|
#
|
||||||
|
# * 51c333e (12 days) <Gary Bernhardt> add vim-eunuch
|
||||||
|
#
|
||||||
|
# The time massaging regexes start with ^[^<]* because that ensures that they
|
||||||
|
# only operate before the first "<". That "<" will be the beginning of the
|
||||||
|
# author name, ensuring that we don't destroy anything in the commit message
|
||||||
|
# that looks like time.
|
||||||
|
#
|
||||||
|
# The log format uses } characters between each field, and `column` is later
|
||||||
|
# used to split on them. A } in the commit subject or any other field will
|
||||||
|
# break this.
|
||||||
|
|
||||||
|
HASH="%C(yellow)%h%Creset"
|
||||||
|
RELATIVE_TIME="%Cgreen(%ar)%Creset"
|
||||||
|
AUTHOR="%C(bold blue)<%an>%Creset"
|
||||||
|
REFS="%C(bold red)%d%Creset"
|
||||||
|
SUBJECT="%s"
|
||||||
|
|
||||||
|
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
|
||||||
|
|
||||||
|
ANSI_BLACK='\033[30m'
|
||||||
|
ANSI_BLACK_BOLD='\033[0;30;1m'
|
||||||
|
ANSI_RED='\033[31m'
|
||||||
|
ANSI_RED_BOLD='\033[0;31;1m'
|
||||||
|
ANSI_GREEN='\033[32m'
|
||||||
|
ANSI_GREEN_BOLD='\033[0;32;1m'
|
||||||
|
ANSI_YELLOW='\033[33m'
|
||||||
|
ANSI_YELLOW_BOLD='\033[0;33;1m'
|
||||||
|
ANSI_BLUE='\033[34m'
|
||||||
|
ANSI_BLUE_BOLD='\033[0;34;1m'
|
||||||
|
ANSI_MAGENTA='\033[35m'
|
||||||
|
ANSI_MAGENTA_BOLD='\033[0;35;1m'
|
||||||
|
ANSI_CYAN='\033[36m'
|
||||||
|
ANSI_CYAN_BOLD='\033[0;36;1m'
|
||||||
|
ANSI_WHITE='\033[37m'
|
||||||
|
ANSI_WHITE_BOLD='\033[0;37;1m'
|
||||||
|
ANSI_RESET='\033[0m'
|
||||||
|
|
||||||
|
git log --graph --pretty="tformat:${FORMAT}" $* |
|
||||||
|
# Replace (2 years ago) with (2 years)
|
||||||
|
sed -Ee 's/(^[^<]*) ago\)/\1)/' |
|
||||||
|
# Replace (2 years, 5 months) with (2 years)
|
||||||
|
sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' |
|
||||||
|
# Line columns up based on } delimiter
|
||||||
|
column -s '}' -t |
|
||||||
|
# Color merge commits specially
|
||||||
|
sed -Ee "s/(Merge (branch|remote-tracking branch|pull request) .*$)/$(printf $ANSI_RED)\1$(printf $ANSI_RESET)/" |
|
||||||
|
# Page only if we're asked to.
|
||||||
|
if [ -n "$GIT_NO_PAGER" ]; then
|
||||||
|
cat
|
||||||
|
else
|
||||||
|
# Page only if needed.
|
||||||
|
less --quit-if-one-screen --no-init --RAW-CONTROL-CHARS --chop-long-lines
|
||||||
|
fi
|
||||||
|
|
386
fish/fish_history
Normal file
386
fish/fish_history
Normal file
|
@ -0,0 +1,386 @@
|
||||||
|
- cmd: cd ~/.config
|
||||||
|
when: 1413665866
|
||||||
|
- cmd: ls hum
|
||||||
|
when: 1413665871
|
||||||
|
- cmd: ls hub
|
||||||
|
when: 1413665875
|
||||||
|
paths:
|
||||||
|
- hub
|
||||||
|
- cmd: cd hub
|
||||||
|
when: 1413665879
|
||||||
|
paths:
|
||||||
|
- hub
|
||||||
|
- cmd: cat hub
|
||||||
|
when: 1413665881
|
||||||
|
paths:
|
||||||
|
- hub
|
||||||
|
- cmd: ls configstore/
|
||||||
|
when: 1413666583
|
||||||
|
paths:
|
||||||
|
- configstore/
|
||||||
|
- cmd: rm -rf .config
|
||||||
|
when: 1413666595
|
||||||
|
paths:
|
||||||
|
- .config
|
||||||
|
- cmd: mv dotfiles/ .config
|
||||||
|
when: 1413666604
|
||||||
|
paths:
|
||||||
|
- dotfiles/
|
||||||
|
- cmd: cat ~/.vimrc
|
||||||
|
when: 1413666688
|
||||||
|
- cmd: ls vim/
|
||||||
|
when: 1413666726
|
||||||
|
paths:
|
||||||
|
- vim/
|
||||||
|
- cmd: vim script/bootstrap.sh
|
||||||
|
when: 1413666756
|
||||||
|
paths:
|
||||||
|
- vim
|
||||||
|
- script/bootstrap.sh
|
||||||
|
- cmd: ./script/bootstrap.sh
|
||||||
|
when: 1413666758
|
||||||
|
paths:
|
||||||
|
- ./script/bootstrap.sh
|
||||||
|
- cmd: env fish
|
||||||
|
when: 1413715454
|
||||||
|
paths:
|
||||||
|
- fish
|
||||||
|
- cmd: cd .config
|
||||||
|
when: 1413715482
|
||||||
|
paths:
|
||||||
|
- .config
|
||||||
|
- cmd: mkdir bin
|
||||||
|
when: 1413715485
|
||||||
|
- cmd: mv fish/functions/* bin/
|
||||||
|
when: 1413715492
|
||||||
|
paths:
|
||||||
|
- bin/
|
||||||
|
- cmd: ls -lah
|
||||||
|
when: 1413715498
|
||||||
|
- cmd: cd fish/
|
||||||
|
when: 1413715516
|
||||||
|
paths:
|
||||||
|
- fish/
|
||||||
|
- cmd: cd functions/
|
||||||
|
when: 1413715518
|
||||||
|
paths:
|
||||||
|
- functions/
|
||||||
|
- cmd: ls alh
|
||||||
|
when: 1413715522
|
||||||
|
- cmd: ls fish/
|
||||||
|
when: 1413715551
|
||||||
|
- cmd: mv pretty_git_log.fish ../bin/
|
||||||
|
when: 1413715568
|
||||||
|
paths:
|
||||||
|
- pretty_git_log.fish
|
||||||
|
- ../bin/
|
||||||
|
- cmd: cd ../bin
|
||||||
|
when: 1413715570
|
||||||
|
paths:
|
||||||
|
- ../bin
|
||||||
|
- cmd: chmod u+x *.fish
|
||||||
|
when: 1413715592
|
||||||
|
- cmd: cat /etc/group
|
||||||
|
when: 1413715616
|
||||||
|
paths:
|
||||||
|
- /etc/group
|
||||||
|
- cmd: mv pretty_git_log.fish pretty_git_log
|
||||||
|
when: 1413715711
|
||||||
|
paths:
|
||||||
|
- pretty_git_log.fish
|
||||||
|
- cmd: vim pretty_git_log
|
||||||
|
when: 1413715737
|
||||||
|
paths:
|
||||||
|
- pretty_git_log
|
||||||
|
- cmd: pretty_git_log
|
||||||
|
when: 1413715739
|
||||||
|
- cmd: mv fish_prompt.fish ~/.config/fish/functions/
|
||||||
|
when: 1413715746
|
||||||
|
paths:
|
||||||
|
- fish_prompt.fish
|
||||||
|
- cmd: pretty_git_log
|
||||||
|
when: 1413715752
|
||||||
|
- cmd: cd bin
|
||||||
|
when: 1413715759
|
||||||
|
paths:
|
||||||
|
- bin
|
||||||
|
- cmd: mv pretty_git_log max-git-log
|
||||||
|
when: 1413715763
|
||||||
|
paths:
|
||||||
|
- pretty_git_log
|
||||||
|
- cmd: vim git/gitconfig.symlink
|
||||||
|
when: 1413715832
|
||||||
|
paths:
|
||||||
|
- vim
|
||||||
|
- git/gitconfig.symlink
|
||||||
|
- cmd: cd ~/work/redbox/clients/SCR01/projects-screwfix
|
||||||
|
when: 1413723321
|
||||||
|
- cmd: cd vendor/screwfix/theme
|
||||||
|
when: 1413723330
|
||||||
|
paths:
|
||||||
|
- vendor/screwfix/theme
|
||||||
|
- cmd: git ll -3
|
||||||
|
when: 1413723399
|
||||||
|
- cmd: git ll -5
|
||||||
|
when: 1413723464
|
||||||
|
- cmd: git co master
|
||||||
|
when: 1413723513
|
||||||
|
- cmd: git pf
|
||||||
|
when: 1413723519
|
||||||
|
- cmd: clear
|
||||||
|
when: 1413723550
|
||||||
|
- cmd: echo "Hello" | sed -Ee "s/(Merge branch .* into .*)/\\1(set_color normal)/"
|
||||||
|
when: 1413723699
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/\\1(set_color normal)/"
|
||||||
|
when: 1413723713
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/\\1 (set_color normal)/"
|
||||||
|
when: 1413723726
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/\\1 (set_color normal)/" | echo
|
||||||
|
when: 1413723744
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/\\1 (set_color normal)/" | cat
|
||||||
|
when: 1413723748
|
||||||
|
- cmd: echo "abcdcba" | sed -Ee /a/A/
|
||||||
|
when: 1413724105
|
||||||
|
- cmd: echo "abcdcba" | sed -Ee "/a/A/"
|
||||||
|
when: 1413724114
|
||||||
|
- cmd: echo "abcdcba" | sed -Ee "s/a/A/"
|
||||||
|
when: 1413724128
|
||||||
|
- cmd: echo "abcdcba" | sed -Ee "s/a/A/g"
|
||||||
|
when: 1413724131
|
||||||
|
- cmd: eval
|
||||||
|
when: 1413724166
|
||||||
|
- cmd: eval echo "hello"
|
||||||
|
when: 1413724171
|
||||||
|
- cmd: echo "a" | sed -Ee "s/a/(set_color blue) a (set_color normal)/g"
|
||||||
|
when: 1413724208
|
||||||
|
- cmd: echo (echo "a" | sed -Ee "s/a/(set_color blue) a (set_color normal)/g")
|
||||||
|
when: 1413724217
|
||||||
|
- cmd: eval (echo "a" | sed -Ee "s/a/echo -n set_color blue; echo -n a; echo set_color normal;/g")
|
||||||
|
when: 1413724263
|
||||||
|
- cmd: set_color blue
|
||||||
|
when: 1413724269
|
||||||
|
- cmd: vim
|
||||||
|
when: 1413724283
|
||||||
|
- cmd: echo "a" | sed -Ee "s/a/(set_color red)a(set_color normal)/"
|
||||||
|
when: 1413724394
|
||||||
|
- cmd: echo "a" | sed -Ee "s/a/echo (set_color red)a(set_color normal)/"
|
||||||
|
when: 1413724407
|
||||||
|
- cmd: eval (echo "a" | sed -Ee "s/a/echo (set_color red)a(set_color normal)/")
|
||||||
|
when: 1413724420
|
||||||
|
- cmd: eval (echo "Merge branch abc into def" | sed -Ee "s/a/echo (set_color red)a(set_color normal)/")
|
||||||
|
when: 1413724452
|
||||||
|
- cmd: eval (echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/echo (set_color red)\\1(set_color normal)/")
|
||||||
|
when: 1413724482
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/echo (set_color red)\\1(set_color normal)/"
|
||||||
|
when: 1413725338
|
||||||
|
- cmd: brew install sed
|
||||||
|
when: 1413725367
|
||||||
|
- cmd: echo "Merge branch abc into def" | sed -Ee "s/(Merge branch .* into .*)/echo (set_color red)\\1(set_color normal)/e"
|
||||||
|
when: 1413725452
|
||||||
|
- cmd: man sed
|
||||||
|
when: 1413725476
|
||||||
|
- cmd: sed -h
|
||||||
|
when: 1413725484
|
||||||
|
- cmd: brew search sed
|
||||||
|
when: 1413725570
|
||||||
|
- cmd: /usr/bin/sed --version
|
||||||
|
when: 1413725617
|
||||||
|
paths:
|
||||||
|
- /usr/bin/sed
|
||||||
|
- cmd: /usr/bin/sed -v
|
||||||
|
when: 1413725621
|
||||||
|
paths:
|
||||||
|
- /usr/bin/sed
|
||||||
|
- cmd: /usr/bin/sed
|
||||||
|
when: 1413725625
|
||||||
|
paths:
|
||||||
|
- /usr/bin/sed
|
||||||
|
- cmd: which sed
|
||||||
|
when: 1413726607
|
||||||
|
- cmd: brew install gnu-sed
|
||||||
|
when: 1413726616
|
||||||
|
- cmd: cd /usr/local/Cellar/gnu-sed/
|
||||||
|
when: 1413726626
|
||||||
|
paths:
|
||||||
|
- /usr/local/Cellar/gnu-sed/
|
||||||
|
- cmd: cd 4.2.2/
|
||||||
|
when: 1413726628
|
||||||
|
paths:
|
||||||
|
- 4.2.2/
|
||||||
|
- cmd: cd bin/
|
||||||
|
when: 1413726631
|
||||||
|
paths:
|
||||||
|
- bin/
|
||||||
|
- cmd: echo "Merge branch abc into def" | gsed -Ee "s/(Merge branch .* into .*)/echo (set_color red)\\1(set_color normal)/e"
|
||||||
|
when: 1413726651
|
||||||
|
- cmd: bash echo "hello"
|
||||||
|
when: 1413726689
|
||||||
|
- cmd: man bash
|
||||||
|
when: 1413726701
|
||||||
|
- cmd: man fish
|
||||||
|
when: 1413726706
|
||||||
|
- cmd: echo "Merge branch abc into def" | gsed -Ee "s/(Merge branch .* into .*)/fish --command=\\"echo (set_color red)\\1(set_color normal)\\"/e"
|
||||||
|
when: 1413726735
|
||||||
|
- cmd: vim ~/.config/fish/functions/fish_prompt.fish
|
||||||
|
when: 1413740877
|
||||||
|
- cmd: vagrant ssh
|
||||||
|
when: 1413740887
|
||||||
|
- cmd: man caffeinate
|
||||||
|
when: 1413749220
|
||||||
|
- cmd: caffeinate
|
||||||
|
when: 1413755313
|
||||||
|
- cmd: which max-git-log
|
||||||
|
when: 1413755415
|
||||||
|
- cmd: echo (set_color yellow)
|
||||||
|
when: 1413755783
|
||||||
|
- cmd: man set_color
|
||||||
|
when: 1413755789
|
||||||
|
- cmd: set_color -d
|
||||||
|
when: 1413755794
|
||||||
|
- cmd: set_color -h
|
||||||
|
when: 1413755797
|
||||||
|
- cmd: set_color -c
|
||||||
|
when: 1413755863
|
||||||
|
- cmd: set_color -c | gsed -Ee 's/.*/set_color &; echo &; set_color normal/e'
|
||||||
|
when: 1413755934
|
||||||
|
- cmd: set_color -c | gsed -Ee 's/.*/fish --command="set_color &; echo &; set_color normal"/e'
|
||||||
|
when: 1413755950
|
||||||
|
- cmd: set_color -c | gsed -Ee 's/.*/fish --command="set_color &; echo -n &; set_color normal"/e'
|
||||||
|
when: 1413755963
|
||||||
|
- cmd: cd ~/.config/bin
|
||||||
|
when: 1413765912
|
||||||
|
- cmd: ls
|
||||||
|
when: 1413765913
|
||||||
|
- cmd: vim ~/.config/bin/max-git-log
|
||||||
|
when: 1413765925
|
||||||
|
- cmd: pbpaste > max-git-log
|
||||||
|
when: 1413765932
|
||||||
|
paths:
|
||||||
|
- max-git-log
|
||||||
|
- cmd: git ll
|
||||||
|
when: 1413765998
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: cd ~/work/redbox/clients/SCR01/projects-screwfix/vendor/screwfix/theme
|
||||||
|
when: 1413766009
|
||||||
|
- cmd: git l
|
||||||
|
when: 1413766010
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: vim max-git-log
|
||||||
|
when: 1413766038
|
||||||
|
paths:
|
||||||
|
- max-git-log
|
||||||
|
- cmd: cd ..
|
||||||
|
when: 1413766039
|
||||||
|
paths:
|
||||||
|
- ..
|
||||||
|
- cmd: git co -- script/bootstrap.sh
|
||||||
|
when: 1413766062
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- script/bootstrap.sh
|
||||||
|
- cmd: git add .gitignore
|
||||||
|
when: 1413766104
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- .gitignore
|
||||||
|
- cmd: ls -alh
|
||||||
|
when: 1413766115
|
||||||
|
- cmd: cat .gitconfig/
|
||||||
|
when: 1413766118
|
||||||
|
paths:
|
||||||
|
- .gitconfig/
|
||||||
|
- cmd: ls .gitconfig/
|
||||||
|
when: 1413766124
|
||||||
|
paths:
|
||||||
|
- .gitconfig/
|
||||||
|
- cmd: rmdir .gitconfig/
|
||||||
|
when: 1413766129
|
||||||
|
paths:
|
||||||
|
- .gitconfig/
|
||||||
|
- cmd: vim .gitignore
|
||||||
|
when: 1413766144
|
||||||
|
paths:
|
||||||
|
- vim
|
||||||
|
- cmd: git add bin/
|
||||||
|
when: 1413766146
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- bin/
|
||||||
|
- cmd: vim .gitignore
|
||||||
|
when: 1413766169
|
||||||
|
paths:
|
||||||
|
- vim
|
||||||
|
- .gitignore
|
||||||
|
- cmd: rm .gitignore
|
||||||
|
when: 1413766172
|
||||||
|
paths:
|
||||||
|
- .gitignore
|
||||||
|
- cmd: git rm .gitignore
|
||||||
|
when: 1413766178
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git st
|
||||||
|
when: 1413766181
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git di
|
||||||
|
when: 1413766186
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git add -p
|
||||||
|
when: 1413766205
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: tree
|
||||||
|
when: 1413766235
|
||||||
|
- cmd: cd fish
|
||||||
|
when: 1413766240
|
||||||
|
paths:
|
||||||
|
- fish
|
||||||
|
- cmd: tree
|
||||||
|
when: 1413766242
|
||||||
|
- cmd: vim config.fish
|
||||||
|
when: 1413766259
|
||||||
|
paths:
|
||||||
|
- config.fish
|
||||||
|
- cmd: git add config.fish
|
||||||
|
when: 1413766264
|
||||||
|
paths:
|
||||||
|
- config.fish
|
||||||
|
- cmd: git add -e
|
||||||
|
when: 1413766271
|
||||||
|
- cmd: git st
|
||||||
|
when: 1413766272
|
||||||
|
- cmd: git add -e
|
||||||
|
when: 1413766278
|
||||||
|
- cmd: cd ..
|
||||||
|
when: 1413766281
|
||||||
|
paths:
|
||||||
|
- ..
|
||||||
|
- cmd: git add -e
|
||||||
|
when: 1413766283
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git st
|
||||||
|
when: 1413766285
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git reset git
|
||||||
|
when: 1413766291
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- git
|
||||||
|
- cmd: git ci
|
||||||
|
when: 1413766318
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git st
|
||||||
|
when: 1413766321
|
||||||
|
paths:
|
||||||
|
- git
|
||||||
|
- cmd: git di
|
||||||
|
when: 1413766326
|
||||||
|
paths:
|
||||||
|
- git
|
30
fish/fishd.3c15c2b71b06
Normal file
30
fish/fishd.3c15c2b71b06
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# This file is automatically generated by the fishd universal variable daemon.
|
||||||
|
# Do NOT edit it directly, your changes will be overwritten.
|
||||||
|
SET __fish_init_1_22_0:\x1d
|
||||||
|
SET __fish_init_1_50_0:\x1d
|
||||||
|
SET __prompt_initialized_2:\x1d
|
||||||
|
SET fish_color_autosuggestion:555\x1eyellow
|
||||||
|
SET fish_color_command:005fd7
|
||||||
|
SET fish_color_comment:red
|
||||||
|
SET fish_color_cwd:green
|
||||||
|
SET fish_color_cwd_root:red
|
||||||
|
SET fish_color_error:red\x1e\x2d\x2dbold
|
||||||
|
SET fish_color_escape:cyan
|
||||||
|
SET fish_color_history_current:cyan
|
||||||
|
SET fish_color_host:\x2do\x1ecyan
|
||||||
|
SET fish_color_match:cyan
|
||||||
|
SET fish_color_normal:normal
|
||||||
|
SET fish_color_operator:cyan
|
||||||
|
SET fish_color_param:00afff\x1ecyan
|
||||||
|
SET fish_color_quote:brown
|
||||||
|
SET fish_color_redirection:normal
|
||||||
|
SET fish_color_search_match:\x2d\x2dbackground\x3dpurple
|
||||||
|
SET fish_color_status:red
|
||||||
|
SET fish_color_user:\x2do\x1egreen
|
||||||
|
SET fish_color_valid_path:\x2d\x2dunderline
|
||||||
|
SET fish_greeting:\x1d
|
||||||
|
SET fish_key_bindings:fish\x5fdefault\x5fkey\x5fbindings
|
||||||
|
SET fish_pager_color_completion:normal
|
||||||
|
SET fish_pager_color_description:555\x1eyellow
|
||||||
|
SET fish_pager_color_prefix:cyan
|
||||||
|
SET fish_pager_color_progress:cyan
|
30
fish/functions/fish_prompt.fish
Executable file
30
fish/functions/fish_prompt.fish
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
|
||||||
|
|
||||||
|
function __fish_prompt_git_branch
|
||||||
|
set __git_branch (git current-branch ^ /dev/null)
|
||||||
|
|
||||||
|
if test -z $__git_branch
|
||||||
|
return
|
||||||
|
else if test $__git_branch = HEAD
|
||||||
|
set __rev (git log -1 --oneline ^ /dev/null)
|
||||||
|
if not test -z $__rev
|
||||||
|
echo -n (git log -1 --oneline | cut -d " " -f 1)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
echo -n $__git_branch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_prompt
|
||||||
|
if test (whoami) = root; set_color red; else; set_color black; end
|
||||||
|
echo -n (set_color yellow)(whoami)(set_color black)@(set_color blue)(hostname)(set_color black)
|
||||||
|
|
||||||
|
echo -n ' in' (set_color red)(pwd | rev | cut -d "/" -f 1 | rev)(set_color black)
|
||||||
|
|
||||||
|
set __prompt_branch (__fish_prompt_git_branch)
|
||||||
|
if not test -z $__prompt_branch; echo -n \((set_color green)$__prompt_branch(set_color black)\); end
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo -n '→' (set_color normal)
|
||||||
|
|
||||||
|
end
|
|
@ -20,6 +20,7 @@
|
||||||
co = checkout
|
co = checkout
|
||||||
current-branch = rev-parse --abbrev-ref HEAD
|
current-branch = rev-parse --abbrev-ref HEAD
|
||||||
cl = clone
|
cl = clone
|
||||||
|
ll = !max-git-log
|
||||||
|
|
||||||
[color]
|
[color]
|
||||||
ui = auto
|
ui = auto
|
||||||
|
|
Loading…
Add table
Reference in a new issue