dotfiles/.config/fish/functions/_autopair_insert_left.fish

14 lines
403 B
Fish
Raw Normal View History

2023-07-10 06:53:13 -04:00
function _autopair_insert_left --argument-names left right
set --local buffer (commandline)
set --local before (commandline --cut-at-cursor)
commandline --insert -- $left
switch "$buffer"
case "$before"{," "\*,$autopair_right\*}
set --local index (commandline --cursor)
commandline --insert -- $right
commandline --cursor $index
end
end