1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 20:01:49 +08:00

Compare commits

..

2 Commits

Author SHA1 Message Date
juan
377024a013
Restructure the files 2022-05-12 23:03:14 +08:00
juan
c1b4665890
Add direnv lazyload 2022-05-12 22:54:17 +08:00

55
.zshrc
View File

@ -22,6 +22,8 @@ zinit ice lucid wait
zinit light juancldcmt/colorize zinit light juancldcmt/colorize
zinit ice lucid wait zinit ice lucid wait
zinit light juancldcmt/shortify.zsh zinit light juancldcmt/shortify.zsh
zinit ice lucid wait
zinit light juancldcmt/direnv.zsh
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
zinit light sindresorhus/pure zinit light sindresorhus/pure
@ -29,7 +31,6 @@ zinit light zsh-users/zsh-autosuggestions
zinit light hlissner/zsh-autopair zinit light hlissner/zsh-autopair
zinit light zsh-users/zsh-history-substring-search zinit light zsh-users/zsh-history-substring-search
autoload -Uz _zinit autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit (( ${+_comps} )) && _comps[zinit]=_zinit
@ -67,43 +68,15 @@ autoload edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey '' edit-command-line bindkey '' edit-command-line
export ZSHZ_CASE=smart bindkey -M menuselect 'h' vi-backward-char
export ZSHZ_DATA="$HOME/.cache/z" bindkey -M menuselect 'k' vi-up-line-or-history
zz () { bindkey -M menuselect 'l' vi-forward-char
cd `z -l $* | fzf | awk '{print $2}'` bindkey -M menuselect 'j' vi-down-line-or-history
}
alias zc="z -c"
n () bindkey '^[[A' history-substring-search-up
{ bindkey '^[[B' history-substring-search-down
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
echo "nnn is already running"
return
fi
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
PAGER="bat" nnn "$@"
if [ -f "$NNN_TMPFILE" ]; then
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
fi
}
# get cheat sheet bindkey ' ' magic-space
cb () {
curl -s cht.sh/$* | bat --decorations never
}
#start mpv detached
dmpv () {
mpv $* &> /dev/null &
disown
}
# run mpd if not running
ncmpcpp () {
pidof mpd > /dev/null || mpd.sh > /dev/null || true
command ncmpcpp
}
#config location #config location
export GOPATH=$HOME/.cache/go export GOPATH=$HOME/.cache/go
@ -135,13 +108,3 @@ export MANPATH="${MANPATH}:${HOME}/.local/share/man"
#ccache support #ccache support
export USE_CCACHE=1 export USE_CCACHE=1
export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH" export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH"
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey ' ' magic-space