Browse Source

added some history-related options to zsh and added some of my custom bindings for openscad and povray in connection with vim

bananicorn 5 years ago
parent
commit
3461e17ce9
1 changed files with 15 additions and 5 deletions
  1. 15 5
      .zshrc

+ 15 - 5
.zshrc

@@ -1,9 +1,15 @@
-set -o vi
+bindkey -v # activate vi mode
 setopt prompt_subst # needs to be on so I can get the time updated on each recalculation of the prompt
 setopt cdablevars # be able to cd to strings contained in variables
 setopt histignorespace # if a command starts with a space, it is not added to the history
 setopt ignoreeof # do not exit with Ctrl-D
-setopt autopushd pushdminus pushdsilent pushdtohome # 
+setopt autopushd pushdminus pushdsilent pushdtohome # pushes the current directory to the directory stack
+setopt noauto_remove_slash
+
+DIRSTACKSIZE=10 # maximum amount of items in the directory stack
+HISTSIZE=10000
+SAVEHIST=10000
+HISTFILE=~/.zsh_history
 
 # escaped color codes
 TURQUOISE=""
@@ -18,20 +24,24 @@ get_git_branch() {
 
 PS1='[$GREEN${$(date -d now +'%H:%M:%S')}$WHITE] ${PWD##}${$(get_git_branch)} $ '
 
+bindkey -a k history-beginning-search-backward
+bindkey -a j history-beginning-search-forward
 
 alias c=clear
 alias q=exit
-alias d="dirs -v"
+alias d="dirs -v" # print recently visited directories
 alias dup="st & disown"
 alias ls="ls --color"
 alias la="ls -la --color"
 alias lah="ls -lah --color"
 alias grep="grep --color"
+alias vopenscad="~/scripts/vim-openscad.sh"
+alias vpov="~/scripts/vim-povray.sh"
 
 export torgglercom="~/suticlients/torgglercom/web/app/theme/chimica"
 
-#Stuff for work
+# Stuff for work
 
-#Node version management
+# Node version management
 export NVM_DIR="$HOME/.nvm"
 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"