new_prompt_powerline: This is a Powerline-like prompt

View source: R/prompt-powerline.R

new_prompt_powerlineR Documentation

This is a Powerline-like prompt

Description

It is inspired by the https://github.com/powerline/powerline project. This prompt uses some Unicode glyphs that work best with the fonts specifically modified for Powerline: https://github.com/powerline/fonts It also works best on consoles that support ANSI colors.

Usage

new_prompt_powerline(
  parts = list("status", "memory", "loadavg", "path", "devtools", "git"),
  colors = powerline_colors(parts)
)

Arguments

parts

List of strings and functions. Strings are for the built-in powerline pieces, functions are arbitrary functions with four parameters: expr, value, ok and visible, and they should return a character string. The builtin pieces are:

  • status: Status of last command, a red or green box.

  • memory: Memory usage of the R process.

  • loadavg: The load average of the system, see ps::ps_loadavg().

  • path: Current working directory.

  • devtools: Package(s) loaded by pkgload::load_all() or the same function of devtools.

  • git: git status, see prompt_git().

colors

Colors of the parts. Builtin parts have default colors, but you can change them.

Value

make_prompt_powerline() returns a function that you can use with set_prompt().

See Also

Other example prompts: prompt_devtools(), prompt_fancy(), prompt_git(), prompt_mem(), prompt_runtime(), prompt_status()


prompt documentation built on Aug. 31, 2023, 5:07 p.m.