zsh refactoring

This commit is contained in:
thek4n 2024-11-18 22:11:38 +03:00
parent c06d9b4a38
commit cab6652a51
5 changed files with 58 additions and 72 deletions

View File

@ -190,22 +190,11 @@ bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down
FZF_DEFAULT_OPTS="\
--cycle
--color='gutter:-1,pointer:red,preview-border:grey,separator:grey'
--pointer='> '
--marker='* '
${FZF_DEFAULT_OPTS}
--border=rounded
--border-label-pos=bottom
--preview-window=70%
--no-multi
--bind
ctrl-/:toggle-preview,\
ctrl-a:toggle-all,\
ctrl-p:preview-up,\
ctrl-n:preview-down,\
ctrl-u:clear-query,\
ctrl-o:toggle,\
tab:replace-query\
"
# Session managment

View File

@ -1,49 +0,0 @@
# vim: ft=zsh
umask 022
export EDITOR="nvim"
export VISUAL="$EDITOR"
export PAGER="less"
export LESS="-nMWiSRx4 --mouse -j2 -# 1 -+X -+F"
if command -v "lesspipe.sh" &>/dev/null; then
export LESSOPEN="| lesspipe.sh %s"
fi
export HISTSIZE=100000
export HISTFILESIZE="$HISTSIZE"
export HISTCONTROL=ignoreboth:erasedups
export HISTTIMEFORMAT="%F %T "
export HISTIGNORE="&:l[lsa\.]:[bf]g:exit:q:clear:c:history:h"
export BROWSERCLI=w3m
test -z "$BROWSER" && BROWSER=firefox
export BROWSER
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$HOME/.local/bin:$PATH"
fi
for TMPDIR in "$TMPDIR" "$TMP" /tmp /var/tmp
do
test -d "$TMPDIR" && break
done
export TMPDIR
export FZF_DEFAULT_OPTS="\
--cycle
--color='gutter:-1,pointer:red,preview-border:grey,separator:grey'
--pointer='> '
--marker='* '
--bind
ctrl-/:toggle-preview,\
ctrl-a:toggle-all,\
ctrl-p:preview-up,\
ctrl-n:preview-down,\
ctrl-u:clear-query,\
ctrl-o:toggle,\
tab:replace-query\
"

View File

@ -12,6 +12,12 @@ setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
export HISTSIZE=100000
export HISTFILESIZE="${HISTSIZE}"
export HISTCONTROL=ignoreboth:erasedups
export HISTTIMEFORMAT="%F %T "
export HISTIGNORE="&:l[lsa\.]:[bf]g:exit:q:clear:c:history:h"
export HISTORY_IGNORE='(cd|c|q|exit|l[sal.]|[bf]g#( *)#|..|lsl|ll[a.]|cd ..)'
# configure `time` format

View File

@ -1,6 +1,6 @@
so () {
[ -f "$1" ] && source "$1"
}
# vim ft=zsh
install_if_not_exists() {
local path="$HOME/.config/zsh/plugins/$1"
@ -14,7 +14,7 @@ install_if_not_exists zsh-users/zsh-syntax-highlighting
install_if_not_exists hlissner/zsh-autopair
install_if_not_exists unixorn/fzf-zsh-plugin
so ~/.config/zsh/plugins/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
so ~/.config/zsh/plugins/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh
so ~/.config/zsh/plugins/hlissner/zsh-autopair/autopair.zsh
so ~/.config/zsh/plugins/unixorn/fzf-zsh-plugin/fzf-zsh-plugin.plugin.zsh
_so ~/.config/zsh/plugins/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
_so ~/.config/zsh/plugins/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh
_so ~/.config/zsh/plugins/hlissner/zsh-autopair/autopair.zsh
_so ~/.config/zsh/plugins/unixorn/fzf-zsh-plugin/fzf-zsh-plugin.plugin.zsh

View File

@ -1,7 +1,47 @@
_so() {
[ -r "$1" ] && [ -f "$1" ] && source "$1"
}
# vim: ft=zsh
export XDG_CONFIG_HOME="$HOME/.config"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
for TMPDIR in "$TMPDIR" "$TMP" /tmp /var/tmp
do
test -d "$TMPDIR" && break
done
export TMPDIR
export EDITOR="nvim"
export VISUAL="$EDITOR"
export PAGER="less"
export LESS="-nMWiSRx4 --mouse -j2 -# 1 -+X -+F"
if command -v "lesspipe.sh" &>/dev/null; then
export LESSOPEN="| lesspipe.sh %s"
fi
export FZF_DEFAULT_OPTS="\
--cycle
--color='gutter:-1,pointer:red,preview-border:grey,separator:grey'
--pointer='> '
--marker='* '
--bind
ctrl-/:toggle-preview,\
ctrl-a:toggle-all,\
ctrl-p:preview-up,\
ctrl-n:preview-down,\
ctrl-u:clear-query,\
ctrl-o:toggle,\
tab:replace-query\
"
export BROWSERCLI=w3m
test -z "${BROWSER}" && BROWSER=firefox
export BROWSER
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$HOME/.local/bin:$PATH"
fi
umask 022