# declare-user-mode surround # declare-user-mode surround-append # declare-user-mode surround-delete # map global user k ': enter-user-mode surround' # map global surround a ': enter-user-mode surround-append' # map global surround d ': enter-user-mode surround-delete' # define-command define-surround -params 4 -docstring ': ' %{ # map global surround-append %arg{1} %sh{ echo "i${3}a${4}" } # map global surround-delete %arg{1} %sh{ echo "${2}d," } # } # define-surround '(' '(' '(' ')' # define-surround '[' '[' '[' ']' # define-surround '{' '{' '{' '}' # define-surround '`' '`' '`' '`' # define-surround '"' '"' '"' '"' # define-surround "'" "'" "'" "'" # define-surround t "cdiv,/div" "div" "/div" # declare-option range-specs ghost_completion; # add-highlighter global/ replace-ranges ghost_completion # hook global ModeChange .*:insert:.* %{ # unset buffer ghost_completion # } # map global insert ': appsugg' # def appsugg %{ # set buffer ghost_completion %val{timestamp} %sh{ # result=$(ai "$kak_selections") # echo -e "$kak_selection_desc|{comment}$result{Default}" # } # }