Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add preview window toggle from @u1and0
ping @u1and0 thank you for the PR -- i will surely accept it after testing please rebase - | # to cleanly redo changeset | git clone git@github.com:u1and0/fzf-extras.git | cd fzf-extras | git remote add upstream https://github.com/atweiden/fzf-extras | git fetch upstream | git diff upstream/master > ~/Documents/preview-window-toggle.diff | | # wipe repo | cd .. | rm -rf fzf-extras | | # re-fork atweiden/fzf-extras to your github account | | # assuming the fresh fork is at u1and0/fzf-extras-dev | # clone fresh fork | git clone git@github.com:u1and0/fzf-extras-dev.git | cd fzf-extras-dev | | # apply changes to local branch | git checkout -b preview-window-toggle | git apply ~/Documents/preview-window-toggle.diff | git commit | | # create new pull request at atweiden/fzf-extras from | # u1and0/fzf-extras-dev if you can't rebase or don't want to rebase - i can use this branch which includes your changes - but github does not list you as "contributor" that way i have made two small changes: - chmod -x fzf-extras.sh - files should be distributed as 644 - test for `bat` before `pygmentize` - because - my preference is for *bat* > *pygmentize* - but either way would be fine also i corrected spelling errors in your comment ```diff diff --git c/fzf-extras.sh w/fzf-extras.sh index 03455e3..cb1e986 100755 --- c/fzf-extras.sh +++ w/fzf-extras.sh @@ -5,10 +5,10 @@ # ----------------------------------------------------------------------------- # fzf --preview command for file and directory -if type pygmentize >/dev/null 2>&1; then - FZF_PREVIEW_CMD='head -n $FZF_PREVIEW_LINES {} | pygmentize -g' -elif type bat >/dev/null 2>&1; then +if type bat >/dev/null 2>&1; then FZF_PREVIEW_CMD='bat --color=always --plain --line-range :$FZF_PREVIEW_LINES {}' +elif type pygmentize >/dev/null 2>&1; then + FZF_PREVIEW_CMD='head -n $FZF_PREVIEW_LINES {} | pygmentize -g' else FZF_PREVIEW_CMD='head -n $FZF_PREVIEW_LINES {}' fi @@ -85,7 +85,7 @@ zst() { --bind=ctrl-x:toggle-sort \ --header='<C-V> toggle preview <C-X> toggle sort' \ )" - # check $dir exist for Ctrl-C interrapt + # check $dir exists for Ctrl-C interrupt # or change directory to $HOME (= no value cd) if [[ -d "$dir" ]]; then cd "$dir" || return ``` /* vim: set filetype=finn */
- Loading branch information