diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-08-19 17:22:20 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-08-19 17:22:20 +0100 |
commit | b1673e899ec30f25b71cdc9d1ffd6c8246634191 (patch) | |
tree | 230fa6c7da9cfd47e2bdc9dad03ceaa6529e7f17 /zsh | |
parent | 31d4d690b69b844f319fd0dcb15cb0e0f6511217 (diff) | |
parent | 2c6a2e578286509eed8c76487e43dbb9a7bf83ea (diff) | |
download | dotfiles-b1673e899ec30f25b71cdc9d1ffd6c8246634191.tar.gz dotfiles-b1673e899ec30f25b71cdc9d1ffd6c8246634191.zip |
Merge branch 'master' of github.com:ymherklotz/dotfiles into master
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zsh/export.zsh | 63 | ||||
-rw-r--r-- | zsh/.zsh/function.zsh | 8 | ||||
-rw-r--r-- | zsh/.zsh/startup.zsh | 5 | ||||
-rw-r--r-- | zsh/.zshrc | 24 |
4 files changed, 62 insertions, 38 deletions
diff --git a/zsh/.zsh/export.zsh b/zsh/.zsh/export.zsh index 0793ae2..b6a400f 100644 --- a/zsh/.zsh/export.zsh +++ b/zsh/.zsh/export.zsh @@ -1,19 +1,43 @@ -export GITHUB_HOME=$HOME/Github +os=$(uname -s) + +. $HOME/.nix-profile/etc/profile.d/nix.sh + +[ -n "$SSH_CLIENT" ] && export MINIMAL_USER_CHAR="$(hostname)" + +export GITHUB_HOME=$HOME/Projects export FZF_DEFAULT_COMMAND='fd --type file --hidden --no-ignore' export ALTERNATE_EDITOR="emacs -nw -Q" export EDITOR='emacsclient -nw' export VISUAL='emacsclient -c' export TERM='xterm-256color' +export CLICOLOR=1 + +prepend_path() { + [ -d "$1" ] && PATH="$1:$PATH" +} + +append_path() { + [ -d "$1" ] && PATH="$PATH:$1" +} + +if [ $os = "Darwin" ]; then + prepend_path "/Library/TeX/texbin" + prepend_path "/usr/local/opt/bison/bin" + + append_path "${HOME}/Library/Python/3.8/bin" +fi + +prepend_path "/usr/local/bin" +prepend_path "${HOME}/.gem/ruby/2.7.0/bin" +prepend_path "${HOME}/.yarn/bin" +prepend_path "${HOME}/.cargo/bin" +prepend_path "${HOME}/.cabal/bin" +prepend_path "${HOME}/.local/bin" -export PATH="${HOME}/.gem/ruby/2.6.0/bin:/usr/local/bin:${PATH}" -export PATH="/usr/bin:${PATH}" -export PATH="${HOME}/.yarn/bin:${PATH}" -export PATH="${PATH}:/opt/Xilinx/Vivado/2019.1/bin" -export PATH="${PATH}:/opt/intelFPGA_lite/18.1/quartus/bin" -export PATH="${HOME}/.local/bin:${PATH}" -export PATH="${HOME}/.cargo/bin:${PATH}" -export PATH="${HOME}/.cabal/bin:${PATH}" -if [[ -d "${HOME}/.gem/ruby/2.7.0/bin" ]]; then export PATH="${HOME}/.gem/ruby/2.7.0/bin:${PATH}"; fi +append_path "/opt/Xilinx/Vivado/2019.1/bin" +append_path "/opt/intelFPGA_lite/18.1/quartus/bin" + +export PATH if [[ -n $SSH_CLIENT ]]; then export MINIMAL_USER_CHAR="$(hostname)" @@ -23,6 +47,21 @@ fi export DOTNET_CLI_TELEMETRY_OPTOUT=1 # Fix java windows for tiling window managers -export _JAVA_AWT_WM_NONREPARENTING=1 +[ $os = "Linux" ] && export _JAVA_AWT_WM_NONREPARENTING=1 + +# Direnv hook setup +command -v direnv >/dev/null 2>&1 +[ "$?" -eq 0 ] && eval "$(direnv hook zsh)" + +# Opam hook setup and initialising it +command -v opam >/dev/null 2>&1 +if [ "$?" -eq 0 ]; then + test -r /home/yannherklotz/.opam/opam-init/init.zsh && . /home/yannherklotz/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true + eval "$(opam env)"; +fi + +# Load rust environment +[ -r "$HOME/.cargo/env" ] && source $HOME/.cargo/env -eval "$(direnv hook zsh)" +# Travis +[ -r "$HOME/.travis/travis.sh" ] && source "$HOME/.travis/travis.sh" diff --git a/zsh/.zsh/function.zsh b/zsh/.zsh/function.zsh index b4cc40a..809471e 100644 --- a/zsh/.zsh/function.zsh +++ b/zsh/.zsh/function.zsh @@ -1,12 +1,8 @@ -alias fdisk='fdisk --color=always' -alias grep='grep --color=always' -alias ls='ls --color=always' -alias l='ls -la --color=always' -alias vi='nvim' -alias vim='nvim' alias emc='emacsclient -c -a ""' alias em='emacsclient -nw -a ""' +alias ls='exa' alias ff='firefox' +alias vim=nvim # alias lspasscp='lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\\]//g')' # fixing pdflatex diff --git a/zsh/.zsh/startup.zsh b/zsh/.zsh/startup.zsh index 2002337..67716ac 100644 --- a/zsh/.zsh/startup.zsh +++ b/zsh/.zsh/startup.zsh @@ -2,9 +2,4 @@ if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' fi - -# direnv - # End Nix - -eval $(opam env) @@ -25,24 +25,18 @@ setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE setopt HIST_FIND_NO_DUPS -(cat ~/.cache/wal/sequences &) >/dev/null 2>&1 +if [ -d ~/.cache/wal ]; then (cat ~/.cache/wal/sequences &) fi # Sourcing everything -source /usr/share/fzf/key-bindings.zsh -source /usr/share/fzf/completion.zsh -source $HOME/.zsh/export.zsh -source $HOME/.zsh/minimal.zsh -source $HOME/.zsh/function.zsh -source $HOME/.zsh/startup.zsh -source $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh -source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +if [ -e /usr/share/fzf/key-bindings.zsh ]; then source /usr/share/fzf/key-bindings.zsh; fi +if [ -e /usr/share/fzf/completion.zsh ]; then source /usr/share/fzf/completion.zsh; fi +if [ -e $HOME/.zsh/export.zsh ]; then source $HOME/.zsh/export.zsh; fi +if [ -e $HOME/.zsh/minimal.zsh ]; then source $HOME/.zsh/minimal.zsh; fi +if [ -e $HOME/.zsh/function.zsh ]; then source $HOME/.zsh/function.zsh; fi +if [ -e $HOME/.zsh/startup.zsh ]; then source $HOME/.zsh/startup.zsh; fi +if [ -e $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then source $HOME/.zsh/zsh-history-substring-search/zsh-history-substring-search.zsh; fi +if [ -e $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh; fi bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down bindkey -M emacs '^P' history-substring-search-up bindkey -M emacs ^N history-substring-search-down - -# opam configuration -test -r /home/yannherklotz/.opam/opam-init/init.zsh && . /home/yannherklotz/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true - -# added by travis gem -[ -f /home/ymherklotz/.travis/travis.sh ] && source /home/ymherklotz/.travis/travis.sh |