dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

keys.zsh (2271B)


      1 if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
      2   function zle-line-init() {
      3     echoti smkx
      4   }
      5   function zle-line-finish() {
      6     echoti rmkx
      7   }
      8   zle -N zle-line-init
      9   zle -N zle-line-finish
     10 fi
     11 
     12 bindkey '^r' history-incremental-search-backward      # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
     13 if [[ "${terminfo[kpp]}" != "" ]]; then
     14   bindkey "${terminfo[kpp]}" up-line-or-history       # [PageUp] - Up a line of history
     15 fi
     16 if [[ "${terminfo[knp]}" != "" ]]; then
     17   bindkey "${terminfo[knp]}" down-line-or-history     # [PageDown] - Down a line of history
     18 fi
     19 
     20 # start typing + [Up-Arrow] - fuzzy find history forward
     21 if [[ "${terminfo[kcuu1]}" != "" ]]; then
     22   autoload -U up-line-or-beginning-search
     23   zle -N up-line-or-beginning-search
     24   bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
     25   bindkey "^P" up-line-or-beginning-search
     26 fi
     27 # start typing + [Down-Arrow] - fuzzy find history backward
     28 if [[ "${terminfo[kcud1]}" != "" ]]; then
     29   autoload -U down-line-or-beginning-search
     30   zle -N down-line-or-beginning-search
     31   bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
     32   bindkey "^N" down-line-or-beginning-search
     33 fi
     34 
     35 if [[ "${terminfo[khome]}" != "" ]]; then
     36   bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line
     37 fi
     38 if [[ "${terminfo[kend]}" != "" ]]; then
     39   bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line
     40 fi
     41 
     42 # bindkey ' ' magic-space                               # [Space] - do history expansion
     43 
     44 if [[ "${terminfo[kcbt]}" != "" ]]; then
     45   bindkey "${terminfo[kcbt]}" reverse-menu-complete   # [Shift-Tab] - move through the completion menu backwards
     46 fi
     47 
     48 bindkey '^?' backward-delete-char                     # [Backspace] - delete backward
     49 if [[ "${terminfo[kdch1]}" != "" ]]; then
     50   bindkey "${terminfo[kdch1]}" delete-char            # [Delete] - delete forward
     51 else
     52   bindkey "^[[3~" delete-char
     53   bindkey "^[3;5~" delete-char
     54   bindkey "\e[3~" delete-char
     55 fi
     56 
     57 # Edit the current command line in $EDITOR
     58 autoload -U edit-command-line
     59 zle -N edit-command-line
     60 bindkey '\C-x\C-e' edit-command-line
     61 
     62 # file rename magick
     63 bindkey "^[m" copy-prev-shell-word
     64