commit 72899940de913efa7913c423b2b628eb7949383c
parent ce27ba670dc67a1560f06f664c4d2abb2e0143e9
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Mon,  4 May 2020 23:18:45 +0200
vim: git root cabbrev
Also make the git alias print without trailing newline.
Former-commit-id: f74df4c7cba40d95693f154d8188085c0eb39753
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/git/gitconfig b/git/gitconfig
@@ -77,7 +77,7 @@
     substatus = submodule status
     subactive = "!git submodule status | grep -v '^-'"
 
-    root = rev-parse --show-toplevel
+    root = !git rev-parse --show-toplevel | tr -d '\n'
 
     edit-changed = "!$EDITOR `git status --porcelain | sed -ne 's/^ M //p'`"
     commit-at = "!f(){\
diff --git a/vim/vimrc b/vim/vimrc
@@ -682,6 +682,7 @@ cnoreabbrev Colors XtermColorTable
 cnoreabbrev lset setl
 cnoreabbrev sudow w !sudo tee > /dev/null %
 cnoreabbrev hg helpgrep
+cnoreabbrev gitr system("git root")
 
 if has('terminal')
   cnoreabbrev tt tab terminal