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

Preview files with ls and bat #18

Merged
merged 11 commits into from
Aug 18, 2020
Merged

Preview files with ls and bat #18

merged 11 commits into from
Aug 18, 2020

Conversation

PatrickF1
Copy link
Owner

@PatrickF1 PatrickF1 commented Aug 17, 2020

If the file is a directory, ls it. If the file is a regular file, bat it. Otherwise, explain that such files cannot be previewed.

@@ -24,5 +24,6 @@ if not set --query FZF_DEFAULT_OPTS
# reverse layout is more familiar as it mimicks the layout of git log, history, and env
# border makes clear where the fzf window ends
# height 75% allows you to view what you were doing and stay in context of your work
set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height 75%'
# preview-window wrap wraps long lines in the preview window
set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height 75% --preview-window=wrap'
Copy link
Owner Author

Choose a reason for hiding this comment

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

Moved --preview-window=wrap here since now, more than one features use fzf previews and this is a sane option for fzf previews.

@@ -10,7 +10,7 @@ function __fzf_search_shell_variables --description "Search and inspect shell va
# __echo_value_or_print_message will print an informative message in lieu of the value.
set variable_name (
set --names |
fzf --preview '__echo_value_or_print_message {}' --preview-window wrap
Copy link
Owner Author

Choose a reason for hiding this comment

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

Consolidated this option into FZF_DEFAULT_OPTS

@PatrickF1 PatrickF1 merged commit 838dd9e into master Aug 18, 2020
@PatrickF1 PatrickF1 deleted the preview-with-bat branch August 18, 2020 15:44
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.

None yet

1 participant