fish: functions/gl: Pipe commit view to bat
The recent tui changes to neovim cause some display issue after exiting from it. We need to provide the --pager option to bat for not exiting immediately if the output size is smaller than the vertical size of the terminal. See the --pager documentation in man bat. We use less -R instead of the default less -RF.
This commit is contained in:
parent
674409573b
commit
ec838cb54e
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ function gl --description 'Git browse commits'
|
||||||
git log --color=always --format='%C(auto)%h%d %s %C(green)%C(bold)%cr% C(blue)%an' $argv | fzf --exact --no-sort --reverse --tiebreak=index --no-multi --ansi \
|
git log --color=always --format='%C(auto)%h%d %s %C(green)%C(bold)%cr% C(blue)%an' $argv | fzf --exact --no-sort --reverse --tiebreak=index --no-multi --ansi \
|
||||||
--preview="$view_commit" \
|
--preview="$view_commit" \
|
||||||
--header="ENTER to view, CTRL-Y to copy hash, CTRL-O to open on GitHub, CTRL-X to checkout, CTRL-C to exit, CTRL-S to cherry-pick" \
|
--header="ENTER to view, CTRL-Y to copy hash, CTRL-O to open on GitHub, CTRL-X to checkout, CTRL-C to exit, CTRL-S to cherry-pick" \
|
||||||
--bind "enter:execute:$view_commit_nvim | nvim -R -" \
|
--bind "enter:execute:$view_commit_nvim | bat -ldiff --pager 'less -R'" \
|
||||||
--bind "ctrl-y:execute:$copy_commit_hash" \
|
--bind "ctrl-y:execute:$copy_commit_hash" \
|
||||||
--bind "ctrl-x:execute:$git_checkout" \
|
--bind "ctrl-x:execute:$git_checkout" \
|
||||||
--bind "ctrl-o:execute:$github_open" \
|
--bind "ctrl-o:execute:$github_open" \
|
||||||
|
|
Loading…
Reference in a new issue