12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- $VI_MODE = True
- $AUTO_PUSHD = True
- $XONSH_AUTOPAIR = True
- xontrib load vox z
- def _last_exit_status():
- try:
- exit_status = __xonsh_history__.rtns[-1]
- return exit_status if exit_status > 0 else None
- except IndexError:
- return None
- $PROMPT_FIELDS['last_exit_status'] = _last_exit_status
- $XONSH_STDERR_PREFIX = '{RED}'
- $XONSH_STDERR_POSTFIX = '{NO_COLOR}'
- $DYNAMIC_CWD_WIDTH = '40%'
- $PROMPT = ''.join([
- '{RED}{last_exit_status:[{}] }',
- '{BOLD_GREEN}{user}@{hostname} ',
- '{YELLOW}{cwd} ',
- '{BLUE}{prompt_end} ',
- '{NO_COLOR}',
- ])
- $RIGHT_PROMPT = '{gitstatus}{env_name: {}}'
- import datetime as dt
- import dateutil.tz
- import os
- import re
- $EDITOR = 'vim'
- # required by pinentry-tty when using gpg command:
- $GPG_TTY = $(tty)
- # wrapper for termite required when launching termite from ranger:
- $TERMCMD = os.path.join(os.path.dirname(__file__), 'ranger-termite-termcmd')
- def locate(*patterns, match_all=True, ignore_case=True):
- params = []
- if match_all:
- params.insert(0, '--all')
- if ignore_case:
- params.insert(0, '--ignore-case')
- return $(locate @(params) -- @(patterns)).split('\n')[:-1]
- def timestamp_iso():
- return dt.datetime.now(tz=dateutil.tz.tzlocal()) \
- .strftime('%Y%m%dT%H%M%S%z')
- aliases['ll'] = ['ls', '-l', '--all', '--indicator-style=slash', '--human-readable', '--time-style=long-iso', '--color=auto']
- # vim: filetype=python
|