Compare commits

...

7 commits

Author SHA1 Message Date
a10c7e07ee
Update main entrypoint 2024-02-06 18:06:49 +01:00
958a3b4b1c
Update zsh.tty 2024-02-06 18:06:33 +01:00
73b59f6005
vim 2024-02-06 18:06:11 +01:00
d56bb87479
Fix LANG 2024-02-06 18:05:56 +01:00
48569c7781
Bash compat 2024-02-06 18:05:10 +01:00
26a96cbcd9
Update go utils 2024-02-06 18:04:36 +01:00
3ff115320c
zoxide 2024-02-06 18:02:15 +01:00
3 changed files with 29 additions and 11 deletions

12
.zshrc
View file

@ -1,5 +1,13 @@
if [[ $TTY == *tty* ]]; then if [[ $TTY == *tty* ]]; then
source .zshrc.tty source ${HOME}/.zshrc.tty
else else
source .zshrc.graphic source ${HOME}/.zshrc.graphic
fi
if [[ -f ${HOME}/.zshrc.local ]]; then
source ${HOME}/.zshrc.local
fi
if [[ -f ${HOME}/.zshrc.koyeb ]]; then
source ${HOME}/.zshrc.koyeb
fi fi

View file

@ -14,7 +14,7 @@ if [ -d "${HOME}/.config/zsh/completions" ]; then
fi fi
### edit cmds ### edit cmds
export VISUAL=nvim export VISUAL=vim
autoload edit-command-line autoload edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey "^X^E" edit-command-line bindkey "^X^E" edit-command-line
@ -29,6 +29,10 @@ antidote load
#. ~/.zsh_plugins.zsh #. ~/.zsh_plugins.zsh
# bash compat
autoload -U +X bashcompinit
bashcompinit
### fasd ### fasd
if which fasd > /dev/null; then if which fasd > /dev/null; then
@ -79,10 +83,10 @@ if [[ ! -z $TMUX ]]; then
fi fi
## Editor ## Editor
export EDITOR=nvim export EDITOR=vim
## Locale ## Locale
export LANG=.UTF-8 export LANG=en_US.UTF-8
export LANGUAGE=en_US export LANGUAGE=en_US
export LC_CTYPE=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8 export LC_NUMERIC=en_US.UTF-8
@ -325,14 +329,16 @@ fi
### colored and fuzzy go doc ### colored and fuzzy go doc
if which bat > /dev/null; then if which bat > /dev/null; then
function _godoc() { function _godoc() {
local PAGE_LANG=go
local GO_LANG=go
if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then
go doc ${@} | bat -p -l md go doc ${@} | bat -p -l ${PAGE_LANG}
elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then
go doc ${@} | bat -p -l go go doc ${@} | bat -p -l ${GO_LANG}
elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then
go doc ${@} | bat -p -l go go doc ${@} | bat -p -l ${GO_LANG}
else else
go doc ${@} | bat -p -l md go doc ${@} | bat -p -l ${PAGE_LANG}
fi fi
} }
else else
@ -428,6 +434,10 @@ function ,pkfr() {
# pkpr : extract clipboard content sent using the pkfr command # pkpr : extract clipboard content sent using the pkfr command
alias ,pkpr='piknik -paste | tar xzpvf -' alias ,pkpr='piknik -paste | tar xzpvf -'
### zoxide
eval "$(zoxide init zsh)"
# vim: set ft=zsh et sw=0 ts=2 sts=0: # vim: set ft=zsh et sw=0 ts=2 sts=0:
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.

View file

@ -1381,7 +1381,6 @@ zle -N help-zle
## complete word from currently visible Screen or Tmux buffer. ## complete word from currently visible Screen or Tmux buffer.
if check_com -c screen || check_com -c tmux; then if check_com -c screen || check_com -c tmux; then
function _complete_screen_display () { function _complete_screen_display () {
[[ "$TERM" != "screen" ]] && return 1
local TMPFILE=$(mktemp) local TMPFILE=$(mktemp)
local -U -a _screen_display_wordlist local -U -a _screen_display_wordlist
@ -1392,8 +1391,9 @@ if check_com -c screen || check_com -c tmux; then
#works, but crashes tmux below version 1.4 #works, but crashes tmux below version 1.4
#luckily tmux -V option to ask for version, was also added in 1.4 #luckily tmux -V option to ask for version, was also added in 1.4
tmux -V &>/dev/null || return tmux -V &>/dev/null || return
tmux -q capture-pane \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0 tmux -q capture-pane -b 0 \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0
else else
[[ "$TERM" != "screen" ]] && return
screen -X hardcopy $TMPFILE screen -X hardcopy $TMPFILE
# screen sucks, it dumps in latin1, apparently always. so recode it # screen sucks, it dumps in latin1, apparently always. so recode it
# to system charset # to system charset