summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-06 18:47:51 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-06 18:47:51 +0200
commitaf22df297aee0e41ad969551c532ecaf518d1d18 (patch)
tree18f1fb9a440212ae63cfb08845453d295b89455b
downloadexrc-af22df297aee0e41ad969551c532ecaf518d1d18.tar.gz
Add git.exrc
-rw-r--r--Makefile10
-rw-r--r--git.exrc6
2 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2938288
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+.PHONY: +git.exrc
+
+install: +git.exrc
+
++git.exrc:
+ install -m 644 git.exrc /usr/local/share/git.exrc
+ @echo ----------------------------------------------------------------------
+ @echo -n You should add
+ @echo \ export GIT_EDITOR=\'vi +:\"so /usr/local/share/git.exrc\"\'
+ @echo to your shell configuration file.
diff --git a/git.exrc b/git.exrc
new file mode 100644
index 0000000..687455c
--- /dev/null
+++ b/git.exrc
@@ -0,0 +1,6 @@
+" cut first committed file to commit message
+map g dd/committed j0dt:dWdd''PA: 
+" convert cut relative file path to absolute
+map q !!perl -MCwd=abs_path -pe 'if (/^(.*?): (.*)$/) { $p = abs_path($1); $p =~ s,.*/,, if $p eq $1; $_ = "$p: $2\n" }' $
+" go to first line
+1