declare-user-mode surround declare-user-mode surround-append declare-user-mode surround-delete declare-user-mode surround-select map global user k ': enter-user-mode surround' map global surround a ': enter-user-mode surround-append' map global surround s ': enter-user-mode surround-select' 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," } map global surround-select %arg{1} %sh{ echo "${2}" } } 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}" # } # }