aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD6
-rw-r--r--easy-zsh-config.install4
-rwxr-xr-xzshrc63
4 files changed, 58 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ce761e30c0a6..64c83488869b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = easy-zsh-config
pkgdesc = A simple but fast and out of the box configuration of zsh powered by oh-my-posh and zsh pulgins.
- pkgver = 0.1.4
- pkgrel = 5
+ pkgver = 0.2.0
+ pkgrel = 1
url = https://github.com/wszqkzqk/easy-zsh-config
install = easy-zsh-config.install
arch = any
@@ -18,7 +18,7 @@ pkgbase = easy-zsh-config
backup = etc/skel/.zshrc
source = zshrc
source = LICENSE
- sha256sums = eb8a1218822bf508a028e2fe95a939c5ec70e85b620808de6c81572eb18227b7
+ sha256sums = 0063bc9dbdd38537e1a968d6bad73ee33a55257f8c17bc5861a911264ed27050
sha256sums = 191f93567e767c599cfd843bb8343f311396d8e80d423ec38af2ad3dc52551a3
pkgname = easy-zsh-config
diff --git a/PKGBUILD b/PKGBUILD
index f93389bd45a3..96ca4ec8c739 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,8 @@
# Maintainer: wszqkzqk <wszqkzqk@qq.com>
pkgname=easy-zsh-config
- pkgver=0.1.4
- pkgrel=5
+ pkgver=0.2.0
+ pkgrel=1
pkgdesc="A simple but fast and out of the box configuration of zsh powered by oh-my-posh and zsh pulgins."
arch=(any)
url=https://github.com/wszqkzqk/easy-zsh-config
@@ -21,7 +21,7 @@ backup=("root/.zshrc"
install="easy-zsh-config.install"
source=("zshrc"
"LICENSE")
-sha256sums=('eb8a1218822bf508a028e2fe95a939c5ec70e85b620808de6c81572eb18227b7'
+sha256sums=('0063bc9dbdd38537e1a968d6bad73ee33a55257f8c17bc5861a911264ed27050'
'191f93567e767c599cfd843bb8343f311396d8e80d423ec38af2ad3dc52551a3')
package(){
diff --git a/easy-zsh-config.install b/easy-zsh-config.install
index 86686c38d4b2..0b9d35f45d0a 100644
--- a/easy-zsh-config.install
+++ b/easy-zsh-config.install
@@ -1,5 +1,5 @@
info() {
- echo -e "\033[0;34m================================INFO==================================="
+ echo -e "================================INFO==================================="
echo -e "* To apply changes to current user, run:"
echo -e " > cp /etc/zsh/zshrc ~/.zshrc"
echo -e "* To configure the theme:"
@@ -11,7 +11,7 @@ info() {
echo -e " Ctrl-Down: History beginning search(forward)"
echo -e " Ctrl-Left: Skip a whole word(left)"
echo -e " Ctrl-Right: Skip a whole word(right)"
- echo -e "====================================================================\033[0m"
+ echo -e "======================================================================="
}
post_install() {
info
diff --git a/zshrc b/zshrc
index 292563a2d5ff..de3c678edd35 100755
--- a/zshrc
+++ b/zshrc
@@ -1,10 +1,14 @@
-# Set oh-my-posh and themes
+## Set oh-my-posh and themes
eval "$(oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/jandedobbeleer.omp.json)"
-# Set history
+## Set history
HISTFILE=~/.zsh_history
-HISTSIZE=100000000
-SAVEHIST=100000000
+HISTSIZE=10000
+SAVEHIST=10000
+setopt correct # Auto correct mistakes
+setopt extendedglob # Extended globbing. Allows using regular expressions with *
+setopt nocaseglob # Case insensitive globbing
+setopt rcexpandparam # Array expension with parameters
setopt BANG_HIST
setopt EXTENDED_HISTORY
setopt INC_APPEND_HISTORY
@@ -19,16 +23,49 @@ setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt HIST_BEEP
-# Set plugins
+## Set plugins
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
-# Set key bindings
-bindkey "^[[A" history-substring-search-up # Up
-bindkey "^[[B" history-substring-search-down # Down
-bindkey ";5A" history-beginning-search-backward # Ctrl-Up
-bindkey ";5B" history-beginning-search-forward # Ctrl-Down
-bindkey ";5C" emacs-forward-word # Ctrl-Right
-bindkey ";5D" emacs-backward-word # Ctrl-Left
-bindkey "\e[3~" delete-char # Del
+## Set key bindings
+bindkey -e
+bindkey '^[[7~' beginning-of-line # Home key
+bindkey '^[[H' beginning-of-line # Home key
+if [[ "${terminfo[khome]}" != "" ]]; then
+ bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
+fi
+bindkey '^[[8~' end-of-line # End key
+bindkey '^[[F' end-of-line # End key
+if [[ "${terminfo[kend]}" != "" ]]; then
+ bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
+fi
+bindkey '^[[2~' overwrite-mode # Insert key
+bindkey '^[[3~' delete-char # Delete key
+bindkey '^[[C' forward-char # Right key
+bindkey '^[[D' backward-char # Left key
+bindkey '^[[5~' history-beginning-search-backward # Page up key
+bindkey '^[[6~' history-beginning-search-forward # Page down key
+
+bindkey '^[Oc' forward-word #
+bindkey '^[Od' backward-word #
+bindkey '^[[1;5D' backward-word #
+bindkey '^[[1;5C' forward-word #
+bindkey '^H' backward-kill-word # delete previous word with ctrl+backspace
+bindkey '^[[Z' undo # Shift+tab undo last action
+
+## Set alias
+alias cp="cp -i" # Confirm before overwriting something
+alias df='df -h' # Human-readable sizes
+alias free='free -m' # Show sizes in MB
+alias gitu='git add . && git commit && git push'
+
+# Color man pages
+export LESS_TERMCAP_mb=$'\E[01;32m'
+export LESS_TERMCAP_md=$'\E[01;32m'
+export LESS_TERMCAP_me=$'\E[0m'
+export LESS_TERMCAP_se=$'\E[0m'
+export LESS_TERMCAP_so=$'\E[01;47;34m'
+export LESS_TERMCAP_ue=$'\E[0m'
+export LESS_TERMCAP_us=$'\E[01;36m'
+export LESS=-R