From 5556e6bf3149c0c1664d6d747f2b83e4e34468f0 Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Tue, 16 Apr 2024 15:08:35 +0800 Subject: [PATCH] envrc more flex --- sync.linux.json | 10 +++---- sync.termux.json | 10 +++---- zsh/{public.custom.zsh => custom.zsh} | 8 ++++-- zsh/env.example.zsh | 39 +++++++++++++++++++++++++++ zsh/linux.env.zsh | 23 ---------------- zsh/termux.env.zsh | 28 ------------------- zsh/{public.zshrc.zsh => zshrc.zsh} | 10 +++---- 7 files changed, 56 insertions(+), 72 deletions(-) rename zsh/{public.custom.zsh => custom.zsh} (86%) create mode 100644 zsh/env.example.zsh delete mode 100644 zsh/linux.env.zsh delete mode 100644 zsh/termux.env.zsh rename zsh/{public.zshrc.zsh => zshrc.zsh} (100%) diff --git a/sync.linux.json b/sync.linux.json index cd1db4d..d12e28d 100644 --- a/sync.linux.json +++ b/sync.linux.json @@ -1,17 +1,13 @@ { "backups": [ { - "path": "zsh/public.zshrc.zsh", + "path": "zsh/zshrc.zsh", "source": "~/.zshrc" }, { - "path": "zsh/public.custom.zsh", + "path": "zsh/custom.zsh", "source": "~/.customrc" }, - { - "path": "zsh/linux.env.zsh", - "source": "~/.envrc" - }, { "path": "zsh/p10k.zsh", "source": "~/.p10k.zsh" @@ -33,4 +29,4 @@ "source": "~/.config/hyfetch.json" } ] -} \ No newline at end of file +} diff --git a/sync.termux.json b/sync.termux.json index 2eaa3aa..d12e28d 100644 --- a/sync.termux.json +++ b/sync.termux.json @@ -1,17 +1,13 @@ { "backups": [ { - "path": "zsh/public.zshrc.zsh", + "path": "zsh/zshrc.zsh", "source": "~/.zshrc" }, { - "path": "zsh/public.custom.zsh", + "path": "zsh/custom.zsh", "source": "~/.customrc" }, - { - "path": "zsh/termux.env.zsh", - "source": "~/.envrc" - }, { "path": "zsh/p10k.zsh", "source": "~/.p10k.zsh" @@ -33,4 +29,4 @@ "source": "~/.config/hyfetch.json" } ] -} \ No newline at end of file +} diff --git a/zsh/public.custom.zsh b/zsh/custom.zsh similarity index 86% rename from zsh/public.custom.zsh rename to zsh/custom.zsh index f699711..1b2820e 100644 --- a/zsh/public.custom.zsh +++ b/zsh/custom.zsh @@ -1,10 +1,14 @@ #!/bin/zsh #--- zshrc ---# -edit_profile () { - code -n -w $profile + +profile () { source $profile } +profile-edit () { + $POPUP_EDIT $profile + profile +} #--- bat (cat) ---# alias cat='bat' diff --git a/zsh/env.example.zsh b/zsh/env.example.zsh new file mode 100644 index 0000000..41b6d69 --- /dev/null +++ b/zsh/env.example.zsh @@ -0,0 +1,39 @@ +#!/bin/zsh + +#--- System Environments ---# + +# export MANPATH="/usr/local/man:$MANPATH" + +#- You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +#- Compilation flags +# export ARCHFLAGS="-arch x86_64" + +#--- Editor (for normal system local/remote) ---# +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='code' + export POPUP_EDIT='code -n -w' +else + export EDITOR='vim' + export POPUP_EDIT='vim' +fi +#--- Editor: EMacs as Code (for termux only) ---# +alias vim='nvim' +export PATH="$PATH:$HOME/.config/doom/bin" +alias code='emacs' +export EDITOR='code' +export POPUP_EDIT='code' + +#--- Environment Variables ---# + +# System Mounts +export windows="/mnt/c" +export data="/mnt/s" +export external="/storage/54D5-A5C0" +# Home Configs +export profile="$HOME/.zshrc" +export config="$HOME/.config" +# Workspaces +export ws="$HOME/documents/workspaces" +export tests="$data/__test" diff --git a/zsh/linux.env.zsh b/zsh/linux.env.zsh deleted file mode 100644 index 1ab0c0b..0000000 --- a/zsh/linux.env.zsh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/zsh - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='code' -else - export EDITOR='vim' -fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# System Related Path Variables -export profile="$HOME/.zshrc" -export config="$HOME/.config" -# Workspaces -export ws="$HOME/documents/worksapce" -export tests="$HOME/documents/__test" diff --git a/zsh/termux.env.zsh b/zsh/termux.env.zsh deleted file mode 100644 index ae7ab40..0000000 --- a/zsh/termux.env.zsh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/zsh - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='code' -# else -# export EDITOR='code' -# fi -#--- EMacs as Code (for termux only) ---# -export PATH="$PATH:$HOME/.config/doom/bin" -alias code='emacs' -export EDITOR='code' - - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# System Related Path Variables -export profile="$HOME/.zshrc" -export config="$HOME/.config" -# Workspaces -export ws="$HOME/documents/worksapce" -export tests="$HOME/documents/__test" diff --git a/zsh/public.zshrc.zsh b/zsh/zshrc.zsh similarity index 100% rename from zsh/public.zshrc.zsh rename to zsh/zshrc.zsh index 31285f2..bac1f9e 100644 --- a/zsh/public.zshrc.zsh +++ b/zsh/zshrc.zsh @@ -92,10 +92,10 @@ plugins=( source $ZSH/oh-my-zsh.sh -# User configuration - -source $HOME/.envrc -source $HOME/.customrc - # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + + +# User configuration +source $HOME/.envrc +source $HOME/.customrc