Coder Social home page Coder Social 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 jeffcox avatar eriner avatar

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.