-
Notifications
You must be signed in to change notification settings - Fork 1
/
.xonshrc
162 lines (134 loc) · 4.72 KB
/
.xonshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# xontribs
# - bashisms
# - xontirb-readable-traceback
### - xontrib-z - https://github.com:dyuri/xontrib-z @ zoxide
# - xontrib-zoxide
# - xontrib-ssh-agent
# - xontrib-langenv <= (xontrib-pyenv)
# - xontrib-repa-prompt => xontrib-powerline-binding
# ptk deprecationwarning
__import__('warnings').filterwarnings('ignore', 'There is no current event loop', DeprecationWarning, 'prompt_toolkit.eventloop.utils')
$XONSH_COLOR_STYLE="monokai"
$FOREIGN_ALIASES_SUPPRESS_SKIP_MESSAGE=True
$UPDATE_OS_ENVIRON = True
$PROMPT_TOOLKIT_COLOR_DEPTH='DEPTH_24_BIT'
$XONSH_SHOW_TRACEBACK=False
$COMPLETIONS_DISPLAY='single'
$HISTCONTROL='ignoredups,erasedups'
$ENABLE_ASYNC_PROMPT=True
#$THREAD_SUBPROCS=False # disable subprocess threading
$VC_BRANCH_TIMEOUT=.2
$NPM_PACKAGES=$HOME+'/.npm'
$GOPATH="/home/dyuri/egyeb/prog/go"
$PYENV_ROOT=$HOME+"/.pyenv"
$NODENV_ROOT=$HOME+"/.nodenv"
$PATH=[$HOME+'/bin', $HOME+'/.local/bin', $HOME+'/.cargo/bin'] + $PATH
$PATH=$PATH + [$NODENV_ROOT+'/shims', $PYENV_ROOT+'/bin', $PYENV_ROOT+'/shims', $PYENV_ROOT+'/plugins/pyenv-virtualenv/shims']
$PATH.append($NPM_PACKAGES+'/bin')
$PATH.append($GOPATH[0]+'/bin')
# $GO111MODULE="on"
$SDL_AUDIODRIVER="pulse"
$AUDIODEV="default"
$PYTHONSTARTUP=$HOME+"/.pythonrc"
$BROWSER="/home/dyuri/bin/google-chrome"
# $BINARY_SSH="/bin/ssh"
# amd vulkan
$VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json"
# start powerline daemon
powerline-daemon -q
# xontrib load bashisms
# xontrib load direnv # breaks :(
# xontrib load repa_prompt
xontrib load powerline_binding
xontrib load readable-traceback
xontrib load ssh_agent
xontrib load pyenv
#xontrib load nodenv
xontrib load kitty
#xontrib load jedi
xontrib load gitinfo
# xontrib load z
xontrib load zoxide
xontrib load termcolors
xontrib load autoxsh
xontrib load xonsh_cctrlw
xontrib load pyrtn
# xontrib load term_integration
xontrib load abbrevs
$AXSH_CHECK_PARENTS = True
$XONSH_HISTORY_FILE = $HOME+"/.local/share/xonsh/xonsh-history.sqlite"
$XONSH_HISTORY_BACKEND = "sqlite"
# *** FZF ***
xontrib load fzf-widgets
$fzf_history_binding = "c-r"
# $FZF_DEFAULT_COMMAND='rg --files --no-ignore --no-ignore-vcs --hidden --follow --glob "!.git/*" --glob "!.hg/*"'
$FZF_DEFAULT_COMMAND="fd --type file --color=always --follow --hidden --exclude .git --exclude .hg"
# $FZF_DEFAULT_OPTS="--ansi --preview-window 'right:60%' --preview 'bat --color=always --style=header,grid --line-range :100 {}'"
$FZF_DEFAULT_OPTS="--color 'bg:0,bg+:2,fg:8,fg+:15,hl:10,hl+:11,prompt:11,info:3,marker:11,pointer:11,spinner:1' --ansi --height 10"
# dircolors
source-bash $(dircolors ~/config/dircolors/dircolors.molokai)
# kitty diff
if $TERM == 'xterm-kitty':
aliases['d'] = ["kitty", "+kitten", "diff"]
# nvm TODO
#$NVM_DIR = "~/.nvm"
#source-bash $NVM_DIR/nvm.sh
# sudo askpass for non SSH sessions
if 'SSH_CLIENT' not in ${...}:
aliases['sudo'] = 'sudo -A'
$SUDO_ASKPASS = '/home/dyuri/bin/askpass-rofi'
$SSH_ASKPASS = '/home/dyuri/bin/askpass-rofi'
# aliases
aliases['ls']=["ls", "--color=auto", "-F", "-b", "-T 0"]
aliases['ll']='exa -la --git --classify --group-directories-first'
aliases['jsonpp']='python -mjson.tool'
aliases['bible']='shuf -n 1 ~/txt/bible.txt'
aliases['vim']='nvim'
aliases['vimdiff']='nvim -d'
aliases['gvim']='neovide'
aliases['gtop']='glances'
aliases['lg']='lazygit'
aliases['cat']='bat'
aliases['ping']='prettyping --nolegend'
aliases['fzvim']='vim `fzf`'
aliases['py']='ipython'
aliases['mosh']=['mosh', '--ssh=repassh']
aliases['watch']='viddy'
# abbrevs
abbrevs['!$'] = lambda buffer, word: _.args[-1]
abbrevs['!!'] = lambda buffer, word: " ".join(_.args)
# json
try:
import __builtin__
except ImportError:
import builtins as __builtin__
__builtin__.true = True
__builtin__.false = False
__builtin__.null = None
# f*
def __fixit(f_bin, f_hist):
import subprocess
p = subprocess.Popen([f_bin, f_hist], stdout=subprocess.PIPE)
out, _ = p.communicate()
execx(out.decode("utf-8"))
aliases["f"] = "__fixit($(which thefuck), $(history -1))"
# MOTD
go-repamotd
#### custom styles
def _style_to_dict(name):
from itertools import chain
from xonsh.pyghooks import get_style_by_name, STYLES
return {str(k):v for k, v in chain(STYLES[name].items(), get_style_by_name(name).styles.items())}
def _style_to_json(name):
import json
return json.dumps(style_to_dict(name), indent=2)
def style_from_json(name, jsonfile, base="default"):
import json
from xonsh.tools import register_custom_style
with open(jsonfile) as f:
styledict = json.load(f)
return register_custom_style(name, styledict, base)
gb = style_from_json("gruvbox", "/home/dyuri/config/xonsh/gruvbox.style.json", "monokai")
$XONSH_COLOR_STYLE="gruvbox"
$PTK_STYLE_OVERRIDES = {}
# vim: ft=python