Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preview directory command configurable #120

Merged
merged 6 commits into from
Feb 6, 2021
Merged

Conversation

PatrickF1
Copy link
Owner

@PatrickF1 PatrickF1 commented Feb 6, 2021

To acquiesce to the popularity and diversity of ls alternatives (e.g. https://github.com/ogham/exa, https://github.com/Peltoche/lsd, https://github.com/athityakumar/colorls, tree, all of which have many different options to configure them), I have finally decided to make the command used to preview directories configurable. Users can place their desired command in fzf_preview_dir_cmd and fzf.fish will use it.

Related to #117 and #101

@@ -3,8 +3,13 @@ function __fzf_preview_file --argument-names file_path --description "Print a pr
if test -f "$file_path" # regular file
bat --style=numbers --color=always "$file_path"
else if test -d "$file_path" # directory
set --local CLICOLOR_FORCE true
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't working and I couldn't figure out a way to pass in CLICOLOR_FORCE while still using command to execute ls (which is necessary when people have ls aliased to something else), so I am removing it. Hopefully, passing in the additional -F will compensate a bit for the lack of colors.

@PatrickF1 PatrickF1 merged commit d798bce into main Feb 6, 2021
@PatrickF1 PatrickF1 deleted the config-preview-dir branch February 6, 2021 23:36
hrshtst pushed a commit to hrshtst/fzf.fish that referenced this pull request Apr 22, 2021
To acquiesce to the popularity and diversity of ls alternatives (e.g. https://github.com/ogham/exa, https://github.com/Peltoche/lsd, https://github.com/athityakumar/colorls, tree, all of which have many different options to configure them), I have finally decided to make the command used to preview directories configurable. Users can place their desired command in fzf_preview_dir_cmd and fzf.fish will use it.

Related to PatrickF1#117 and PatrickF1#101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant