# Customizing xonsh¶

## How do I…¶

### …change the current color theme?¶

You can view the available styles by typing

$xonfig styles  For a quick peek at the theme’s colors you can do $ xonfig colors <theme name>


To set a new theme, do

XONSH_COLOR_STYLE='<theme name>'


### …import python modules from a local directory?¶

The modules available for import in a given xonsh session depend on what’s available in sys.path. If you want to be able to import a module that resides in the current directory, ensure that there is an empty string as the first element of your sys.path

$import sys$ sys.path.insert(0, '')


### …set xonsh as my default shell?¶

If you want to use xonsh as your default shell, you will first have to add xonsh to /etc/shells.

First ensure that xonsh is on your $PATH $ which xonsh


Then, as root, add xonsh to the shell list

# which xonsh >> /etc/shells


To change shells, run

$chsh -s$(which xonsh)


You will have to log out and log back in before the changes take effect.

### …select a tab completion result without executing the current line?¶

In the prompt_toolkit shell, you can cycle through possible tab-completion results using the TAB key and use ENTER to select the completion you want. By default, ENTER will also execute the current line. If you would prefer to not automatically execute the line (say, if you’re constructing a long pathname), you can set



### …color my man pages?¶

You can add add man page color support using less environment variables:

# Coloured man page support
# using 'less' env vars (format is '\E[<brightness>;<colour>m')
$LESS_TERMCAP_mb = "\033[01;31m" # begin blinking$LESS_TERMCAP_md = "\033[01;31m"     # begin bold
$LESS_TERMCAP_me = "\033[0m" # end mode$LESS_TERMCAP_so = "\033[01;44;36m"  # begin standout-mode (bottom of screen)
$LESS_TERMCAP_se = "\033[0m" # end standout-mode$LESS_TERMCAP_us = "\033[00;36m"     # begin underline
\$LESS_TERMCAP_ue = "\033[0m"         # end underline