-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.exports
116 lines (96 loc) · 4.17 KB
/
.exports
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
# Make nano the default editor for context-less editing in the terminal
export EDITOR=nano
# mise will manage our py versions
export UV_PYTHON_DOWNLOADS=never
# TODO port to mise?
# support nvmrc lazy versions
# export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_available
# customize fzf defaults (so we can keep page up/down) + some keybindings
export GIT_FUZZY_FZF_DEFAULT_OPTS="\
--border \
--layout=reverse \
--bind 'ctrl-s:toggle-sort' \
--bind 'change:top' \
--no-height"
export GIT_FUZZY_STATUS_ADD_KEY='Ctrl-A'
export GIT_FUZZY_STATUS_COMMIT_KEY='Ctrl-S'
export GIT_FUZZY_STATUS_RESET_KEY='Ctrl-R'
# https://github.com/wfxr/forgit/issues/287#issuecomment-1474824973
export FORGIT_STASH_FZF_OPTS="--bind=\"ctrl-y:execute-silent(echo {} | cut -d: -f1 | tr -d '[:space:]' | pbcopy)\""
# sort branches by commit date
export FORGIT_CHECKOUT_BRANCH_BRANCH_GIT_OPTS="--sort=-committerdate"
export FORGIT_FZF_DEFAULT_OPTS="--preview-window=nohidden"
# I use a git rebase workflow, no graphs
export FORGIT_LOG_GRAPH_ENABLE=false
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
# - always show preview on the right
# - ctrl-{u,d} scroll the preview
# - ctrl-o opens the file in vscode (or the default application)
# - ctrl-y copies the file path to the clipboard
# - ctrl-e opens the file in a CLI editor (nano)
# - ctrl-b copies the contents of the file path, at the specified line, with context, to the clipboard
export FZF_DEFAULT_OPTS="\
--bind='ctrl-u:preview-half-page-up' \
--bind='ctrl-d:preview-half-page-down' \
--bind='ctrl-o:execute-silent(~/.open-file-path.sh {})' \
--bind='ctrl-y:execute-silent(pbcopy <<< {})' \
--bind='ctrl-e:execute(~/.open-file-path.sh EDITOR {})' \
--bind='ctrl-b:execute-silent(~/.copy-with-context.sh {})' \
--preview-window 'right:70%' \
--bind='?:toggle-preview' \
--bind='+:toggle-header'
"
# TODO add +abort to quit on ctrl-o
# TODO add once 43 is released; --bind='+:toggle-header' \
# --preview-window 'down:3:hidden:wrap' \
export FZF_CTRL_R_OPTS="--preview-window up:3"
# large shell history
export HISTFILE=~/.zsh_history
export SAVEHIST=1000000
export HISTSIZE=1000000
# Make some commands not show up in history
# remove commands from history: `LC_ALL=C sed -i '' '/sudo hostile.*/d' $HISTFILE`
export HISTORY_IGNORE="(ls*|pwd|exit|cd*|gc*|* --help|history|j *|jj *|glo|gfu|g st|g ss|sudo hostile*|*throttle-internet*)"
# autocomplete on completions as well
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
# faster git status loading for large repos
export PURE_GIT_UNTRACKED_DIRTY=1
# env config for compatibility with omz
export ZSH=${HOME}/.zsh
export ZSH_CACHE_DIR=${ZSH}/cache
# encoding
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# without this some CLI tools (gh cli, for instance) do not page contents
export PAGER=less
# Don’t clear the screen after quitting a manual page
export MANPAGER="less -FX"
# more powerful less config
# https://www.topbug.net/blog/2016/09/27/make-gnu-less-more-powerful/
export LESS='--quit-if-one-screen --ignore-case --status-column --LONG-PROMPT --RAW-CONTROL-CHARS --HILITE-UNREAD --tabs=4 --window=-4'
# TODO add configuration to autocolor less output https://superuser.com/a/564531?
# TODO or use bat instead? Appartently it can be used as a pager as well?
# elixir
export ERL_AFLAGS="-kernel shell_history enabled"
# https://stackoverflow.com/questions/74559444/how-to-fix-vscode-extension-elixirls-alert-otp-compiled-without-eep48-documenta
export KERL_BUILD_DOCS=yes
# python
export IPDB_CONTEXT_SIZE=10
# command to use for `breakpoint()`
export PYTHONBREAKPOINT=ipdb.set_trace
# Make Python use UTF-8 encoding for output to stdin, stdout, and stderr.
export PYTHONIOENCODING='UTF-8'
# https://www.erdaltaskesen.com/blog/how-to-remove-pycache-folders-and-pyc-files/
# https://github.com/pytest-dev/pytest/issues/200
export PYTHONDONTWRITEBYTECODE=1
# don't buffer stdout/stderr
export PYTHONUNBUFFERED=1
export PYTHONDEVMODE=1
export PYTHONWARNINGS="ignore::DeprecationWarning,ignore:ResourceWarning"
# not standard python, but used in many libraries
export PY_COLORS=1
export PYTHONFAULTHANDLER=1
# ensures that code does not rely on dict order
export PYTHONHASHSEED=random
export PYTHONFAULTHANDLER=1
export PYTHONSAFEPATH=1