From 1b61337582e995e426c9973853e9610d0dddfee1 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 3 Dec 2020 01:16:54 +0100 Subject: [PATCH] zsh: reorganize --- .zprofile | 5 +++++ .zshrc => zsh/zsh-common | 24 +++--------------------- zsh/zshrc | 22 ++++++++++++++++++++++ zsh/zshrc-ohmyzsh | 29 +++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 21 deletions(-) rename .zshrc => zsh/zsh-common (63%) create mode 100644 zsh/zshrc create mode 100644 zsh/zshrc-ohmyzsh diff --git a/.zprofile b/.zprofile index 0513566..44b69c7 100644 --- a/.zprofile +++ b/.zprofile @@ -1,3 +1,8 @@ +# PATH manipulation +## for pipx +export PATH=$HOME/.local/bin:$PATH + +# QoL aliases export EDITOR="vi" export VISUAL="nvim" diff --git a/.zshrc b/zsh/zsh-common similarity index 63% rename from .zshrc rename to zsh/zsh-common index 56aedce..d87c117 100644 --- a/.zshrc +++ b/zsh/zsh-common @@ -1,29 +1,8 @@ -# Lines configured by zsh-newuser-install -HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 -setopt appendhistory -bindkey -e -# End of lines configured by zsh-newuser-install -# The following lines were added by compinstall -zstyle :compinstall filename '/home/gshipunov/.zshrc' - -autoload -Uz compinit -compinit -# End of lines added by compinstall - # Edit the command in editor autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line -# Prompt -if [[ -n $SSH_CONNECTION ]]; then - HOST_LBL="%F{red}[%m]%f" -fi - -PROMPT="%B%(?..%F{red}[%?]%f)$HOST_LBL%(!.%F{red}[%n]%f.)%F{cyan}%~%(!.%F{red}.%F{green})%# %f%b" - #### Aliases # add some color alias grep="grep --color" @@ -39,6 +18,9 @@ alias l.="ls -d .*" alias e=$EDITOR alias v=$VISUAL +# pager +export PAGER="less --quit-if-one-screen" + # platform-specific config unamestr=$(uname 2> /dev/null) case "$unamestr" in diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..4ec1f5d --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,22 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt appendhistory +bindkey -e +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '/home/gshipunov/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall + +# Prompt +if [[ -n $SSH_CONNECTION ]]; then + HOST_LBL="%F{red}[%m]%f" +fi + +PROMPT="%B%(?..%F{red}[%?]%f)$HOST_LBL%(!.%F{red}[%n]%f.)%F{cyan}%~%(!.%F{red}.%F{green})%# %f%b" + +source ./common diff --git a/zsh/zshrc-ohmyzsh b/zsh/zshrc-ohmyzsh new file mode 100644 index 0000000..d7120f4 --- /dev/null +++ b/zsh/zshrc-ohmyzsh @@ -0,0 +1,29 @@ + +# Path to your oh-my-zsh installation. +export ZSH="/home/gshipunov/.oh-my-zsh" + +ZSH_THEME="sunrise" + +DISABLE_AUTO_UPDATE="true" +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +DISABLE_UNTRACKED_FILES_DIRTY="true" + +# see 'man strftime' for details. +HIST_STAMPS="yyyy-mm-dd" + +plugins=(colorize colored-man-pages) + +source $ZSH/oh-my-zsh.sh + +# User configuration +export DOTFILES=$HOME/.files +source $DOTFILES/zsh/zsh-common +# hook direnv in +eval "$(direnv hook zsh)"