diff options
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/00_environ.zsh | 4 | ||||
-rw-r--r-- | zsh/01_params.zsh | 2 | ||||
-rw-r--r-- | zsh/Functions/_uri | 2 | ||||
-rw-r--r-- | zsh/functions.zsh | 15 | ||||
-rw-r--r-- | zsh/keys.zsh | 5 | ||||
-rw-r--r-- | zsh/zkbd/linux-unknown-linux-gnu | 25 | ||||
-rw-r--r-- | zsh/zkbd/screen-:0 | 26 | ||||
-rw-r--r-- | zsh/zkbd/screen-unknown-linux-gnu | 28 | ||||
-rw-r--r-- | zsh/zkbd/xterm-256color-unknown-linux-gnu | 30 |
9 files changed, 133 insertions, 4 deletions
diff --git a/zsh/00_environ.zsh b/zsh/00_environ.zsh index 5c1d003..5e8c5f8 100644 --- a/zsh/00_environ.zsh +++ b/zsh/00_environ.zsh @@ -6,10 +6,12 @@ PAGER=vimpager BROWSER=qutebrowser TERMINAL=st VIMINIT="let \$MYVIMRC = '$XDG_CONFIG_HOME/vim/main.vim' | source \$MYVIMRC" +GVIMINIT="let \$MYGVIMRC = '$XDG_CONFIG_HOME/vim/gvimrc' | source \$MYGVIMRC" VIMPAGER_RC="$XDG_CONFIG_HOME/vim/main.vim" PERLDOC_PAGER=vimpager PERLTIDY=$XDG_CONFIG_HOME/perltidy -export EDITOR VISUAL SUDO_EDITOR MANPAGER PAGER BROWSER TERMINAL VIMINIT PERLDOC_PAGER VIMPAGER_RC PERLTIDY +export EDITOR VISUAL SUDO_EDITOR MANPAGER PAGER BROWSER TERMINAL VIMINIT PERLDOC_PAGER VIMPAGER_RC PERLTIDY GVIMINIT eval $(dircolors -b $ZDOTDIR/dircolors) eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) +. /home/nick/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true diff --git a/zsh/01_params.zsh b/zsh/01_params.zsh index 15b8e3e..bac84ff 100644 --- a/zsh/01_params.zsh +++ b/zsh/01_params.zsh @@ -7,7 +7,7 @@ SAVEHIST=10000000 REPORTTIME=60 fpath=($ZDOTDIR/Functions $fpath) -path=($HOME/bin /usr/bin/vendor_perl $path) +path=($HOME/bin /usr/bin/vendor_perl /usr/bin/core_perl $path) # Expand ~zsh to $ZDOTDIR hash -d zsh=$ZDOTDIR diff --git a/zsh/Functions/_uri b/zsh/Functions/_uri index 40d1811..0250832 100644 --- a/zsh/Functions/_uri +++ b/zsh/Functions/_uri @@ -1,4 +1,4 @@ -compdef uri +#compdef uri local uri_commands uri_commands=( \ diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 6bd9482..6003dea 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -25,3 +25,18 @@ function note { fi popd } + +function fuzzy_history { + local choice + choice=($(fc -l 0 | fzf --tac --no-sort)) + [[ $#choice -gt 1 ]] || return + HISTNO=$(sed 's/[^\d]//g' <<< $choice[1]) + BUFFER=$choice[2,-1] +} + +function fuzzy_dirstack { + local choice + choice=$(dirs -pl | fzf --tac --no-sort) + [[ -n $choice ]] && cd $choice + zle .reset-prompt +} diff --git a/zsh/keys.zsh b/zsh/keys.zsh index f095954..c86e352 100644 --- a/zsh/keys.zsh +++ b/zsh/keys.zsh @@ -15,4 +15,7 @@ KBDFILE=$ZDOTDIR/zkbd/$TERM-$VENDOR-$OSTYPE [[ -n ${key[ScrollUp]} ]] && bindkey "${key[ScrollUp]}" up-history [[ -n ${key[ScrollDown]} ]] && bindkey "${key[ScrollDown]}" down-history -bindkey '^R' history-incremental-search-backward +zle -N fuzzy-history fuzzy_history +bindkey '^R' fuzzy-history +zle -N fuzzy-dirstack fuzzy_dirstack +bindkey '^B' fuzzy-dirstack diff --git a/zsh/zkbd/linux-unknown-linux-gnu b/zsh/zkbd/linux-unknown-linux-gnu new file mode 100644 index 0000000..19567db --- /dev/null +++ b/zsh/zkbd/linux-unknown-linux-gnu @@ -0,0 +1,25 @@ +typeset -g -A key + +key[F1]='^[[[A' +key[F2]='^[[[B' +key[F3]='^[[[C' +key[F4]='^[[[D' +key[F5]='^[[[E' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[[1~' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' diff --git a/zsh/zkbd/screen-:0 b/zsh/zkbd/screen-:0 new file mode 100644 index 0000000..b779b40 --- /dev/null +++ b/zsh/zkbd/screen-:0 @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[4h' +key[Home]='^[[1~' +key[PageUp]='^[[5~' +key[Delete]='^[[P' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/zsh/zkbd/screen-unknown-linux-gnu b/zsh/zkbd/screen-unknown-linux-gnu new file mode 100644 index 0000000..482e37d --- /dev/null +++ b/zsh/zkbd/screen-unknown-linux-gnu @@ -0,0 +1,28 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[4h' +key[Home]='^[[H' +key[PageUp]='^[[5~' +key[Delete]='^[[P' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' +key[ScrollUp]='^Y' +key[ScrollDown]='^E' diff --git a/zsh/zkbd/xterm-256color-unknown-linux-gnu b/zsh/zkbd/xterm-256color-unknown-linux-gnu new file mode 100644 index 0000000..6af6cdc --- /dev/null +++ b/zsh/zkbd/xterm-256color-unknown-linux-gnu @@ -0,0 +1,30 @@ +# this is for weston-terminal running in weston +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +# the weston compositor eats F11 +# key[F11]='''' +key[F12]='^[[24~' +key[Backspace]='^?' +# no insert??? +# key[Insert]='''' +key[Home]='^[[H' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[F' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +# what menu? +# key[Menu]='''' |