Code Monkey home page Code Monkey logo

statusline's Introduction

Statusline

Preview

A Powerline-style prompt for prezto and oh-my-zsh

Wish your prompt displayed more information, but afraid of filling it with clutter? Statusline is a responsive zsh theme that provides informational segments when you need them. For example, statusline only displays your user and machine names when you are in a remote shell. Likewise, task runtimes are only shown when they exceed ten seconds, the current working directory is dynamically shortened to fit onscreen, and more! Statusline is designed for solarized (light and dark), and is compatible with the default OS X Terminal.app.

Prerequisites

(The prezto version's installer checks for and installs all prerequisites)

  • Powerline-patched menlo font (optional, see --font option)
  • [Solarized light](setup/Solarized\ Light.terminal) or [solarized dark](setup/Solarized\ Dark.terminal) Terminal.app profiles
  • zsh 5.0.0+ and git 2.0.0+

Quick Install

Got/want prezto? Statusline is one line away:

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/el1t/statusline/master/prezto/install)"

For more information, read on!

Features

  • Asynchronous git status loading
  • Task runtime
  • Light and dark themes
  • Contextual segments
  • Fully modular design
  • Custom PS1, RPS1, PS2, RPS2, PS3, PS4, SPROMPT, and completion formatting
  • Dual- and single-line prompts
  • Powerline and legacy font support
  • Tmux compatible

Single line mode

In addition to a two-line prompt, statusline supports a single-line mode

Single line

Segments

Name Description Context
status SU/exit code/running jobs when statuses are present
user username when in a remote shell
machine machine name when in a remote shell
git-branch branch/position/commit when inside a git repository
git-status stashed/behind/ahead/etc. when inside a git repository
directory current working directory dynamically truncated
time 12-hour clock always
history index in zsh history always

Directory truncation?

When the length of the working directory exceeds that of the terminal, subdirectories up to (but not including) the tail directory are shortened to their first letter. In order to use this, directory must be last in the left-hand prompt. Note that only the minimum number of directories necessary are shortened.

Truncation

Installation

For automatic installation, simply run this in your shell:

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/el1t/statusline/master/prezto/install)"

Manual installation

Updating

Run this to update prezto and all its submodules (including statusline):

git -C ~/.zprezto submodule foreach git pull origin master && git -C ~/.zprezto submodule foreach "(git checkout master; git pull)&"

Options

Set options in zshrc with zstyle ':prezto:module:prompt' theme 'statusline' <options>

Option Parameters Description
-c, --color Terminal color code Set statusbar background color
-d, --dark N/A Apply dark theme
-f, --font See below Change special chars used
-s, --single N/A Fit the prompt to one line
Font Parameter Characters
powerline ⮂   ⮀
legacy ◀ < > ▶︎
block ◼ | | ◼
none N/A

Run prompt -h statusline for more information.

Since the prezto version uses certain prezto modules which are not present in oh-my-zsh, missing features were ported to the oh-my-zsh version. This includes asynchronous git status loading, which was ported from prezto's git-info, and the customizable settings. However, statusline's settings are not exposed by oh-my-zsh, so customization is more difficult. Also, the key-binding color indicator is currently not supported in this version.

statusline's People

Contributors

el1t avatar eriner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

statusline's Issues

How to use bold

i used to use bold on my classic terminal. i tried to set menlo bold but the powerline becomes a “?”. how can i make the text bold without removing the powerline?

Some segments broken by zsh 5.8.1

From https://zsh.sourceforge.io/releases.html

PROMPT_SUBST expansion is no longer performed on arguments to prompt-expansion sequences such as %F.

While there are many %F uses in statusline the one that seems to break for me is coloring the git-branch segment background. I'm looking into this in my free time, just wanted to put this here if anyone else is still using this and wondering what's changed.

5.8:
Screen Shot 2022-04-05 at 7 30 12 PM

5.8.1
Screen Shot 2022-04-05 at 7 30 40 PM

Single Line mode display bugs

Command history searching in single mode reverts back to the light theme:
screen shot 2015-11-24 at 11 30 52 am
screen shot 2015-11-24 at 11 31 01 am

I think single mode also needs a space at the end of the left prompt, line 475, but I'm willing to attribute that to personal taste.

Prompt gets wrapped onto a new line in prezto version on rxvt-unicode

I've been using statusline in termite and st for a while now and it's great! However, I'm trying out rxvt-unicode after a long hiatus and I find that the prompt gets wrapped onto a second line which causes all sorts of weird issues with tab completion:

urxvt-bug
(urxvt in the back, st in the front)

Any ideas?

Strange problem with font

I’m the same guy of yesterday.
I thought i solved the issue with your tip but i think there’s a bug in the theme.

With your solution the final arrow shows correctly but not the one between ~ and Desktop.

powerzsh

Can you make sure that putting -f ‘powerline’ also modifies the other arrows?

Double home directory

screen shot 2019-02-06 at 20 22 17

I've been using statusline for a long time but have recently upgraded hardware and went through the reinstallation of everything. From a fresh zsh > prezto > statusline installation I seem to always be encountering double "local"/"home" directories when I'm at ~. I understand this could totally be a zsh/prezto issue, but hopefully you might have an idea what the cause is

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.