Explorar o código

Zsh completions

Benjamin Sago %!s(int64=8) %!d(string=hai) anos
pai
achega
cffbd8d6b1
Modificáronse 2 ficheiros con 42 adicións e 1 borrados
  1. 4 1
      Vagrantfile
  2. 38 0
      contrib/completions.zsh

+ 4 - 1
Vagrantfile

@@ -64,7 +64,10 @@ Vagrant.configure(2) do |config|
 
     # Link the completion files so they’re “installed”.
     config.vm.provision :shell, privileged: true, inline: <<-EOF
-        test -f /usr/share/fish/completions/exa.fish \
+        test -h /usr/share/zsh/vendor-completions/_exa \
+          || ln -s /vagrant/contrib/completions.zsh /usr/share/zsh/vendor-completions/_exa
+
+        test -h /usr/share/fish/completions/exa.fish \
           || ln -s /vagrant/contrib/completions.fish /usr/share/fish/completions/exa.fish
     EOF
 

+ 38 - 0
contrib/completions.zsh

@@ -0,0 +1,38 @@
+#compdef exa
+
+__exa() {
+    _arguments \
+        "(- 1 *)"{-v,--version}"[Show version of exa]" \
+        "(- 1 *)"{-\?,--help}"[Show list of command-line options]" \
+        {-1,--oneline}"[Display one entry per line]" \
+        {-G,--grid}"[Display entries as a grid]" \
+        {-l,--long}"[Display extended metadata as a table]" \
+        {-R,--recurse}"[Recurse into directories]" \
+        {-T,--tree}"[Recurse into directories as a tree]" \
+        {-F,--classify}"[Display type indicator by file names]" \
+        {--color,--colour}"[When to use terminal colours]" \
+        {--color,--colour}-scale"[Highlight levels of file sizes distinctly]" \
+        --group-directories-first"[Sort directories before other files]" \
+        {-a,--all}"[Don't hide hidden and 'dot' files]" \
+        {-d,--list-dirs}"[List directories like regular files]" \
+        {-r,--reverse}"[Reverse the sort order]" \
+        {-s,--sort}"[Which field to sort by]:(sort field):(accessed created extension Extension filename Filename inode modified name Name none size)" \
+        {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
+        {-b,--binary}"[Display file sizes with binary prefixes]" \
+        {-B,--bytes}"[Display file sizes in bytes, without any prefixes]" \
+        {-g,--group}"[Show each file's group]" \
+        {-h,--header}"[Add a header row to each column]" \
+        {-H,--links}"[Show each file's number of hard links]" \
+        {-i,--inode}"[Show each file's inode number]" \
+        {-L,--level}"+[Limit the depth of recursion]" \
+        {-m,--modified}"[Use the modified timestamp field]" \
+        {-S,--blocks}"[Show each file's number of filesystem blocks]" \
+        {-t,--time}"[Which time field to show]:(time field):(accessed created modified)" \
+        {-u,--accessed}"[Use the accessed timestamp field]" \
+        {-U,--created}"[Use the created timestamp field]" \
+        {-U,--created}"[Show each file's Git status, if tracked]" \
+        {-@,--extended}"[Show each file's extended attributes and sizes]" \
+        '*:filename:_files'
+}
+
+__exa