diff options
-rw-r--r-- | .aliases | 3 | ||||
-rw-r--r-- | .functions | 18 |
2 files changed, 21 insertions, 0 deletions
@@ -7,6 +7,9 @@ alias nb='cd ~/journals; vim index.md; cd -' alias todo='cd ~/journals; vim gtd.md; cd -' alias vimg='vim +Git +only' +alias gmf='git diff --merge-base' +alias gmfn='git diff --merge-base --name-only' + if [ -f /usr/bin/pacman ]; then alias S='pacman -S' alias Si='pacman -Si' @@ -9,3 +9,21 @@ open () { echo "No usable program is found" fi } + +greview () { + usage='usage: greview <base_branch>' + if [ $# -lt 1 ]; then + echo $usage + return + fi + + base_branch=$1 + # vim -p $(git diff --merge-base --name-only $base_branch) \ + # "+tabdo Gvdiff $base_branch" \ + # "+nmap <C-j> :tabnext<CR>" \ + # "+nmap <C-k> :tabpreivous<CR>" + + vim $(git diff --merge-base --name-only $base_branch) \ + "+nmap <leader>gd :Gvdiffsplit $base_branch<CR>" + +} |