From 19d9739151bb92ddf9af77efa7b41d16a0971ff1 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 20 Feb 2022 09:28:22 +0400 Subject: Moved zsh config to home directory --- .config/zsh/.zshrc | 54 ------------------------------------------------------ .profile | 11 +++++------ .zshrc | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 60 deletions(-) delete mode 100644 .config/zsh/.zshrc create mode 100644 .zshrc diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc deleted file mode 100644 index e2ede69..0000000 --- a/.config/zsh/.zshrc +++ /dev/null @@ -1,54 +0,0 @@ -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto --group-directories-first' - alias gcc='gcc -fdiagnostics-color=always' - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' - alias pacman='pacman --color=always' - alias yay='yay --color=always' -fi - -# Aliases -alias la='ls -lhFA' -alias ll='ls -lhF' -alias l='ls -CF' -alias dotfiles="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME'" -alias dotstat="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' status" -alias dotdiff="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' diff" -alias dotadd="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' add -f" -alias e="$EDITOR" - -# XDG aliases -alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"' -alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' -alias sqlite3='sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc' - - -# ZSH config -HISTFILE=~/.cache/zsh/histfile -HISTSIZE=1000 -SAVEHIST=1000 -setopt extendedglob nomatch -unsetopt autocd beep -bindkey -e -zstyle :compinstall filename '/home/andrew/.zshrc' -autoload -Uz compinit -compinit -d $XDG_CACHE_HOME/zsh/zcompdump - -cdf() { - cd $(find ~ -type d &>/dev/null | fzf) -} - -set_ps1() { - # red color if current user us root, otherwise - green - [ "$USER" = "root" ] && UCOLOR="%B%F{red}" || UCOLOR="%B%F{green}" - [ "$USER" = "root" ] && END="#" || END="$" - BLUE="%B%F{blue}" - PURPLE="%B%F{magenta}" - STOP="%f%b" - export PS1="%T $UCOLOR%n$STOP@$PURPLE%m$STOP:$BLUE%~$STOP $END " -} - -set_ps1 diff --git a/.profile b/.profile index 422b03b..e9a0ba6 100644 --- a/.profile +++ b/.profile @@ -1,10 +1,10 @@ # set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then - PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')" + PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | paste -s -d ':' -)" fi export SHELL="/bin/zsh" -export EDITOR="emacs -nw" +export EDITOR="vim" # For Jetbrains products export _JAVA_AWT_WM_NONREPARENTING=1 @@ -13,7 +13,6 @@ export _JAVA_AWT_WM_NONREPARENTING=1 export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" -# export XDG_RUNTIME_DIR="" # XDG Specific configs export MYVIMRC="$XDG_CONFIG_HOME/nvim/init.vim" @@ -27,7 +26,6 @@ export KODI_DATA="$XDG_DATA_HOME/kodi" export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" export PYLINTHOME="$XDG_CACHE_HOME/pylint" export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history" export LESSKEY="$XDG_CONFIG_HOME/less/lesskey" export LESSHISTFILE=- @@ -67,8 +65,9 @@ export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle" export CARGO_HOME="$XDG_DATA_HOME/cargo" export RUSTUP_HOME="$XDG_DATA_HOME/rustup" +# Go export GOPATH="$XDG_DATA_HOME/go" +export PATH="$PATH:/opt/homebrew/bin" export PATH="$PATH:$CARGO_HOME/bin:$GOPATH/bin:$GEM_HOME/bin" -export PATH="$PATH:$(du $GEM_HOME/ruby/*/bin | cut -f2 | paste -sd ':')" - +export PATH="$PATH:$(du $GEM_HOME/ruby/*/bin | cut -f2 | paste -s -d ':' -)" diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..152b0f1 --- /dev/null +++ b/.zshrc @@ -0,0 +1,53 @@ +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ] || [ "$(uname)" = "Darwin" ]; then + alias ls='ls --color=auto' + alias gcc='gcc -fdiagnostics-color=always' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' + alias pacman='pacman --color=always' + alias yay='yay --color=always' +fi + +# Aliases +alias la='ls -lhFA' +alias ll='ls -lhF' +alias l='ls -CF' +alias dotfiles="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME'" +alias dotstat="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' status" +alias dotdiff="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' diff" +alias dotadd="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' add -f" +alias e="$EDITOR" + +# XDG aliases +alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"' +alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' +alias sqlite3='sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc' + +# ZSH config +HISTFILE=~/.cache/zsh/histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt extendedglob nomatch +unsetopt autocd beep +bindkey -e +autoload -Uz compinit +compinit -d $XDG_CACHE_HOME/zsh/zcompdump + +cdf() { + cd "$(find ~ -type d &>/dev/null | fzf)" +} + +set_ps1() { + # red color if current user us root, otherwise - green + [ "$USER" = "root" ] && UCOLOR="%B%F{red}" || UCOLOR="%B%F{green}" + [ "$USER" = "root" ] && END="#" || END="$" + BLUE="%B%F{blue}" + PURPLE="%B%F{magenta}" + STOP="%f%b" + export PS1="%T $UCOLOR%n$STOP@$PURPLE%m$STOP:$BLUE%~$STOP $END " +} + +set_ps1 + +fortune -s | cowsay -- cgit v1.2.3