update
This commit is contained in:
1 parent
92aa59c3ff
commit
bc00d5913c
5 files changed
+12
-4
No files matched your search
+135
@@ -0,0 +1,135 @@
|
||||
unsetopt beep
|
||||
HISTFILE=~/.zsh_history
|
||||
SAVEHIST=500000
|
||||
HISTSIZE=$SAVEHIST+100000
|
||||
|
||||
setopt APPEND_HISTORY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_IGNORE_SPACE
|
||||
zshaddhistory() { whence ${${(z)1}[1]} >| /dev/null || return 1 }
|
||||
|
||||
# To test keys:
|
||||
# cat > /dev/null
|
||||
# sed -n l
|
||||
# List all commands:
|
||||
# zle -al
|
||||
_vi-kill-word(){
|
||||
zle select-a-word
|
||||
if ((REGION_ACTIVE)); then
|
||||
zle kill-region
|
||||
fi
|
||||
}
|
||||
zle -N _vi-kill-word
|
||||
bindkey -e #emacs style keybinding
|
||||
bindkey "^[[H" beginning-of-line #Home
|
||||
bindkey "^[[F" end-of-line #End
|
||||
bindkey "^[[5~" history-search-backward #PgUp
|
||||
bindkey "^[[6~" history-search-forward #PgDn
|
||||
bindkey "^Z" undo #C-z
|
||||
bindkey "^[[3~" delete-char #Delete
|
||||
bindkey "^[[1;3D" vi-backward-word #A-left
|
||||
bindkey "^[[1;3C" vi-forward-word #A-right
|
||||
bindkey '^[^?' vi-backward-kill-word #A-Backspace
|
||||
bindkey "^[[3;3~" _vi-kill-word #A-Delete
|
||||
bindkey "^[[1;5D" backward-word #C-left
|
||||
bindkey "^[[1;5C" forward-word #C-right
|
||||
bindkey "^H" backward-kill-word #C-Backspace
|
||||
bindkey "^[[3;5~" kill-word #C-Delete
|
||||
|
||||
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
# The following lines were added by compinstall
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion::complete:*' gain-privileges 1
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*' 'r:|[._-]=* r:|=*'
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
# End of lines added by compinstall
|
||||
|
||||
autoload -Uz promptinit
|
||||
promptinit
|
||||
|
||||
compdef pyssh=ssh
|
||||
|
||||
export FZF_COMPLETION_TRIGGER="''"
|
||||
export FZF_COMPLETION_DIR_COMMANDS='cd pushd rmdir ls ll'
|
||||
export FZF_DEFAULT_COMMAND="fd --strip-cwd-prefix --hidden"
|
||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||
export FZF_ALT_C_COMMAND="fd --type d --strip-cwd-prefix --hidden"
|
||||
# Override default
|
||||
_fzf_compgen_path() {
|
||||
fd --hidden . "$1"
|
||||
}
|
||||
_fzf_compgen_dir() {
|
||||
fd --type d --hidden . "$1"
|
||||
}
|
||||
# Self-defined
|
||||
__fzf_compgen_file(){
|
||||
fd --type f --hidden . "$1"
|
||||
}
|
||||
|
||||
# For **<TAB>
|
||||
_fzf_comprun() {
|
||||
local command=$1
|
||||
shift
|
||||
|
||||
case "$command" in
|
||||
ssh|mosh|pyssh) fzf --preview 'ssh -tt -G {} | head -n 4' "$@" ;;
|
||||
cd|ls|ll) fzf --preview 'tree -C -L1 {} | head -200' "$@" ;;
|
||||
cat|nano) fzf --preview 'cat -s {} | head -200' "$@" ;;
|
||||
*) fzf "$@" ;;
|
||||
esac
|
||||
}
|
||||
_fzf_complete_pyssh() {
|
||||
_fzf_complete +m -- "$@" < <(
|
||||
setopt localoptions nonomatch
|
||||
command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* 2> /dev/null | command grep -i '^\s*host ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') |
|
||||
awk '{if (length($2) > 0) {print $2}}' | sort -u
|
||||
)
|
||||
}
|
||||
alias _fzf_complete_mosh=_fzf_complete_pyssh
|
||||
alias _fzf_complete_ssh=_fzf_complete_pyssh
|
||||
_fzf_complete_cat(){
|
||||
__fzf_generic_path_completion "$prefix" "$1" __fzf_compgen_file \
|
||||
"-m" "" " "
|
||||
}
|
||||
alias _fzf_complete_nano=_fzf_complete_cat
|
||||
source /usr/share/doc/fzf/examples/completion.zsh
|
||||
source /usr/share/doc/fzf/examples/key-bindings.zsh
|
||||
|
||||
bindkey "^[[A" fzf-history-widget
|
||||
fzf_packages_widget(){
|
||||
local cmd="dpkg --get-selections | grep -v deinstall | awk '{print \$1}' | fzf --layout reverse --multi --preview 'dpkg -s {1}' | command tr '\n' ' '"
|
||||
setopt localoptions pipefail no_aliases 2> /dev/null
|
||||
LBUFFER=${LBUFFER}$(eval $cmd)
|
||||
local ret=$?
|
||||
zle reset-prompt
|
||||
return $ret
|
||||
}
|
||||
zle -N fzf_packages_widget
|
||||
bindkey "^_" fzf_packages_widget
|
||||
|
||||
prompt fire
|
||||
|
||||
export GOBIN=/usr/local/bin
|
||||
export PATH=$HOME/.yarn/bin:$HOME/.local/bin:$PATH
|
||||
|
||||
eval "$(zoxide init --cmd cd zsh)"
|
||||
|
||||
export MANROFFOPT="-c"
|
||||
export MANPAGER="sh -c 'col -bx|batcat -l man -p'"
|
||||
alias cat="batcat -pp"
|
||||
alias h="batcat -pl help"
|
||||
help(){
|
||||
"$@" --help 2>&1 | h
|
||||
}
|
||||
|
||||
alias c=clear
|
||||
alias ls=exa
|
||||
alias l="ls -lhg"
|
||||
alias ll="ls -alhg"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB+DCCAZ6gAwIBAgIUKUWfa9xYlr9W4dJYBOUsD9+TwaIwCgYIKoZIzj0EAwIw
|
||||
XTELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0ppYW5nc3UxEDAOBgNVBAcMB0t1bnNo
|
||||
YW4xDTALBgNVBAoMBFRJTksxDDAKBgNVBAsMA1ImRDENMAsGA1UEAwwEVElOSzAe
|
||||
Fw0yMzAyMTIwNzQ4NDhaFw0zMzAyMDkwNzQ4NDhaMF0xCzAJBgNVBAYTAkNOMRAw
|
||||
DgYDVQQIDAdKaWFuZ3N1MRAwDgYDVQQHDAdLdW5zaGFuMQ0wCwYDVQQKDARUSU5L
|
||||
MQwwCgYDVQQLDANSJkQxDTALBgNVBAMMBFRJTkswWTATBgcqhkjOPQIBBggqhkjO
|
||||
PQMBBwNCAATFXScucQLo7JG1p133IUZx8YbHIzdFh64VeHFNOqUDVa9Axj1b6LDn
|
||||
QYAjaZ6z3QnZjk99yv7swN/URCQC2et2ozwwOjAMBgNVHRMEBTADAQH/MAsGA1Ud
|
||||
DwQEAwICBDAdBgNVHQ4EFgQUPoXk1zO8K0/oStW/5Ko+O9DLnaIwCgYIKoZIzj0E
|
||||
AwIDSAAwRQIgcHpLdqcsgzwGLsvV7ACFOwl1Texmt7H1ZPv8oV/dp2MCIQDKutmW
|
||||
dD+0055QroVpYqKQ8bXGW8WOyjq87z/IHcRhXA==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,5 @@
|
||||
.git
|
||||
__pycache__
|
||||
node_modules
|
||||
.cache
|
||||
.snapshots
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"clipboard": "terminal",
|
||||
"tabstospaces": true,
|
||||
"colorscheme": "solarized"
|
||||
}
|
||||
Reference in new issue
Block a user