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

feat: add eza completions #870

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions custom-completions/eza/eza-completions.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
def "nu-complete eza when" [] {
[[value]; ["always"] ["auto"] ["never"]]
}

def "nu-complete eza sort-field" [] {
# name, Name, size, extension, Extension, modified, changed, accessed, created, inode, type, none
[[value]; ["name"] ["Name"] ["extension"] ["Extension"] ["size"] ["type"] ["modified"] ["accessed"] ["created"] ["inode"] ["none"] ["date"] ["time"] ["old"] ["new"]]
}

def "nu-complete eza time-field" [] {
# modified, accessed, created, changed
[[value]; ["modified"] ["accessed"] ["created"] ["changed"]]
}

def "nu-complete eza time-style" [] {
[[value]; ["default"] ["iso"] ["long-iso"] ["full-iso"] ["relative"] ["+<FORMAT>"]]
}

def "nu-complete eza color-scale" [] {
[[value]; ["all"] ["age"] ["size"]]
}

def "nu-complete eza color-scale-mode" [] {
[[value]; ["fixed"] ["gradient"]]
}

# A modern, maintained replacement for ls
export extern "eza" [
--help # show list of command-line options
--version(-v) # show version of eza
--oneline(-1) # display one entry per line
--long(-l) # display extended file metadata as a table
--grid(-G) # display entries as a grid (default)
--across(-x) # sort the grid across, rather than downwards
--recurse(-R) # recurse into directories
--tree(-T) # recurse into directories as a tree
--dereference(-X) # dereference symbolic links when displaying information
--classify(-F): string@"nu-complete eza when"="auto" # display type indicator by file names
--colour: string@"nu-complete eza when"="auto" # when to use terminal colours
--color: string@"nu-complete eza when"="auto" # when to use terminal colors
--colour-scale: string@"nu-complete eza color-scale"="all" # highlight levels of 'field' distinctly
--color-scale: string@"nu-complete eza color-scale"="all" # highlight levels of 'field' distinctly
--colour-scale-mode: string@"nu-complete eza color-scale-mode" # use gradient or fixed colors in --color-scale
--color-scale-mode: string@"nu-complete eza color-scale-mode" # use gradient or fixed colors in --color-scale
--icons: string@"nu-complete eza when"="auto" # when to display icons
--no-quotes # don't quote file names with spaces
--hyperlink # display entries as hyperlinks
--absolute # display entries with their absolute path (on, follow, off)
--width(-w): int # set screen width in columns
--all(-a) # show hidden and 'dot' files. Use this twice to also show the '.' and '..' directories
--almost-all(-A) # equivalent to --all; included for compatibility with `ls -A`
--list-dirs(-d) # list directories as files; don't list their contents
--level(-L): int # limit the depth of recursion
--reverse(-r) # reverse the sort order
--sort(-s): string@"nu-complete eza sort-field" # which field to sort by
--group-directories-first # list directories before other files
--only-dirs(-D) # list only directories
--only-files(-f) # list only files
--ignore-glob(-I): string # glob patterns (pipe-separated) of files to ignore
--git-ignore # ignore files mentioned in '.gitignore'
--binary(-b) # list file sizes with binary prefixes
--bytes(-B) # list file sizes in bytes, without any prefixes
--group(-g) # list each file's group
--smart-group # only show group if it has a different name from owner
--header(-h) # add a header row to each column
--links(-H) # list each file's number of hard links
--inode(-i) # list each file's inode number
--modified(-m) # use the modified timestamp field
--mounts(-M) # show mount details (Linux and Mac only)
--numeric(-n) # list numeric user and group IDs
--flags(-O) # list file flags (Mac, BSD, and Windows only)
--blocksize(-S) # show size of allocated file system blocks
--time(-t): string@"nu-complete eza time-field" # which timestamp field to list
--accessed(-u) # use the accessed timestamp field
--created(-U) # use the created timestamp field
--changed # use the changed timestamp field
--time-style: string@"nu-complete eza time-style" # how to format timestamps (also a custom style '+<FORMAT>' like '+%Y-%m-%d %H:%M')
--total-size # show the size of a directory as the size of all files and directories inside (unix only)
--no-permissions # suppress the permissions field
--octal-permissions(-o) # list each file's permission in octal format
--no-filesize # suppress the filesize field
--no-user # suppress the user field
--no-time # suppress the time field
--stdin # read file names from stdin
--git # list each file's Git status, if tracked or ignored
--no-git # suppress Git status
--git-repos # list root of git-tree status
--extended(-@) # list each file's extended attributes and sizes
--context(-Z) # list each file's security context
]
5 changes: 5 additions & 0 deletions custom-completions/eza/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# eza

eza is a modern, maintained replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.

[eza-community/eza: A modern, maintained replacement for ls](https://github.com/eza-community/eza)