美文网首页
zsh中加入home end,以及小键盘的支持

zsh中加入home end,以及小键盘的支持

作者: 郭盖华 | 来源:发表于2016-12-26 09:34 被阅读298次

    在 ~/.zshrc中,添加如下代码【一般在最后添加】:

    # key bindings
    bindkey "\e[1~" beginning-of-line
    bindkey "\e[4~" end-of-line
    bindkey "\e[5~" beginning-of-history
    bindkey "\e[6~" end-of-history
    
    # for rxvt
    bindkey "\e[8~" end-of-line
    bindkey "\e[7~" beginning-of-line
    # for non RH/Debian xterm, can't hurt for RH/DEbian xterm
    bindkey "\eOH" beginning-of-line
    bindkey "\eOF" end-of-line
    # for freebsd console
    bindkey "\e[H" beginning-of-line
    bindkey "\e[F" end-of-line
    # completion in the middle of a line
    bindkey '^i' expand-or-complete-prefix
    
    # Fix numeric keypad  
    # 0 . Enter  
    bindkey -s "^[Op" "0"
    bindkey -s "^[On" "."
    bindkey -s "^[OM" "^M"
    # 1 2 3  
    bindkey -s "^[Oq" "1"
    bindkey -s "^[Or" "2"
    bindkey -s "^[Os" "3"
    # 4 5 6  
    bindkey -s "^[Ot" "4"
    bindkey -s "^[Ou" "5"
    bindkey -s "^[Ov" "6"
    # 7 8 9  
    bindkey -s "^[Ow" "7"
    bindkey -s "^[Ox" "8"
    bindkey -s "^[Oy" "9"
    # + - * /  
    bindkey -s "^[Ol" "+"
    bindkey -s "^[Om" "-"
    bindkey -s "^[Oj" "*"
    bindkey -s "^[Oo" "/"
    
    

    相关文章

      网友评论

          本文标题:zsh中加入home end,以及小键盘的支持

          本文链接:https://www.haomeiwen.com/subject/dhcjvttx.html