mirror of
https://github.com/danbulant/dotfiles
synced 2026-06-06 16:20:48 +00:00
13 lines
403 B
Fish
13 lines
403 B
Fish
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
|