zsh: reorganize

This commit is contained in:
Grigory Shipunov 2020-12-03 01:16:54 +01:00
parent 9e9e8afd5a
commit 1b61337582
No known key found for this signature in database
GPG key ID: 77BB6C3E4771EE7C
4 changed files with 59 additions and 21 deletions

View file

@ -1,3 +1,8 @@
# PATH manipulation
## for pipx
export PATH=$HOME/.local/bin:$PATH
# QoL aliases
export EDITOR="vi" export EDITOR="vi"
export VISUAL="nvim" export VISUAL="nvim"

View file

@ -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 # Edit the command in editor
autoload -z edit-command-line autoload -z edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey "^X^E" 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 #### Aliases
# add some color # add some color
alias grep="grep --color" alias grep="grep --color"
@ -39,6 +18,9 @@ alias l.="ls -d .*"
alias e=$EDITOR alias e=$EDITOR
alias v=$VISUAL alias v=$VISUAL
# pager
export PAGER="less --quit-if-one-screen"
# platform-specific config # platform-specific config
unamestr=$(uname 2> /dev/null) unamestr=$(uname 2> /dev/null)
case "$unamestr" in case "$unamestr" in

22
zsh/zshrc Normal file
View file

@ -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

29
zsh/zshrc-ohmyzsh Normal file
View file

@ -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)"