zsh config cleanup

This commit is contained in:
dalahast 2020-05-18 11:06:15 +02:00
parent 825bcaa45f
commit ba1032317f
5 changed files with 59 additions and 45 deletions

2
.config/zsh/aliases.zsh Normal file

@ -0,0 +1,2 @@
alias hstat="stat -c \"%A %a %n\" *"
alias rsync="rsync -P -r"

@ -0,0 +1,6 @@
function cpr() {
rsync --archive -hh --partial --info=stats1 --info=progress2 --modify-window=1 "$@"
}
function mvr() {
rsync --archive -hh --partial --info=stats1 --info=progress2 --modify-window=1 --remove-source-files "$@"
}

35
.config/zsh/keybinds.zsh Normal file

@ -0,0 +1,35 @@
bindkey -v
# If NumLock is off, translate keys to make them appear the same as with NumLock on.
bindkey -s '^[OM' '^M' # enter
bindkey -s '^[Ok' '+'
bindkey -s '^[Om' '-'
bindkey -s '^[Oj' '*'
bindkey -s '^[Oo' '/'
bindkey -s '^[OX' '='
# If someone switches the terminal to application mode (smkx), translate keys to make
# them appear the same as in raw mode (rmkx).
bindkey -s '^[OH' '^[[H' # home
bindkey -s '^[OF' '^[[F' # end
bindkey -s '^[OA' '^[[A' # up
bindkey -s '^[OB' '^[[B' # down
bindkey -s '^[OD' '^[[D' # left
bindkey -s '^[OC' '^[[C' # right
# TTY sends different key codes. Translate them to regular.
bindkey -s '^[[1~' '^[[H' # home
bindkey -s '^[[4~' '^[[F' # end
bindkey '^?' backward-delete-char # bs delete one char backward
bindkey '^[[3~' delete-char # delete delete one char forward
bindkey '^[[H' beginning-of-line # home go to the beginning of line
bindkey '^[[F' end-of-line # end go to the end of line
bindkey '^[[1;5C' forward-word # ctrl+right go forward one word
bindkey '^[[1;5D' backward-word # ctrl+left go backward one word
bindkey '^H' backward-kill-word # ctrl+bs delete previous word
bindkey '^[[3;5~' kill-word # ctrl+del delete next word
bindkey '^J' backward-kill-line # ctrl+j delete everything before cursor
bindkey '^[[D' backward-char # left move cursor one char backward
bindkey '^[[C' forward-char # right move cursor one char forward
bindkey '^[[A' up-line-or-beginning-search # up prev command in history
bindkey '^[[B' down-line-or-beginning-search # down next command in history

1
.config/zsh/plugins Symbolic link

@ -0,0 +1 @@
/home/drew/.oh-my-zsh/custom/plugins

60
.zshrc

@ -1,23 +1,11 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH="/home/drew/.oh-my-zsh" export ZSH="/home/drew/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will # Set name of the theme to load
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="agnoster" ZSH_THEME="agnoster"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion. # Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true" CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. # Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable. # Case-sensitive completion must be off. _ and - will be interchangeable.
@ -27,10 +15,10 @@ ZSH_THEME="agnoster"
# DISABLE_AUTO_UPDATE="true" # DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting. # Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true" DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days). # Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13 export UPDATE_ZSH_DAYS=14
# Uncomment the following line if pasting URLs and other text is messed up. # Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true # DISABLE_MAGIC_FUNCTIONS=true
@ -41,11 +29,8 @@ ZSH_THEME="agnoster"
# Uncomment the following line to disable auto-setting terminal title. # Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true" # DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion. # Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true" COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files # Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories # under VCS as dirty. This makes repository status check for large repositories
@ -61,7 +46,7 @@ ZSH_THEME="agnoster"
# HIST_STAMPS="mm/dd/yyyy" # HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom? # Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder ZSH_CUSTOM=~/.config/zsh
# Which plugins would you like to load? # Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/* # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
@ -81,41 +66,26 @@ source $ZSH/oh-my-zsh.sh
# User configuration # User configuration
# export MANPATH="/usr/local/man:$MANPATH" export LANG=en_US.UTF-8
# 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='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags # Compilation flags
# export ARCHFLAGS="-arch x86_64" # export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Lines configured by zsh-newuser-install # Lines configured by zsh-newuser-install
HISTFILE=~/.histfile HISTFILE=~/.histfile
HISTSIZE=1000 HISTSIZE=10000
SAVEHIST=1000 SAVEHIST=10000
setopt appendhistory autocd extendedglob setopt appendhistory autocd extendedglob
unsetopt beep unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install # End of lines configured by zsh-newuser-install
# The following lines were added by compinstall # The following lines were added by compinstall
zstyle :compinstall filename '/home/drew/.zshrc' zstyle :compinstall filename '/home/drew/.zshrc'
autoload -Uz compinit autoload -Uz compinit
compinit compinit
# End of lines added by compinstall
prompt_context(){} prompt_context(){}
autoload -Uz up-line-or-beginning-search
autoload -Uz down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search