Giter Club home page Giter Club logo

promptlib-zsh's Introduction

promptlib-zsh

Collection of libraries for zsh prompts

Usage

add the library as a submodule:

git submodule add https://github.com/eendroroy/promptlib-zsh.git libs/promptlib

use modules in your theme:

THEME_ROOT=${0:A:h}
MODULES=(git ssh python) # skip this line to include all modules
source "${THEME_ROOT}/libs/promptlib/activate"

# rest of your theme

Available Modules

  • background_job
  • crystal
  • disk
  • docker
  • elixir
  • git
  • go
  • gradle
  • java
  • mercurial
  • mysql
  • node
  • php
  • postgres
  • python
  • ruby
  • ssh
  • subversion
  • time
  • vagrant

License

The project is available as open source under the terms of the MIT License.

promptlib-zsh's People

Contributors

betaboon avatar eendroroy avatar louis-vinchon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

promptlib-zsh's Issues

Design Question: "Who is responsible for ensuring the required packages are installed?"

Is your feature request related to a problem? Please describe.

As a user of alien-minimal, I am an indirect user of this library. When certain packages are not installed (ie. git), promptlib raises command not found errors. This request hopefully raises a meaningful discussion point - it is not meant to point fingers in any particular direction.

Describe the solution you'd like

In this call stack, someone should be responsible for ensuring that a required package is installed, or the call tree should fail gracefully in the case that it isn't. Should that be the theme (ie. alien-minimal)? This library? Or the end user?

Describe alternatives you've considered

My working solution has been 2-fold:

  1. Fork & patch promptlib to check whether the dependent command is available: low-fidelity patch I've been using for over a year
  2. Fork & patch alien-minimal to submodule fork of promptlib

Additional context

Thoughts about "who should check for availability":

Within prooptlib

Library functions may be called quite often. Perhaps a cached status per shell instance would be a better solution than running command -v before every call to git, etc. Does the commands list already behave this way? If so, perhaps the patch can be extended appropriately to all am_* calls. I believe this is the "right" solution it it can be introduced with minimal runtime overhead.

Theme repository (ie. alien-minimal)

The theme implementer needs to be aware that promptlib does not perform checks for command availability. This may be a simple docs update, and this issue can be moved to alien-minimal, for example. To me, I think this is rather a topic of promptlib's robustness as opposed to a theme's usage, so this seems like the "easy but lazy" solution.

End User

The user does not always have control of the environment and may not be allowed to install certain packages. Further, the user may not be able (in skill or time) to:

  • Remove / error-check certain calls to promptlib in the theme repository by maintaining a personal fork
  • alias certain/all calls to promotlib to apply a rather hacky patch in their .zshrc

When I first started using zsh, I knew very little about the unix shell, let alone bash. I believe leaving this to the user is the least "community friendly" way of handling it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.