Last active
July 3, 2020 00:29
-
-
Save eikenb/79e9d18ede852b7122f36bda1c6401ff to your computer and use it in GitHub Desktop.
initial, not very good version of map based auto-pair
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define-command -params 1 maybematch %{ | |
execute-keys "<a-l>" | |
evaluate-commands %sh{ | |
if [ "$kak_selection_length" -lt 2 ] && [ "$kak_cursor_column" -gt 2 ] | |
then | |
printf "execute-keys i${1}<esc>" | |
fi | |
} | |
execute-keys "<a-;>;h" | |
} | |
map global insert "[" "[<esc>:maybematch ']'<ret>i" | |
map global insert "(" "(<esc>:maybematch ')'<ret>i" | |
map global insert "{" "{<esc>:maybematch '}'<ret>i" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment