Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willghatch/zsh-megaprompt
In the year 20XX, one zsh prompt stepped forward to save the world...
https://github.com/willghatch/zsh-megaprompt
Last synced: about 2 months ago
JSON representation
In the year 20XX, one zsh prompt stepped forward to save the world...
- Host: GitHub
- URL: https://github.com/willghatch/zsh-megaprompt
- Owner: willghatch
- License: other
- Created: 2014-11-22T21:25:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-07T17:37:53.000Z (10 months ago)
- Last Synced: 2024-01-27T12:11:10.230Z (4 months ago)
- Language: Shell
- Size: 80.1 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-zsh-plugins - megaprompt - A maximalist prompt including keyboard mode, ownership info, and other contextual info, with λ as the prompt character. Requires the [hooks](https://github.com/willghatch/zsh-hooks) plugin. (Themes / ZSH on Windows)
- fucking-awesome-zsh-plugins - megaprompt - A maximalist prompt including keyboard mode, ownership info, and other contextual info, with λ as the prompt character. Requires the <b><code> 53⭐</code></b> <b><code> 4🍴</code></b> [hooks](https://github.com/willghatch/zsh-hooks)) plugin. (Themes / ZSH on Windows)
- awesome-zsh-plugins - megaprompt - A maximalist prompt including keyboard mode, ownership info, and other contextual info, with λ as the prompt character. Requires the [hooks](https://github.com/willghatch/zsh-hooks) plugin. (Themes / Zinit (née zplugin))
- awesome-zsh-plugins - megaprompt - A maximalist prompt including keyboard mode, ownership info, and other contextual info, with λ as the prompt character. Requires the [hooks](https://github.com/willghatch/zsh-hooks) plugin. (Themes / ZSH on Windows)
README
Depends
-------You must load [zsh-hooks](https://github.com/willghatch/zsh-hooks) before this plugin.
Install
-------I recommend using [zgen](https://github.com/tarjoilija/zgen). Here is how to do it with zgen:
zgen load willghatch/zsh-hooks
zgen load willghatch/zsh-megapromptOtherwise, just source the .zsh files
Features
--------- Maximal information
- Directory coloring based on permissions/ownership
- shows git/hg branch if in repo
- shows current keymap indicator (I suggest replacing vi-ins with emacs, then you get the best of both worlds)
- shows exit status if non-zero
- shows number of jobs if non-zero
- shows time (useful when you want to know when you ran an old command)
- shows history number (useful for history expansion)
- shows user/host
- configure which of these are displayedConfiguration
--------------
MEGAPROMPT_STYLES
is an associative array of styles to color codes or strings for different parts
-MEGAPROMPT_KEYMAP_IND
is an associative array of keymap names to their indicators
-MEGAPROMPT_PRE_FUNCTION
is the name of a function to call to generate a prefix to the prompt. This allows you to add something custom before the start of the prompt.
-MEGAPROMPT_DISPLAY_P
is an associative array of display pieces to "true" or "false"
-git_dirty
do you want to be informed when your git repo is dirty? (note: this may be slow)
-git_untracked
do you want to be informed when your git repo is has untracked files?
-git_ahead_behind
do you want to be informed when your git repo ahead or behind of its tracking branch?
-time
do you want the time of the command? (Yes -- it's useful later when you want to know when you ran something)
-username
do you want to see your username? (I recommend setting it to false for your normal username, true otherwise)
-host
do you want to see your hostname? (I recommend setting it to false unless $SSH_CLIENT or $TMUX is set)
-tty
do you want to see what tty you're on?
-histnum
do you want to see what history number you're on? (useful for history expansion)
-hrule
do you want a horizontal line to go to the end of the line to visually delimit output from different commands?
-truncate
do you want to truncate the top line if it is longer than your terminal? (this also happens if hrule is on)
-branch_style_regex
do you want to match branch styles using regex (requires zsh to be compiled with PCRE support)?
-MEGAPROMPT_GIT_STYLES
is an an associative array of regexes to colors for git branch namesThese arrays are defined at the top of the source, so just look at it to see what fields exist on the ones I haven't documented. There are a lot of fields.
Screenshots
-----------These screenshots are out of date, but I haven't wanted to bother updating them.
![Example](https://github.com/willghatch/zsh-megaprompt/raw/master/img/git.png)
![Example](https://github.com/willghatch/zsh-megaprompt/raw/master/img/permissions.png)
![Example](https://github.com/willghatch/zsh-megaprompt/raw/master/img/jobs.png)
![Example](https://github.com/willghatch/zsh-megaprompt/raw/master/img/insert.png)
![Example](https://github.com/willghatch/zsh-megaprompt/raw/master/img/normal.png)Issues
------- This was written primarily for zsh version 5. With version 4.3.17
it works fine except that the keymap indicator doesn't initialize
properly until after the first command or keymap change.
- The hrule option (`MEGAPROMPT_DISPLAY_P[hrule]=true`) and the truncate option don't
work well below zsh version 5.0.7 -- they are truncated a little too early and
therefore don't span the whole line like they are supposed to.
- The PCRE module is required for git branch coloring. As far as I know all distributions include it.