-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use bat to view directory #1156
Labels
feature-request
New feature or request
Comments
KSXGitHub
changed the title
Feature Request: Use bat to view directory
Use bat to view directory
Aug 27, 2020
You could write a bash function if you really want this unusual behaviour. |
@eggbean |
@KSXGitHub Thank you for your feedback, but this is probably not going to happen. As @eggbean suggest, I think this would be a good fit for a wrapper script / shell function. |
If someone want ready-to-use bash script please check this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
When using terminal, I have a habit of pressing UP arrow and edit the previous command.
Currently, I have to use 2 different commands to view directory and file. It is very cumbersome when I have to change "ls" part of the previous command to "bat" to view a file.
So I think that it would be very helpful if
bat
can just display content of a directory.Suggestion
Add a flag called
--dir-viewer
that takes a command. For example:bat --dir-viewer='ls -A --color=always' file1 file2 dir1 dir2 file3 dir3
The above command would:
file1
.file2
.ls -A --color=always dir1
and display output that fits within decoration frame as if it was content of a file.ls -A --color=always dir2
and display output that fits within decoration frame as if it was content of a file.file3
.ls -A --color=always dir3
and display output that fits within decoration frame as if it was content of a file.The text was updated successfully, but these errors were encountered: