Fix notes and add vim pager
This commit is contained in:
parent
5100983350
commit
00e919f7f5
5 changed files with 15 additions and 5 deletions
|
@ -37,6 +37,7 @@
|
|||
pf = push --force-with-lease
|
||||
a = add -A
|
||||
cnv = commit --no-verify
|
||||
canv = commit --no-verify
|
||||
c = commit
|
||||
|
||||
[merge]
|
||||
|
@ -51,11 +52,14 @@
|
|||
|
||||
[pager]
|
||||
branch = false
|
||||
diff = nvim -c 'silent %sm/\\e.\\{-}m//g' -c 'silent %s/^diff/\\r\\rdiff/' -c 'silent set ft=diff' -c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile' -c 'goto 1' -
|
||||
# remove ansi codes, pad each file's diff with newlines, show as diff, remove top padding
|
||||
diff = vimpager -c 'silent %sm/\\e[^mK]*[mK]//g' -c 'silent %s/^diff/\\r\\rdiff/' -c 'silent set ft=diff' -c 'silent execute \"normal gg2dd\"'
|
||||
|
||||
[url "git@github.com:postmates"]
|
||||
insteadOf = https://github.com/postmates
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[gpg]
|
||||
program = gpg2
|
||||
|
|
|
@ -22,11 +22,11 @@ set -U BROWSER firefox-developer-edition
|
|||
set -U ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history
|
||||
|
||||
# set our EDITOR to neovim if we've got it
|
||||
set -U EDITOR vim
|
||||
set -Ux EDITOR vim
|
||||
if has_command nvim
|
||||
alias vim nvim
|
||||
alias ovim 'command vim'
|
||||
set -U EDITOR nvim
|
||||
set -Ux EDITOR nvim
|
||||
end
|
||||
|
||||
# load a per-device config last so anything can be overridden
|
||||
|
|
2
bin/nf
2
bin/nf
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
SUBDIR="${2:-}"
|
||||
SUBDIR="${2:-./}"
|
||||
mkdir -p "$NOTES_PATH/$SUBDIR"
|
||||
"$EDITOR" "$NOTES_PATH/$SUBDIR/$1"
|
||||
|
|
6
bin/vimpager
Executable file
6
bin/vimpager
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
nvim \
|
||||
-c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile' \
|
||||
"$@" \
|
||||
-
|
2
bin/vman
2
bin/vman
|
@ -4,5 +4,5 @@
|
|||
# `asmanviewer` variable, so launch vim that way when using vim as our man
|
||||
# page viewer
|
||||
|
||||
vim --cmd "let asmanviewer=1" -c "SuperMan $*"
|
||||
"$EDITOR" --cmd "let asmanviewer=1" -c "SuperMan $*"
|
||||
[ "$?" != "0" ] && echo "No manual entry for $*" && exit 1
|
||||
|
|
Reference in a new issue