oh-my-fish / theme-dangerous

A feature-rich theme derived from budspencer without powerline font.
33 stars 8 forks source link

Dangerous theme

A theme for the 70s, makes fish even more powerful. It's equipped with a hell of a lot of nice functions and key bindings to speed up your workflow.

The philosophy behind dangerous theme:

Screenshot

screenshot

Requirements

You need an up-to-date fish shell version from github or a nightly build.

Non standard tools:

Configuration

General configuration

It's crucial to have vi mode enabled. Thus, execute

set -U fish_key_bindings fish_vi_key_bindings

before enabling the theme.

Colors

Redefine $dangerous_colors with the set command in order to change the colors of the prompt.

Example:

set dangerous_colors 000000 333333 666666 ffffff ffff00 ff6600 ff0000 ff0033 3300ff 0000ff 00ffff
00ff00

Two color schemes for bright and dark environments are predefined. You can enable them with day and night, respectively.

Command history

Commands that shouldn't appear in the command history are defined by a universal list $dangerous_nocmdhist. Default:

set -U dangerous_nocmdhist c d ll ls m s

Disable/reenable greeting

Disable:

set -U dangerous_nogreeting

Reenable:

set -e dangerous_nogreeting

Outer prompt segments

Left prompt segments

Right prompt segments

Toggle prompt segments

The following shortcuts need vi-mode:

Note, the format is username@hostname:pathname. Thus, you can cut the whole string with your mouse and paste it into ssh commands.

Quickly navigate in history of working directories

The function d drops down a menu showing the history as enumerated list. Unlike fish's builtin dirh, d does not show any duplicates. Enter a number to jump to a directory within the list.

The following shortcuts need vi-mode:

Quickly navigate in command history

The function c drops down a menu showing the command history as enumerated list similarly to the d function. Selections are also pasted into the X clipboard. It's possible to load a command of a former prompt by giving the prompt line number as argument.

Bookmarks

A bookmark can be created with mark. It can be removed with unmark. Bookmarks are universal and thus persistant. A new shell automatically changes working directory on startup to newest bookmark. m is a function that drops down a menu showing the bookmarks as enumerated list equivalently to d.

The following shortcuts need vi mode:

Edit commandline with your favorite editor

The function edit-commandline lets you edit the commandline with your editor. It makes the commandline as powerful as your editor. If $EDITOR is not set, vi is used.

The following shortcut needs vi mode:

Sessions

Shell session can be stored with s <session name>. If a session with session name already exists, the session with this name will be attached. If a session with session name is already active within another terminal, this terminal will be focussed.

A list of available sessions can be shown with s.

A session can be erased with s -e <session name>.

Type s -d to detach current session.

Set window title

Just type wt <title>.

TODO

Feedback

Give me feedback if you ...