Skip to content

Commit fbab343

Browse files
authored
feat: Add lsd completions. (#1242)
Add [lsd](https://github.com/lsd-rs/lsd) completions for nushell.
1 parent 1b8c6ef commit fbab343

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

custom-completions/lsd/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# lsd completions
2+
3+
Completions for [lsd](https://github.com/lsd-rs/lsd).
4+
5+
LSD (LSDeluxe) is a cross-platform rewrite of GNU ls, built in Rust with lots of added features like colors, icons, tree-view, more formatting options etc.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# From original "lsd --help"
2+
3+
def "nu-complete lsd color" [] {
4+
["always", "auto", "never"]
5+
}
6+
7+
def "nu-complete lsd icon" [] {
8+
["always", "auto", "never"]
9+
}
10+
11+
def "nu-complete lsd icon-theme" [] {
12+
["fancy", "unicode"]
13+
}
14+
15+
def "nu-complete lsd permission" [] {
16+
["rwx", "octal", "attributes", "disable"]
17+
}
18+
19+
def "nu-complete lsd size" [] {
20+
["default", "short", "bytes"]
21+
}
22+
23+
def "nu-complete lsd date" [] {
24+
[date, locale, relative, +date-time-format]
25+
}
26+
27+
def "nu-complete lsd sort" [] {
28+
["size", "time", "version", "extension", "git", "none"]
29+
}
30+
31+
def "nu-complete lsd group-dirs" [] {
32+
["none", "first", "last"]
33+
}
34+
35+
def "nu-complete lsd blocks" [] {
36+
["permission", "user", "group", "context", "size", "date", "name", "inode", "links", "git"]
37+
}
38+
39+
def "nu-complete lsd hyperlink" [] {
40+
["always", "auto", "never"]
41+
}
42+
43+
# An ls command with a lot of pretty colors and some other stuff.
44+
export extern lsd [
45+
--all(-a) # Do not ignore entries starting with .
46+
--almost-all(-A) # Do not list implied . and ..
47+
--color: string@"nu-complete lsd color" # When to use terminal colours [default: auto]
48+
--icon: string@"nu-complete lsd icon" # When to print the icons [default: auto]
49+
--icon-theme: string@"nu-complete lsd icon-theme" # Whether to use fancy or unicode icons [default: fancy]
50+
--classify(-F) # Append indicator (one of */=>@|) at the end of the file names
51+
--long(-l) # Display extended file metadata as a table
52+
--ignore-config # Ignore the configuration file
53+
--config-file: path # Provide a custom lsd configuration file
54+
--oneline(-1) # Display one entry per line
55+
--recursive(-R) # Recurse into directories
56+
--human-readable(-h) # For ls compatibility purposes ONLY, currently set by default
57+
--tree # Recurse into directories and present the result as a tree
58+
--depth: number # Stop recursing into directories after reaching specified depth
59+
--directory-only(-d) # Display directories themselves, and not their contents (recursively when used with --tree)
60+
--permission: string@"nu-complete lsd permission" # How to display permissions [default: rwx for linux, attributes for windows]
61+
--size: string@"nu-complete lsd size" # How to display size [default: default]
62+
--total-size # Display the total size of directories
63+
--date: string@"nu-complete lsd date" # How to display date [default: date]
64+
--timesort(-t) # Sort by time modified
65+
--sizesort(-S) # Sort by size
66+
--extensionsort(-X) # Sort by file extension
67+
--gitsort(-G) # Sort by git status
68+
--versionsort(-v) # Natural sort of (version) numbers within text
69+
--sort: string@"nu-complete lsd sort" # Sort by TYPE instead of name
70+
--no-sort(-U) # Do not sort. List entries in directory order
71+
--reverse(-r) # Reverse the order of the sort
72+
--group-dirs: string@"nu-complete lsd group-dirs" # Sort the directories then the files
73+
--group-directories-first # Groups the directories at the top before the files. Same as --group-dirs=first
74+
--blocks: string@"nu-complete lsd blocks" # Specify the blocks that will be displayed and in what order
75+
--classic # Enable classic mode (display output similar to ls)
76+
--no-symlink # Do not display symlink target
77+
--ignore-glob(-I) # Do not display files/directories with names matching the glob pattern(s). More than one can be specified by repeating the argument
78+
--inode(-i) # Display the index number of each file
79+
--git(-g) # Show git status on file and directory" Only when used with --long option
80+
--dereference(-L) # When showing file information for a symbolic link, show information for the file the link references rather than for the link itself
81+
--context(-Z) # Print security context (label) of each file
82+
--hyperlink: string@"nu-complete lsd hyperlink" # Attach hyperlink to filenames [default: never]
83+
--header # Display block headers
84+
--truncate-owner-after: number # Truncate the user and group names if they exceed a certain number of characters
85+
--truncate-owner-marker: string # Truncation marker appended to a truncated user or group name
86+
--system-protected # Includes files with the windows system protection flag set. This is the same as --all on other platforms
87+
--literal(-N) # Print entry names without quoting
88+
--help # Print help information
89+
--version(-V) # Print version
90+
]

0 commit comments

Comments
 (0)