Skip to content
Jean-Philippe Roemer edited this page Mar 12, 2016 · 11 revisions

Now that fishline is installed, you might customize the segments you want to use or maybe use some as an fish_right_prompt.

Customizing your prompt

The first thing you might wan to do is to change the different segment shown as your prompt. By default fishline will run using STATUS JOBS PWD GIT WRITE N ROOT as its segments.

To change this behavior you just have to pass which segment you want to use to fishline when you call it in your fish_prompt function. Note that each segment name should be written in CAPITALS.

function fish_prompt
    fishline -s $status SIGSTATUS JOBS VFISH PWD GIT WRITE N ROOT
end

You can see a complete list of the available segments in the Segments section of this wiki.

Using fishline as your fish_right_prompt

Fishline is also able to print fish_right_prompt compatible output. It works exactly the same as when you are using it for your fish_prompt, you just need to call it with the -l option in your fish_right_prompt.

function fish_right_prompt
    # You can pass 0 as the last status when you are not using STATUS or SIGSTATUS
	fishline -s 0 -r CLOCK
end

Customizing the color scheme of your prompt

You can change the color scheme used by fishline using an available theme or by modifying specific environment variable.

By default fishline will load it's theme from themes/default.fish but there is other theme available in the same folder that you might want to try out or create your own.

To load a custom you just need to source (after where you sourced fishline.fish)

# After source $FLINE_PATH/fishline.fish
source $FLINE_PATH/themes/washed.fish

You can change theme when ever you want and you wont have to reload your shell session for the changes to take effect, just source the file.

It is to note that you can also change a color provided by a theme but just overriding the environment variable responsible for it. For example:

source $FLINE_PATH/themes/default.fish
set FLCLR_PWD_BG_HOME 26A
set FLCLR_PWD_FG      normal

If you want to create your own theme or modify an existing, the different environment variable responsible for the color of each segments are available in the Segments section of this wiki.


Note about backward compatibility with fishline v1

Fishline v2 introduced a lot of change on how to configure it and customize it, we've done our best to make this new version as much backward compatible as possible with the older version but some problems may occur when upgrading to this latest version.

In term of configuration, if you are using fishline as your fish_prompt using the older method to configure it, the same configuration should work just fine you will just not be able to use it as your fish_right_prompt without updating your configuration.

The older method to configuration your prompt was to set the wanted segment as an the FLINE_PROMPT environment variable and calling fishline with just the status.

set FLINE_PROMPT USERHOST FULLPWD WRITE N CLOCK ARROW
function fish_prompt
    fishine $status
end

See the release note for Fishline v2.0.0 for more information.