dotfiles/.config/fish/functions/_autopair_insert_right.fish

12 lines
330 B
Fish
Raw Normal View History

2023-07-10 06:53:13 -04:00
function _autopair_insert_right --argument-names key
set --local buffer (commandline)
set --local before (commandline --cut-at-cursor)
switch "$buffer"
case "$before$key"\*
commandline --cursor (math (commandline --cursor) + 1)
case \*
commandline --insert -- $key
end
end