GithubHelp home page GithubHelp logo

mmatongo / toledo Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 314 KB

A fast and extremely minimal shell prompt with git tracking.

License: MIT License

bash terminal bashrc git zsh prompt zshrc shell toledo shell-prompt

toledo's Introduction

馃摝 toledo

A fast and extremely minimal shell prompt with git tracking.

toledo

Features

  • Fast.
  • Minimal.
  • Lightweight.
  • Works on BASH, ZSH, DASH, YASH. Sorry ASH.
  • Works on macOS but you need oh-my-zsh installed.
  • POSIX compliant (to a certain extent).

Table of Contents

What Is It

toledo was an attempt to create a minimal prompt that had git functionality. It's a slew of borrowed ideas that worked well together.

Installation

Manual

git clone https://github.com/mmatongo/toledo.git
# Inside your .bashrc, .zshrc, etc.
. /path/to/toledo

Prompt Character

You can customize the prompt character by modifying the lambda sign on line 62 .

export PS1="\$(parse_git_branch) \$(parse_git_dirty) 位 "

Usage

The script also includes several useful Git aliases:

gs: git status

gd: git diff

gc: git commit -m

gp: git push

gcb:git checkout -b

gco: git checkout

gf: git fetch

gcl: clone_repo (an alias for git clone)

clone_repo usage

gcl <user_name> <repo_name> [<dir_name>] [-gh | -gl]
  • <user_name>: the GitHub or GitLab username that owns the repository.
  • <repo_name>: the name of the repository.
  • <dir_name> (optional): the name of the directory where the repository will be cloned. If not provided, it will use the name of the repository. -gh or -gl (optional): specify whether to clone from GitHub (-gh) or GitLab (-gl). The default is GitHub.

Screenshots

Initial Screen

init

Untracked File [?]

untracked

Modified File [*]

modified

Renamed File [~]

renamed

Deleted File [-]

deleted

Switch Branch

switch

Branch is ahead [!]

ahead

New file Added [+]

new

Branch is behind [爽爽]

behind

MISC recommendations

As is toledo is pretty functional and can be used as your daily shell prompt, however if you want extra functionality consider using it alongside oh-my-zsh or anything similar.

toledo's People

Contributors

mmatongo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

toledo's Issues

Please add a license file and a screen shot

I'd like to add this to awesome-zsh-plugins, but I prefer to add themes with screen shots in the readme so that users can see what they look like without having to install them.

Also, please add a license file, some people won't use any code that doesn't have an open source license. If you don't have one in mind, https://choosealicense.com is a good resource to help you select an appropriate one.

Thanks!

ASH Compatibility

Currently toledo doesn't play to well with ash.
I haven't done much research into this but I suspect it has something to do with how ash handles shell functions.

TODO

  • Make toledo compatible with ash

Readme feedback

Nice job on the prompt, I'm really liking it! I have a few questions that were not answered in the readme. Maybe they could be answered here and then added to the readme if they seem relevant.

  1. A single screenshot at the top of the readme that gives an idea of what it looks like would be useful. Interested people would be drawn into reading the rest of the documentation while uninterested people could quickly move on.
  2. You show screenshots of what the prompt looks like for different git scenarios (untracked file, modified file, etc) but you don't show how it behaves with multiple git scenarios. What would display if I had a modified file and a renamed file, for example? I guess all relevant icons would display but it's unclear.
  3. How does the prompt behave outside of a git repo?

Multiple statuses

For some odd reason multiple statuses of the same kind are showing up.

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.