From 9b51c6a61aabe32c1ece4ce08961d27f4b777262 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 24 Aug 2021 20:36:50 -0500 Subject: [PATCH] Move environment variables to their own file --- dot_envvar | 46 +++++++++++++++++++++++++++++++++++++++++++ executable_dot_bashrc | 2 ++ executable_dot_zshrc | 34 +------------------------------- 3 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 dot_envvar diff --git a/dot_envvar b/dot_envvar new file mode 100644 index 0000000..37e1a33 --- /dev/null +++ b/dot_envvar @@ -0,0 +1,46 @@ +# Enable pipx completions +if [ $(command -v pipx) ]; then + eval "$(register-python-argcomplete pipx)" +fi + +# Preferred editor for local and remote sessions +if [ $(command -v nano) ]; then + export EDITOR=nano +elif [ $(command -v emacs) ]; then + export EDITOR='emacs -nw' +elif [ $(command -v vim) ]; then + export EDITOR=vim +fi + +if [ $(command -v kate) ]; then + export VISUAL=kate +elif [ $(command -v code) ]; then + export VISUAL=code +elif [ $(command -v emacs) ]; then + export VISUAL=emacs +fi + +# Set a cool new pager with color support +if [[ $(command -v most) ]]; then + export PAGER=most +fi + + +# Replace cat with bat +if [[ $(command -v bat) ]]; then + export BAT_PAGER="less -RF" + export MANPAGER="sh -c 'col -bx | bat -l man -p'" + export MANROFFOPT="-c" +fi + +# Add notification support for long-running processes +if [[ $(command -v ntfy) ]]; then + eval "$(ntfy shell-integration --longer-than 30)" + export AUTO_NTFY_DONE_IGNORE="vim nano emacs kate zshconfig screen tmux ssh top htop less more most nethogs 'singularity shell' julia man" +fi + +# Set the Nextflow enviroment caches +export NXF_HOME="$HOME/.nextflow" +export NXF_CONDA_CACHEDIR="$NXF_HOME/conda" +export NXF_SINGULARITY_CACHEDIR="$NXF_HOME/singularity" +export NXF_CHARLIECLOUD_CACHEDIR="$NXF_HOME/charlie" diff --git a/executable_dot_bashrc b/executable_dot_bashrc index cfbc0a8..7e8104c 100644 --- a/executable_dot_bashrc +++ b/executable_dot_bashrc @@ -31,5 +31,7 @@ conda config --set changeps1 true eval "$(direnv hook bash)" # <<< direnv initalize <<< +source $HOME/.envvar + # Make the prompt pretty, just in case we're stuck in bash land export PS1="[\[\e[32m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\] \[\e[34m\]\W\[\e[m\]] \\$ " diff --git a/executable_dot_zshrc b/executable_dot_zshrc index 52931d0..e1f5bd9 100644 --- a/executable_dot_zshrc +++ b/executable_dot_zshrc @@ -89,42 +89,10 @@ antigen apply autoload -U bashcompinit bashcompinit -# Enable pipx completions -if [[ $(command -v pipx) ]]; then - eval "$(register-python-argcomplete pipx)" -fi - -# Preferred editor for local and remote sessions -if [[ $(command -v nano) ]]; then - export EDITOR=nano -fi - -# Set a cool new pager with color support -if [[ $(command -v most) ]]; then - export PAGER=most -fi +source $HOME/.envvar alias zshconfig="$EDITOR ~/.zshrc" source $HOME/.aliases -# Replace cat with bat -if [[ $(command -v bat) ]]; then - export BAT_PAGER="less -RF" - export MANPAGER="sh -c 'col -bx | bat -l man -p'" - export MANROFFOPT="-c" -fi - -# Add notification support for long-running processes -if [[ $(command -v ntfy) ]]; then - eval "$(ntfy shell-integration --longer-than 30)" - export AUTO_NTFY_DONE_IGNORE="vim nano emacs zshconfig screen tmux ssh top htop less more most nethogs 'singularity shell' julia man" -fi - -# Set the Nextflow enviroment caches -export NXF_HOME="$HOME/.nextflow" -export NXF_CONDA_CACHEDIR="$NXF_HOME/conda" -export NXF_SINGULARITY_CACHEDIR="$NXF_HOME/singularity" -export NXF_CHARLIECLOUD_CACHEDIR="$NXF_HOME/charlie" - # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh