summaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
authorThanosApollo <[email protected]>2022-08-13 22:53:50 +0300
committerThanosApollo <[email protected]>2022-08-13 22:53:50 +0300
commit6e146aef023e255bd0f4019d9d5a18b71cab4c86 (patch)
tree7d7492f22457d3a74b22b4557d7b5354ab4e6d4b /.zshrc
parentf04929b368a40849d3ac2714e694566344b3017b (diff)
Add zsh
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc99
1 files changed, 99 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
new file mode 100644
index 0000000..583f39c
--- /dev/null
+++ b/.zshrc
@@ -0,0 +1,99 @@
+###
+# If you come from bash you might have to change your $PATH.
+# export PATH=$HOME/bin:/usr/local/bin:$PATH
+export PATH="$HOME/.emacs.d/bin:$PATH"
+
+## PROMPT
+eval "$(starship init zsh)"
+# enable hook method
+autoload add-zsh-hook
+
+# enable and configure vcs_info
+autoload -Uz vcs_info
+add-zsh-hook precmd vcs_info
+zstyle ':vcs_info:*' enable hg git cvs svn
+zstyle ':vcs_info:*' formats '%s|%b|%a|%i|%R|%r|%S|%m'
+export PATH="$HOME/.emacs.d/bin:$PATH"
+
+#Neovim > Vim
+alias vim='nvim'
+
+#git
+alias config='/usr/bin/git --git-dir=$HOME/Developer/config/ --work-tree=$HOME'
+alias ga='git add'
+alias gaa='git add .'
+alias gc='git commit -m'
+alias gp='git push -u origin'
+alias gpm='git push -u origin master'
+alias gpd='git push -u origin developer'
+alias gs='git status'
+alias cpm='config push -u origin master'
+alias ca='config add'
+alias cs='config status'
+alias cc='config commit -m'
+
+#pacman | paru
+alias yay='paru'
+alias u='paru -Syu'
+alias r='paru -R'
+
+#aliases
+alias ls='ls --color=auto'
+alias sb='sudo systemctl start bluetooth'
+alias mykeys='setxkbmap -option caps:escape'
+alias logout='pkill -U'
+alias neofetch='neofetch | lolcat'
+alias b='bluetoothctl'
+alias ba='bluetooth-autoconnect'
+
+#Autocompletion
+autoload -Uz compinit
+compinit
+zstyle ':completion:*' menu select
+zstyle ':completion::complete:*' gain-privileges 1
+
+#Keybindings
+typeset -g -A key
+
+key[Home]="${terminfo[khome]}"
+key[End]="${terminfo[kend]}"
+key[Insert]="${terminfo[kich1]}"
+key[Backspace]="${terminfo[kbs]}"
+key[Delete]="${terminfo[kdch1]}"
+key[Up]="${terminfo[kcuu1]}"
+key[Down]="${terminfo[kcud1]}"
+key[Left]="${terminfo[kcub1]}"
+key[Right]="${terminfo[kcuf1]}"
+key[PageUp]="${terminfo[kpp]}"
+key[PageDown]="${terminfo[knp]}"
+key[Shift-Tab]="${terminfo[kcbt]}"
+
+# setup key accordingly
+[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
+[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
+[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
+[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
+[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
+[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
+[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
+[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
+[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
+[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
+[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
+[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
+
+if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
+ autoload -Uz add-zle-hook-widget
+ function zle_application_mode_start { echoti smkx }
+ function zle_application_mode_stop { echoti rmkx }
+ add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
+ add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
+fi
+
+## Autoload
+autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
+zle -N up-line-or-beginning-search
+zle -N down-line-or-beginning-search
+
+[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search
+[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search