From 7a1b97e60ebe6d49729dff14d5828ffc8a4dc1f9 Mon Sep 17 00:00:00 2001 From: William Melody Date: Thu, 7 Sep 2023 17:14:11 -0700 Subject: [PATCH] Add support for `lsd` in `show`. refs gh-271 --- README.md | 13 +++++++++---- docs/index.markdown | 13 +++++++++---- nb | 29 ++++++++++++++++++++++------- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 21f87e146..fef9565c5 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,7 @@ Also supported for various enhancements: [`imgcat`](https://www.iterm2.com/documentation-images.html), [`joshuto`](https://github.com/kamiyaa/joshuto), [kitty's `icat` kitten](https://sw.kovidgoyal.net/kitty/kittens/icat.html), +[`lsd`](https://github.com/lsd-rs/lsd), [Links](https://en.wikipedia.org/wiki/Links_(web_browser)), [Lynx](https://en.wikipedia.org/wiki/Lynx_(web_browser)), [Midnight Commander (`mc`)](https://en.wikipedia.org/wiki/Midnight_Commander), @@ -1452,6 +1453,7 @@ Supported file types and tools include: - Folders, Directories, Notebooks ([`$NB_DIRECTORY_TOOL`](#nb_directory_tool)): - [`eza`](https://github.com/eza-community/eza) - [`joshuto`](https://github.com/kamiyaa/joshuto) + - [`lsd`](https://github.com/lsd-rs/lsd) - [Midnight Commander (`mc`)](https://en.wikipedia.org/wiki/Midnight_Commander) - [`ranger`](https://ranger.github.io/) - [`vifm`](https://vifm.info/) @@ -7456,7 +7458,8 @@ Subcommands: Shortcut Alias: `o` peek Open the current notebook directory or notebook in the first tool found in the following list: - `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], `eza` [5], or `ls`. + `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], `lsd` [5], + `eza` [6], or `ls`. Shortcut Alias: `p` rename Rename a notebook. Aliases: `move`, `mv` select Set the current notebook from a colon-prefixed selector. @@ -7471,7 +7474,8 @@ Subcommands: 2. https://en.wikipedia.org/wiki/Midnight_Commander 3. https://vifm.info/ 4. https://github.com/kamiyaa/joshuto - 5. https://github.com/eza-community/eza + 5. https://github.com/lsd-rs/lsd + 6. https://github.com/eza-community/eza Description: Manage notebooks. @@ -7565,13 +7569,14 @@ Description: format or any other file type, `peek` is the equivalent of `show`. When used with a notebook, `peek` opens the notebook folder first tool found in the following list: `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], - `eza` [5], or `ls`. + `lsd` [5], eza` [6], or `ls`. 1. https://ranger.github.io/ 2. https://en.wikipedia.org/wiki/Midnight_Commander 3. https://vifm.info/ 4. https://github.com/kamiyaa/joshuto - 5. https://github.com/eza-community/eza + 5. https://github.com/lsd-rs/lsd + 6. https://github.com/eza-community/eza Read More: https://github.com/xwmx/nb#viewing-bookmarks diff --git a/docs/index.markdown b/docs/index.markdown index 2d4f8b8cc..9e0e0f299 100644 --- a/docs/index.markdown +++ b/docs/index.markdown @@ -222,6 +222,7 @@ Also supported for various enhancements: [`imgcat`](https://www.iterm2.com/documentation-images.html), [`joshuto`](https://github.com/kamiyaa/joshuto), [kitty's `icat` kitten](https://sw.kovidgoyal.net/kitty/kittens/icat.html), +[`lsd`](https://github.com/lsd-rs/lsd), [Links](https://en.wikipedia.org/wiki/Links_(web_browser)), [Lynx](https://en.wikipedia.org/wiki/Lynx_(web_browser)), [Midnight Commander (`mc`)](https://en.wikipedia.org/wiki/Midnight_Commander), @@ -1458,6 +1459,7 @@ Supported file types and tools include: - Folders, Directories, Notebooks ([`$NB_DIRECTORY_TOOL`](#nb_directory_tool)): - [`eza`](https://github.com/eza-community/eza) - [`joshuto`](https://github.com/kamiyaa/joshuto) + - [`lsd`](https://github.com/lsd-rs/lsd) - [Midnight Commander (`mc`)](https://en.wikipedia.org/wiki/Midnight_Commander) - [`ranger`](https://ranger.github.io/) - [`vifm`](https://vifm.info/) @@ -7462,7 +7464,8 @@ Subcommands: Shortcut Alias: `o` peek Open the current notebook directory or notebook in the first tool found in the following list: - `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], `eza` [5], or `ls`. + `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], `lsd` [5], + `eza` [6], or `ls`. Shortcut Alias: `p` rename Rename a notebook. Aliases: `move`, `mv` select Set the current notebook from a colon-prefixed selector. @@ -7477,7 +7480,8 @@ Subcommands: 2. https://en.wikipedia.org/wiki/Midnight_Commander 3. https://vifm.info/ 4. https://github.com/kamiyaa/joshuto - 5. https://github.com/eza-community/eza + 5. https://github.com/lsd-rs/lsd + 6. https://github.com/eza-community/eza Description: Manage notebooks. @@ -7571,13 +7575,14 @@ Description: format or any other file type, `peek` is the equivalent of `show`. When used with a notebook, `peek` opens the notebook folder first tool found in the following list: `ranger` [1], `mc` [2], `vifm` [3], `joshuto` [4], - `eza` [5], or `ls`. + `lsd` [5], eza` [6], or `ls`. 1. https://ranger.github.io/ 2. https://en.wikipedia.org/wiki/Midnight_Commander 3. https://vifm.info/ 4. https://github.com/kamiyaa/joshuto - 5. https://github.com/eza-community/eza + 5. https://github.com/lsd-rs/lsd + 6. https://github.com/eza-community/eza Read More: https://github.com/xwmx/nb#viewing-bookmarks diff --git a/nb b/nb index 10ee536a0..c69b8ea01 100755 --- a/nb +++ b/nb @@ -16136,13 +16136,14 @@ $(_color_primary "Description"): format or any other file type, \`peek\` is the equivalent of \`show\`. When used with a notebook, \`peek\` opens the notebook folder first tool found in the following list: \`ranger\` [1], \`mc\` [2], \`vifm\` [3], \`joshuto\` [4], - \`eza\` [5], or \`ls\`. + \`lsd\` [5] \`eza\` [6], or \`ls\`. 1. https://ranger.github.io/ 2. https://en.wikipedia.org/wiki/Midnight_Commander 3. https://vifm.info/ 4. https://github.com/kamiyaa/joshuto - 5. https://github.com/eza-community/eza + 5. https://github.com/lsd-rs/lsd + 6. https://github.com/eza-community/eza $(_color_primary "Read More"): ${_README_URL}#viewing-bookmarks @@ -18414,13 +18415,13 @@ Can't show archives. Export archive and expand to edit.\\n" then if [[ -z "${_tool:-}" ]] && _contains "${NB_DIRECTORY_TOOL:-}" \ - "ranger" \ - "mc" \ - "vifm" \ "joshuto" \ - "eza" \ "lsd" \ - "exa" && + "mc" \ + "exa" \ + "eza" \ + "ranger" \ + "vifm" && _command_exists "${NB_DIRECTORY_TOOL:-}" then _tool="${NB_DIRECTORY_TOOL}" @@ -18448,6 +18449,20 @@ Can't show archives. Export archive and expand to edit.\\n" elif _command_exists "joshuto" && [[ "${_tool:-joshuto}" == "joshuto" ]] then joshuto --path "${_target_path}" + elif _command_exists "lsd" && [[ "${_tool:-lsd}" == "lsd" ]] + then + lsd \ + -1Al \ + --blocks=permission,size,date,git,name \ + --color=always \ + --date '+%F %R' \ + --git \ + --icon=always \ + --icon-theme=fancy \ + --ignore-config \ + --group-directories-first \ + --size=short \ + "${_target_path}" elif _command_exists "eza" && [[ "${_tool:-eza}" == "eza" ]] then eza \