From ceeb821004d504e8e5ce0d9ea84e96849705c1e0 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Fri, 4 Aug 2023 13:58:53 +0200 Subject: [PATCH] small updates --- .config/lf/rifle.conf | 14 +++++++------- .config/zsh/.zshrc | 1 + .config/zsh/configs/functions | 20 ++++++++++++++++++++ .config/zsh/configs/setup | 19 +++---------------- .config/zsh/configs/vars | 2 -- .local/src/dwm | 2 +- 6 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 .config/zsh/configs/functions diff --git a/.config/lf/rifle.conf b/.config/lf/rifle.conf index 5e5e6e508..c81e1da89 100644 --- a/.config/lf/rifle.conf +++ b/.config/lf/rifle.conf @@ -67,13 +67,13 @@ ext x?html?, has w3m, terminal = w3m "$@" #-------------------------------------------- # Code #------------------------------------------- -ext py = python -- "$1" -ext pl = perl -- "$1" -ext rb = ruby -- "$1" -ext js = node -- "$1" -ext sh = sh -- "$1" -ext php = php -- "$1" -ext lisp = emacs -- "$1" +# ext py = python -- "$1" +# ext pl = perl -- "$1" +# ext rb = ruby -- "$1" +# ext js = node -- "$1" +# ext sh = sh -- "$1" +# ext php = php -- "$1" +# ext lisp = emacs -- "$1" ext cue , terminal, flag t = delay .3; vim -- "$@" ext cue , terminal = file "$@"|less diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index db18ddc23..003a68e03 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,5 +1,6 @@ # vim:set ft=zsh source $ZDOTDIR/configs/vars +source $ZDOTDIR/configs/functions source $ZDOTDIR/configs/setup source $ZDOTDIR/configs/widgets source $ZDOTDIR/configs/bindings diff --git a/.config/zsh/configs/functions b/.config/zsh/configs/functions new file mode 100644 index 000000000..9407de377 --- /dev/null +++ b/.config/zsh/configs/functions @@ -0,0 +1,20 @@ +# vim:set ft=zsh + +whed() { + $EDITOR "$(which "$1")" +} + +venv_prompt() { + [[ -n ${VIRTUAL_ENV} ]] || return + echo -e "%F{yellow}%f ${VIRTUAL_ENV:t:gs/%/%%}" +} + +function write_title_cmd() { + if [ ${1[(w)1]} != "lfwrap" ]; then + echo -ne "\033]0;$(print -P "%n@%m [%3~] » ${1[(w)1]}")\007" + fi +} + +function write_title_wd() { echo -ne "\033]0;$(print -P "%n@%m [%3~]")\007" } + +# reset_beam() { echo -ne '\e[5 q' } # Use beam shape cursor for each new prompt. diff --git a/.config/zsh/configs/setup b/.config/zsh/configs/setup index d59517c50..05a91bf7a 100644 --- a/.config/zsh/configs/setup +++ b/.config/zsh/configs/setup @@ -1,7 +1,7 @@ # vim:set ft=zsh [ ! -f $XDG_DATA_HOME/zsh/history ] && mkdir -p $XDG_DATA_HOME/zsh && touch $XDG_DATA_HOME/zsh/history -setopt HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS HIST_VERIFY BANG_HIST interactive_comments autocd noflowcontrol longlistjobs nonomatch notify hash_list_all share_history histignorespace +setopt HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS HIST_VERIFY BANG_HIST interactive_comments autocd noflowcontrol longlistjobs nonomatch notify hash_list_all share_history histignorespace PROMPT_SUBST autoload -Uz colors && colors autoload -Uz edit-command-line && zle -N edit-command-line @@ -16,24 +16,11 @@ _comp_options+=(globdots) zle_highlight+=(paste:none) -# function write_venv(){ -# echo -n "${VIRTUAL_ENV}" > "/tmp/current_venv-$$" -# } -# add-zsh-hook precmd write_venv +PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%f%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b ' +RPROMPT='%(?..%F{red}%?) $(venv_prompt)' # Set the titlestring -function write_title_cmd() { - if [ ${1[(w)1]} != "lfwrap" ]; then - echo -ne "\033]0;$(print -P "%n@%m [%3~] » ${1[(w)1]}")\007" - fi -} add-zsh-hook preexec write_title_cmd -function write_title_wd() { echo -ne "\033]0;$(print -P "%n@%m [%3~]")\007" } add-zsh-hook precmd write_title_wd -reset_beam() { echo -ne '\e[5 q' } # Use beam shape cursor for each new prompt. # add-zsh-hook preexec reset_beam - -whed() { - $EDITOR "$(which "$1")" -} diff --git a/.config/zsh/configs/vars b/.config/zsh/configs/vars index bb3a129f8..755ce41b7 100644 --- a/.config/zsh/configs/vars +++ b/.config/zsh/configs/vars @@ -2,6 +2,4 @@ HISTSIZE=10000000 SAVEHIST=10000000 HISTFILE="$XDG_DATA_HOME/zsh/history" -PS1="%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%f%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b " -RPS1="%(?..%F{red}%?)" KEYTIMEOUT=1 diff --git a/.local/src/dwm b/.local/src/dwm index 22e85e825..638eeab3a 160000 --- a/.local/src/dwm +++ b/.local/src/dwm @@ -1 +1 @@ -Subproject commit 22e85e82576d5948cc2e2f874eeab4c5ff38cb54 +Subproject commit 638eeab3a135f6a11ec9334196d1ac894bbb0d3e