Skip to content

Instantly share code, notes, and snippets.

@compnerd
Last active December 20, 2015 20:29

Revisions

  1. compnerd revised this gist Nov 3, 2013. 1 changed file with 5 additions and 11 deletions.
    16 changes: 5 additions & 11 deletions zle-keymap-select
    Original file line number Diff line number Diff line change
    @@ -2,17 +2,11 @@
    # Copyright © 2013 Saleem Abdulrasool <[email protected]>
    # vim: set et ft=sh sts=2 sw=2 ts=8 :

    function zle-keymap-select {
    case ${KEYMAP} in
    vicmd)
    POSTDISPLAY=$'\n -- command mode --'
    region_highlight=( "${#BUFFER} 32 fg=red,bold" )
    ;;
    *)
    POSTDISPLAY=
    region_highlight=( )
    ;;
    esac
    function zle-line-init zle-keymap-select {
    RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
    RPS2=${RPS1}
    zle reset-prompt
    }

    zle -N zle-line-init
    zle -N zle-keymap-select
  2. compnerd created this gist Aug 9, 2013.
    18 changes: 18 additions & 0 deletions zle-keymap-select
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/usr/bin/zsh
    # Copyright © 2013 Saleem Abdulrasool <[email protected]>
    # vim: set et ft=sh sts=2 sw=2 ts=8 :

    function zle-keymap-select {
    case ${KEYMAP} in
    vicmd)
    POSTDISPLAY=$'\n -- command mode --'
    region_highlight=( "${#BUFFER} 32 fg=red,bold" )
    ;;
    *)
    POSTDISPLAY=
    region_highlight=( )
    ;;
    esac
    }

    zle -N zle-keymap-select