├── .github ├── .cspell │ └── project-usernames.txt ├── workflows │ ├── sync-labels.yml │ ├── pr-labels.yml │ ├── trunk-check.yml │ ├── assign.yml │ └── stale.yml └── dependabot.yml ├── .trunk ├── .gitignore ├── configs │ └── .markdownlint.yaml └── trunk.yaml ├── icons.yaml ├── zsh-lsd.plugin.zsh ├── LICENSE ├── functions └── .zsh-lsd ├── .gitignore ├── .editorconfig ├── docs └── README.md └── config.yaml /.github/.cspell/project-usernames.txt: -------------------------------------------------------------------------------- 1 | Peltoche 2 | -------------------------------------------------------------------------------- /.trunk/.gitignore: -------------------------------------------------------------------------------- 1 | *out 2 | *logs 3 | *actions 4 | *notifications 5 | plugins 6 | user_trunk.yaml 7 | user.yaml 8 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "♻️ Sync Labels" 3 | 4 | on: 5 | schedule: 6 | - cron: "22 2 * * 2" 7 | workflow_dispatch: {} 8 | 9 | jobs: 10 | labels: 11 | name: "♻️ Sync labels" 12 | uses: z-shell/.github/.github/workflows/sync-labels.yml@main 13 | -------------------------------------------------------------------------------- /.trunk/configs/.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Autoformatter friendly markdownlint config (all formatting rules disabled) 2 | default: true 3 | blank_lines: false 4 | bullet: false 5 | html: false 6 | indentation: false 7 | line_length: false 8 | spaces: false 9 | url: false 10 | whitespace: false 11 | -------------------------------------------------------------------------------- /.github/workflows/pr-labels.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🏷️ Verify PR Labels 3 | 4 | on: 5 | pull_request_target: 6 | types: ["opened", "labeled", "unlabeled", "synchronize"] 7 | workflow_dispatch: {} 8 | 9 | jobs: 10 | labels: 11 | name: "🏷️" 12 | uses: z-shell/.github/.github/workflows/pr-labels.yml@main 13 | -------------------------------------------------------------------------------- /icons.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/Peltoche/lsd/tree/master#icon-theme-file-content 2 | name: 3 | .trash:  4 | .cargo:  5 | .emacs.d:  6 | a.out:  7 | extension: 8 | go:  9 | hs:  10 | rs: 🦀 11 | filetype: 12 | dir: 📂 13 | file: 📄 14 | pipe: 📩 15 | socket:  16 | executable:  17 | symlink-dir:  18 | symlink-file:  19 | device-char:  20 | device-block: ﰩ 21 | special:  22 | -------------------------------------------------------------------------------- /.github/workflows/trunk-check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "⭕ Trunk" 3 | on: 4 | pull_request: 5 | types: [opened, synchronize] 6 | workflow_dispatch: {} 7 | 8 | concurrency: 9 | group: ${{ github.head_ref || github.run_id }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | check: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: ✅ Checkout 17 | uses: actions/checkout@v4 18 | - name: ✨ Trunk Check 19 | uses: trunk-io/trunk-action@v1 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/assign.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "❇️ Assign" 3 | 4 | on: 5 | issues: 6 | types: 7 | - opened 8 | pull_request: 9 | types: 10 | - labeled 11 | 12 | jobs: 13 | assign: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/add-to-project@main 17 | with: 18 | project-url: https://github.com/orgs/z-shell/projects/4 19 | github-token: ${{ github.token }} 20 | labeled: bug 🐞, triage 📑, annex 🌀, plugin ⚙️, package 📦, feature-request 💡 21 | label-operator: OR 22 | -------------------------------------------------------------------------------- /.trunk/trunk.yaml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | cli: 3 | version: 1.5.0 4 | plugins: 5 | sources: 6 | - id: trunk 7 | ref: v0.0.11 8 | uri: https://github.com/trunk-io/plugins 9 | lint: 10 | enabled: 11 | - actionlint@1.6.23 12 | - git-diff-check 13 | - gitleaks@8.15.3 14 | - markdownlint@0.33.0 15 | - prettier@2.8.4 16 | runtimes: 17 | enabled: 18 | - go@1.19.5 19 | - node@18.12.1 20 | actions: 21 | enabled: 22 | - trunk-announce 23 | - trunk-check-pre-push 24 | - trunk-fmt-pre-commit 25 | - trunk-upgrade-available 26 | -------------------------------------------------------------------------------- /zsh-lsd.plugin.zsh: -------------------------------------------------------------------------------- 1 | # -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- 2 | # vim: ft=zsh sw=2 ts=2 et 3 | # 4 | # Copyright (c) 2022 Salvydas Lukosius 5 | # 6 | # Zsh Plugin Standard 7 | # https://wiki.zshell.dev/community/zsh_plugin_standard#zero-handling 8 | 0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}" 9 | 0="${${(M)0:#/*}:-$PWD/$0}" 10 | 11 | # https://wiki.zshell.dev/community/zsh_plugin_standard#standard-plugins-hash 12 | typeset -gA Plugins 13 | Plugins[ZSH_LSD]="${0:h}" 14 | 15 | # https://wiki.zshell.dev/community/zsh_plugin_standard#funtions-directory 16 | if [[ $PMSPEC != *f* ]]; then 17 | fpath+=( "${0:h}/functions" ) 18 | fi 19 | 20 | autoload -Uz .zsh-lsd 21 | 22 | # Load plugin 23 | (( $+functions[.zsh-lsd] )) && { 24 | .zsh-lsd || { 25 | print "Error loading zsh-lsd plugin" 26 | return 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021, Salvydas Lukosius & Z-Shell ZI Community 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /functions/.zsh-lsd: -------------------------------------------------------------------------------- 1 | # -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- 2 | # vim: ft=zsh sw=2 ts=2 et 3 | # 4 | # Copyright (c) 2022 Salvydas Lukosius 5 | 6 | builtin emulate -L zsh ${=${options[xtrace]:#off}:+-o xtrace} 7 | builtin setopt extended_glob warn_create_global typeset_silent local_options 8 | 9 | typeset -i enable_autocd=0 ret=0 10 | 11 | if [[ $TERM == 'dumb' ]]; then 12 | ret=0 13 | elif (( ! $+commands[lsd] )); then 14 | print "Please install lsd before using this plugin." >&2 15 | ret=1 16 | else 17 | typeset -ag lsd_params 18 | lsd_params=( "--config-file=${Plugins[ZSH_LSD]}/config.yaml" ) 19 | 20 | alias ls='command lsd $lsd_params' 21 | alias ll='command lsd --all --header --long $lsd_params' 22 | alias llm='command lsd --all --header --long --sort time $lsd_params' 23 | alias la='command lsd -lhiUa --group-directories-first' 24 | alias lx='command lsd -lhiUSA --group-directories-first --total-size' 25 | alias lt='command lsd --tree $lsd_params' 26 | alias tree='command lsd --tree $lsd_params' 27 | 28 | [[ "$AUTOCD" = <-> ]] && enable_autocd="$AUTOCD" 29 | 30 | if [[ "$enable_autocd" == "1" ]]; then 31 | # Function for cd auto list directories 32 | →auto-lsd() { command lsd $lsd_params; } 33 | [[ $chpwd_functions[(r)→auto-lsd] == →auto-lsd ]] || chpwd_functions=( →auto-lsd $chpwd_functions ) 34 | fi 35 | 36 | ret=$? 37 | fi 38 | 39 | return $ret 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Zsh compiled script + zrecompile backup 3 | *.zwc 4 | *.zwc.old 5 | 6 | # Zsh completion-optimization dumpfile 7 | *zcompdump* 8 | 9 | # Zsh zcalc history 10 | .zcalc_history 11 | 12 | # A popular plugin manager's files 13 | ._zi 14 | ._zinit 15 | .zi_lastupd 16 | .zinit_lastupd 17 | 18 | # A popular older versions plugin manager's files 19 | ._zplugin 20 | .zplugin_lstupd 21 | 22 | # z-shell/zshelldoc tool's files 23 | zsdoc/data 24 | docs/zsdoc/data 25 | 26 | # ohmyzsh/ohmyzsh/plugins/per-directory-history plugin's files 27 | # (when set-up to store the history in the local directory) 28 | .directory_history 29 | 30 | # MichaelAquilina/zsh-autoswitch-virtualenv plugin's files 31 | # (for Zsh plugins using Python) 32 | .venv 33 | 34 | # Zunit tests' output 35 | /tests/_output/* 36 | !/tests/_output/.gitkeep 37 | 38 | ### C 39 | # Prerequisites 40 | *.d 41 | 42 | # Object files 43 | *.o 44 | *.ko 45 | *.obj 46 | *.elf 47 | 48 | # Linker output 49 | *.ilk 50 | *.map 51 | *.exp 52 | 53 | # Precompiled Headers 54 | *.gch 55 | *.pch 56 | 57 | # Libraries 58 | *.lib 59 | *.a 60 | *.la 61 | *.lo 62 | 63 | # Shared objects (inc. Windows DLLs) 64 | *.dll 65 | *.so 66 | *.so.* 67 | *.dylib 68 | 69 | # Executables 70 | *.exe 71 | *.out 72 | *.app 73 | *.i*86 74 | *.x86_64 75 | *.hex 76 | 77 | # Debug files 78 | *.dSYM/ 79 | *.su 80 | *.idb 81 | *.pdb 82 | 83 | # Kernel Module Compile Results 84 | *.mod* 85 | *.cmd 86 | .tmp_versions/ 87 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 👻 Stale 3 | 4 | on: 5 | schedule: 6 | - cron: "0 8 * * *" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | stale: 11 | name: 🧹 Clean up stale issues and PRs 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: 🚀 Run stale 15 | uses: actions/stale@v9 16 | with: 17 | repo-token: ${{ secrets.GITHUB_TOKEN }} 18 | days-before-stale: 30 19 | days-before-close: 7 20 | remove-stale-when-updated: true 21 | stale-issue-label: "stale 👻" 22 | exempt-issue-labels: "no-stale 🔒,help-wanted 👥" 23 | stale-issue-message: > 24 | There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be 25 | marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us 26 | know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and 27 | locked in 7 days if no further activity occurs. Thank you for your contributions! 28 | stale-pr-label: "stale 👻" 29 | exempt-pr-labels: "no-stale 🔒" 30 | stale-pr-message: > 31 | There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has 32 | been marked as stale. This PR will be closed and locked in 7 days if no further activity occurs. Thank you 33 | for your contributions! 34 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Space or Tabs? 2 | # https://stackoverflow.com/questions/35649847/objective-reasons-for-using-spaces-instead-of-tabs-for-indentation 3 | # https://stackoverflow.com/questions/12093748/how-to-use-tabs-instead-of-spaces-in-a-shell-script 4 | # https://github.com/editorconfig/editorconfig-defaults/blob/master/editorconfig-defaults.json 5 | # 6 | # 1. What happens when I press the Tab key in my text editor? 7 | # 2. What happens when I request my editor to indent one or more lines? 8 | # 3. What happens when I view a file containing U+0009 HORIZONTAL TAB characters? 9 | # 10 | # Answers: 11 | # 12 | # 1. Pressing the Tab key should indent the current line (or selected lines) one additional level. 13 | # 2. As a secondary alternative, I can also tolerate an editor that, 14 | # like Emacs, uses this key for a context-sensitive fix-my-indentation command. 15 | # 3. Indenting one or more lines should follow the reigning convention, if consensus is sufficiently strong; otherwise, 16 | # I greatly prefer 2-space indentation at each level. U+0009 characters should shift subsequent characters to the next tab stop. 17 | # 18 | # Note: VIM users should use alternate marks [[[ and ]]] as the original ones can confuse nested substitutions, e.g.: ${${${VAR}}} 19 | # 20 | # -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- 21 | # vim: ft=zsh sw=2 ts=2 et 22 | 23 | root = true 24 | 25 | [*] 26 | charset = utf-8 27 | indent_style = space 28 | indent_size = 2 29 | insert_final_newline = true 30 | trim_trailing_whitespace = true 31 | 32 | [*.sln] 33 | indent_style = tab 34 | 35 | [*.{md,mdx,rst}] 36 | trim_trailing_whitespace = false 37 | 38 | [*.{cmd,bat}] 39 | end_of_line = crlf 40 | 41 | [*za-*] 42 | end_of_line = lf 43 | 44 | [*.{sh,bash,zsh,fish}] 45 | end_of_line = lf 46 | 47 | [Makefile] 48 | indent_style = tab 49 | indent_size = 4 50 | 51 | [*.{py,rb}] 52 | indent_size = 4 53 | 54 | [*.{go,java,scala,groovy,kotlin}] 55 | indent_style = tab 56 | indent_size = 4 57 | 58 | [*.{cs,csx,cake,vb,vbx}] 59 | # Default Severity for all .NET Code Style rules below 60 | dotnet_analyzer_diagnostic.severity = warning 61 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 |

2 |

3 | 4 | Logo 5 | 6 | ❮ Zsh Plugin - Lsd ❯ 7 |

8 |

9 |

10 |

Zsh plugin which replace GNU/ls with next generation ls by Peltoche/lsd

11 |

12 |

13 |

14 | 《❔》 Ask a Question 15 | 《💡》 Search Wiki 16 | 《🌐》 Localize 17 |

18 |

19 |
20 | 21 | ⭕ Trunk Check 22 | 23 | 24 | Visual Studio Code 29 |
30 | 31 | ## Default settings 32 | 33 | The Zsh plugin replaces the **GNU/ls** with lots of added features like **colors**, **icons**, **tree-view**, and other formatting options. 34 | 35 | > Enable auto list directories on `cd` with `export AUTOCD=1`. 36 | 37 | ## Install 38 | 39 | The lsd should be present to use this plugin. Install lsd with **Zi**: 40 | 41 | ```shell 42 | zi ice binary from'gh-r' sbin'**/lsd -> lsd' \ 43 | atclone'cp lsd-*/lsd.1 $ZI[MAN_DIR]/man1; ln -s lsd-*/*/_lsd _lsd' 44 | zi light Peltoche/lsd 45 | ``` 46 | 47 | ### With [Zi](https://github.com/z-shell/zi) 48 | 49 | To install add to the `.zshrc` file: 50 | 51 | ```shell 52 | zi light z-shell/zsh-lsd 53 | ``` 54 | 55 | Install only if lsd available in `$PATH` and enable auto-list directories: 56 | 57 | ```shell 58 | zi ice has'lsd' atinit'AUTOCD=1' 59 | zi light z-shell/zsh-lsd 60 | ``` 61 | 62 | Install only if lsd available in `$PATH` and enable auto-list directories in turbo mode: 63 | 64 | ```shell 65 | zi ice wait lucid has'lsd' atinit'AUTOCD=1' 66 | zi light z-shell/zsh-lsd 67 | ``` 68 | 69 | Install only if lsd available in `$PATH` and enable auto-list directories in turbo mode with the syntax: 70 | 71 | ```shell 72 | zi wait lucid for \ 73 | has'lsd' atinit'AUTOCD=1' \ 74 | z-shell/zsh-lsd 75 | ``` 76 | 77 | ### With [Oh My Zsh](https://ohmyz.sh/) 78 | 79 | Clone the repository and add `zsh-lsd` to the plugins array of your `.zshrc` file: 80 | 81 | ```sh 82 | ~/.oh-my-zsh/custom/plugins 83 | ``` 84 | 85 | ```sh 86 | plugins=(... zsh-lsd) 87 | ``` 88 | 89 | ### With Zplug 90 | 91 | Add `zplug z-shell/zsh-lsd` to your `~/.zshrc` and re-open your terminal session. 92 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/Peltoche/lsd/tree/master#configuration 2 | # == Classic == 3 | # This is a shorthand to override some of the options to be backwards compatible 4 | # with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date" 5 | # and "icons"->"when" options. 6 | # Possible values: false, true 7 | classic: false 8 | 9 | # == Blocks == 10 | # This specifies the columns and their order when using the long and the tree 11 | # layout. 12 | # Possible values: permission, user, group, context, size, date, name, inode, links 13 | blocks: 14 | - permission 15 | - user 16 | - group 17 | - size 18 | - date 19 | - name 20 | 21 | # == Color == 22 | # This has various color options. (Will be expanded in the future.) 23 | color: 24 | # When to colorize the output. 25 | # When "classic" is set, this is set to "never". 26 | # Possible values: never, auto, always 27 | when: auto 28 | # How to colorize the output. 29 | # When "classic" is set, this is set to "no-color". 30 | # Possible values: default, 31 | # when specifying , lsd will look up theme file 32 | # XDG Base Directory if relative, e.g. ~/.config/lsd/themes/.yaml, 33 | # The file path if absolute 34 | theme: default 35 | 36 | # == Date == 37 | # This specifies the date format for the date column. The freeform format 38 | # accepts a strftime like string. 39 | # When "classic" is set, this is set to "date". 40 | # Possible values: date, relative, '+' 41 | # `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55 42 | date: date 43 | 44 | # == Dereference == 45 | # Whether to dereference symbolic links. 46 | # Possible values: false, true 47 | dereference: false 48 | 49 | # == Display == 50 | # What items to display. Do not specify this for the default behavior. 51 | # Possible values: all, almost-all, directory-only 52 | # display: all 53 | 54 | # == Icons == 55 | icons: 56 | # When to use icons. 57 | # When "classic" is set, this is set to "never". 58 | # Possible values: always, auto, never 59 | when: auto 60 | # Which icon theme to use. 61 | # Possible values: fancy, unicode 62 | theme: fancy 63 | # Separator between icon and the name 64 | # Default to 1 space 65 | separator: " " 66 | 67 | # == Ignore Globs == 68 | # A list of globs to ignore when listing. 69 | # ignore-globs: 70 | # - .git 71 | 72 | # == Indicators == 73 | # Whether to add indicator characters to certain listed files. 74 | # Possible values: false, true 75 | indicators: true 76 | 77 | # == Layout == 78 | # Which layout to use. "oneline" might be a bit confusing here and should be 79 | # called "one-per-line". It might be changed in the future. 80 | # Possible values: grid, tree, oneline 81 | layout: grid 82 | 83 | # == Recursion == 84 | recursion: 85 | # Whether to enable recursion. 86 | # Possible values: false, true 87 | enabled: false 88 | # How deep the recursion should go. This has to be a positive integer. Leave 89 | # it unspecified for (virtually) infinite. 90 | # depth: 3 91 | 92 | # == Size == 93 | # Specifies the format of the size column. 94 | # Possible values: default, short, bytes 95 | size: default 96 | 97 | # == Permission == 98 | # Specify the format of the permission column 99 | # Possible value: rwx, octal 100 | permission: rwx 101 | 102 | # == Sorting == 103 | sorting: 104 | # Specify what to sort by. 105 | # Possible values: extension, name, time, size, version 106 | column: name 107 | # Whether to reverse the sorting. 108 | # Possible values: false, true 109 | reverse: false 110 | # Whether to group directories together and where. 111 | # When "classic" is set, this is set to "none". 112 | # Possible values: first, last, none 113 | dir-grouping: first 114 | 115 | # == No Symlink == 116 | # Whether to omit showing symlink targets 117 | # Possible values: false, true 118 | no-symlink: false 119 | 120 | # == Total size == 121 | # Whether to display the total size of directories. 122 | # Possible values: false, true 123 | total-size: false 124 | 125 | # == Hyperlink == 126 | # Attach hyperlink to filenames 127 | # Possible values: always, auto, never 128 | hyperlink: never 129 | 130 | # == Symlink arrow == 131 | # Specifies how the symlink arrow display, chars in both ascii and utf8 132 | symlink-arrow: ⇒ 133 | 134 | # == Header == 135 | # Whether to display block headers. 136 | # Possible values: false, true 137 | header: false 138 | --------------------------------------------------------------------------------