changing up the structure for the zsh config.
This commit is contained in:
parent
52c4f6469f
commit
f5bf68c2c7
|
@ -0,0 +1,5 @@
|
||||||
|
alias rmdir='rm -r'
|
||||||
|
alias sl='ls'
|
||||||
|
alias myip="wget -qO- ifconfig.me/ip"
|
||||||
|
alias memoryhog="ps aux | sort -nk +4 | tail"
|
||||||
|
alias stripext="ls -1 | sed 's/\(.*\)\..*/\1/'"
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
bindkey "^K" kill-whole-line # ctrl-k
|
||||||
|
bindkey "^R" history-incremental-search-backward # ctrl-r
|
||||||
|
bindkey "^A" beginning-of-line # ctrl -a
|
||||||
|
bindkey "^E" end-of-line # ctrl-e
|
|
@ -0,0 +1,10 @@
|
||||||
|
#default apps
|
||||||
|
export EDITOR="vim"
|
||||||
|
|
||||||
|
#history stuff
|
||||||
|
# number of lines kept in history
|
||||||
|
export HISTSIZE=1000
|
||||||
|
# number of lines saved in the history after logout
|
||||||
|
export SAVEHIST=1000
|
||||||
|
# location of history
|
||||||
|
export HISTFILE=~/.zhistory
|
|
@ -0,0 +1,13 @@
|
||||||
|
# append command to history file once executed
|
||||||
|
setopt inc_append_history
|
||||||
|
# Do not write events to history that are duplicates of previous events
|
||||||
|
setopt HIST_IGNORE_DUPS
|
||||||
|
# When searching history don't display results already cycled through twice
|
||||||
|
setopt HIST_FIND_NO_DUPS
|
||||||
|
# Remove extra blanks from each command line being added to history
|
||||||
|
setopt HIST_REDUCE_BLANKS
|
||||||
|
|
||||||
|
setopt APPEND_HISTORY
|
||||||
|
setopt EXTENDED_HISTORY
|
||||||
|
setopt EXTENDED_GLOB
|
||||||
|
setopt AUTO_CD
|
|
@ -0,0 +1,22 @@
|
||||||
|
#hooks
|
||||||
|
function precmd {
|
||||||
|
# vcs_info
|
||||||
|
# Put the string "hostname::/full/directory/path" in the title bar:
|
||||||
|
echo -ne "\e]2;$PWD\a"
|
||||||
|
|
||||||
|
# Put the parentdir/currentdir in the tab
|
||||||
|
echo -ne "\e]1;$PWD:h:t/$PWD:t\a"
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_running_app {
|
||||||
|
printf "\e]1; $PWD:t:$(history $HISTCMD | cut -b7- ) \a"
|
||||||
|
}
|
||||||
|
|
||||||
|
function preexec {
|
||||||
|
set_running_app
|
||||||
|
}
|
||||||
|
|
||||||
|
function postexec {
|
||||||
|
set_running_app
|
||||||
|
}
|
||||||
|
|
57
.zshrc
57
.zshrc
|
@ -5,56 +5,9 @@ promptinit
|
||||||
#prompt
|
#prompt
|
||||||
prompt elite2
|
prompt elite2
|
||||||
|
|
||||||
#opts
|
source ~/.zsh/setopt.zsh
|
||||||
setopt APPEND_HISTORY
|
source ~/.zsh/exports.zsh
|
||||||
setopt EXTENDED_HISTORY
|
source ~/.zsh/aliases.zsh
|
||||||
setopt EXTENDED_GLOB
|
source ~/.zsh/zsh_hooks.zsh
|
||||||
setopt AUTO_CD
|
source ~/.zsh/bindings.zsh
|
||||||
|
|
||||||
#history stuff
|
|
||||||
# number of lines kept in history
|
|
||||||
export HISTSIZE=1000
|
|
||||||
# number of lines saved in the history after logout
|
|
||||||
export SAVEHIST=1000
|
|
||||||
# location of history
|
|
||||||
export HISTFILE=~/.zhistory
|
|
||||||
# append command to history file once executed
|
|
||||||
setopt inc_append_history
|
|
||||||
# Do not write events to history that are duplicates of previous events
|
|
||||||
setopt HIST_IGNORE_DUPS
|
|
||||||
# When searching history don't display results already cycled through twice
|
|
||||||
setopt HIST_FIND_NO_DUPS
|
|
||||||
# Remove extra blanks from each command line being added to history
|
|
||||||
setopt HIST_REDUCE_BLANKS
|
|
||||||
|
|
||||||
#aliases
|
|
||||||
alias rmdir='rm -r'
|
|
||||||
alias sl='ls'
|
|
||||||
alias myip="wget -qO- ifconfig.me/ip"
|
|
||||||
alias memoryhog="ps aux | sort -nk +4 | tail"
|
|
||||||
alias stripext="ls -1 | sed 's/\(.*\)\..*/\1/'"
|
|
||||||
|
|
||||||
#default apps
|
|
||||||
export EDITOR="vim"
|
|
||||||
|
|
||||||
#hooks
|
|
||||||
function precmd {
|
|
||||||
# vcs_info
|
|
||||||
# Put the string "hostname::/full/directory/path" in the title bar:
|
|
||||||
echo -ne "\e]2;$PWD\a"
|
|
||||||
|
|
||||||
# Put the parentdir/currentdir in the tab
|
|
||||||
echo -ne "\e]1;$PWD:h:t/$PWD:t\a"
|
|
||||||
}
|
|
||||||
|
|
||||||
function set_running_app {
|
|
||||||
printf "\e]1; $PWD:t:$(history $HISTCMD | cut -b7- ) \a"
|
|
||||||
}
|
|
||||||
|
|
||||||
function preexec {
|
|
||||||
set_running_app
|
|
||||||
}
|
|
||||||
|
|
||||||
function postexec {
|
|
||||||
set_running_app
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue