Release :: HMBRW :: zsh-navigation-tools :: 0.5

Subscribe to upcoming and past releases from this package and add it to a stack.

Add to stack

Release details

[ -s "$most\_frequent\_db" ] && list=( ${(f)"$(<$most\_frequent\_db)"} ) done NHISTORY\_WORDS=( "${list[@]}" ) if [ "$message" -eq "1" ]; then zcurses delwin info 2>/dev/null zcurses refresh zcurses end \_nlist\_alternate\_screen 0 fi else # Reuse most frequent history words local -a list list=( "${NHISTORY\_WORDS[@]}" ) fi n-list "${list[@]}" if [ "$REPLY" = "F1" ]; then # Target view: 1 active\_view=0 \_nhistory\_switch\_lists\_states "0" elif [[ "$REPLY" = -(#c0,1)[0-9]## && "$REPLY" -lt 0 ]]; then break elif [[ "$REPLY" = -(#c0,1)[0-9]## && "$REPLY" -gt 0 ]]; then local word="${reply[REPLY]#(#s) #[0-9]##$'\t'}" one\_NLIST\_SEARCH\_BUFFER="$word" one\_NLIST\_SEARCH\_BUFFER="${one\_NLIST\_SEARCH\_BUFFER## ##}" # Target view: 1 active\_view=0 \_nhistory\_switch\_lists\_states "0" elif [ "$REPLY" = "HELP" ]; then n-help fi # # View 2 - private history # elif [ "$active\_view" = "1" ]; then if [ -s "$private\_history\_db" ]; then local title=$'\x1b[00;32m'"Private history:"$'\x1b[00;00m\0' () { fc -Rap "$private\_history\_db" 20000 0; list=( "$title" ${history[@]} ) } else list=( "Private history - history entries selected via this tool will be put here" ) fi n-list "${list[@]}" # Selection or quit? if [[ "$REPLY" = -(#c0,1)[0-9]## && ("$REPLY" -lt 0 || "$REPLY" -gt 0) ]]; then break fi # View change? if [ "$REPLY" = "F1" ]; then # Target view: 3 active\_view=2 \_nhistory\_switch\_lists\_states "2" # Edit of the history? elif [ "$REPLY" = "EDIT" ]; then "${EDITOR:-vim}" "$private\_history\_db" elif [ "$REPLY" = "HELP" ]; then n-help fi fi done if [ "$REPLY" -gt 0 ]; then selected="$reply[REPLY]" # Append to private history if [[ "$active\_view" = "0" ]]; then local newline=$'\n' local selected\_ph="${selected//$newline/\$newline}" print -r -- "$selected\_ph" >> "$private\_history\_db" fi # TMUX? if [[ "$ZNT\_TMUX\_MODE" = "1" ]]; then tmux send -t "$ZNT\_TMUX\_ORIGIN\_SESSION:$ZNT\_TMUX\_ORIGIN\_WINDOW.$ZNT\_TMUX\_ORIGIN\_PANE" "$selected" tmux kill-window return 0 # ZLE? elif [ "${(t)CURSOR}" = "integer-local-special" ]; then zle .redisplay zle .kill-buffer LBUFFER+="$selected" else print -zr -- "$selected" fi else # TMUX? if [[ "$ZNT\_TMUX\_MODE" = "1" ]]; then tmux kill-window # ZLE? elif [[ "${(t)CURSOR}" = "integer-local-special" ]]; then zle redisplay fi fi return 0

vim: set filetype=zsh:

CHANGES FROM PREVIOUS VERSIONS OF ZNT

zsh-navigation-tools

Zsh curses-based tools, e.g. multi-word history searcher