You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.5 KiB

#!/bin/sh
# env
EDITOR="nvim"
TERMINAL="alacritty"
BROWSER="chromium"
# bin
export PATH=/home/ianmethyst/.emacs.d/bin:/home/ianmethyst/.bin:/home/ianmethyst/.local/bin:$PATH
# Enable colors
eval "`dircolors -b`"
# Add some colour to LESS/MAN pages
export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s"
export LESS='-R'
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;33m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;42;30m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;36m'
# nnn
n() {
# Block nesting of nnn in subshells
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
echo "nnn is already running"
return
fi
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
# To cd on quit only on ^G, remove the "export" as in:
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# NOTE: NNN_TMPFILE is fixed, should not be modified
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
nnn -a "$@"
if [ -f "$NNN_TMPFILE" ]; then
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
fi
}
export NNN_BMS='D:~/Documents;n:~/Nextcloud;d:~/Downloads/;s:~/Sandbox;p:~/Pictures'
export NNN_SSHFS="sshfs -o follow_symlinks" # make sshfs follow symlinks on the remote
export NNN_COLORS="2136" # use a different color for each context
export NNN_TRASH=1 # trash (needs trash-cli) instead of delete
export NNN_PLUG='p:preview-tabbed;m:nmount;c:chksum;l:launch;n:nuke;d:dragdrop'
# fzf
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# fnm
export PATH=/home/ianmethyst/.fnm:$PATH
eval "`fnm env --multi`"
# Python
# pip
export PIP_REQUIRE_VIRTUALENV=false
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)"; fi
# pipenv
export PIPENV_VENV_IN_PROJECT=1
export PIPENV_SKIP_LOCK=true
export PIPENV_PYTHON=$PYENV_ROOT/shims/python
eval "$(pipenv --completion)"
# Keychain
keychain() {
if [ -z ${DISPLAY+x} ]; then
eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)"
else
eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)"
fi
}