jorgebucaran/autopair.fish

Add comparison to laughedelic/pisces

Closed this issue · 8 comments

A similar plugin for auto-completing matching pairs already exists for fish: https://github.com/laughedelic/pisces

I'd be curious to hear what the pros and cons of the two plugins are, and it would be good to list in the README.md file.

Good question! Autopair is better maintained, smarter, smaller, faster, and focused on doing one thing well.

Better maintained

Autopair is better maintained and you can expect it to work seamlessly with Fisher.

We spent about a month trying to convince the author of Pisces to merge Fisher 4.x support, and although he had a useful discussion, it was time-consuming and exhausting for me. I could've been using this time to work on other projects, create new plugins, enhance Fisher, and so on.

Smarter

In the process of making Autopair, I discovered Pisces had bugs that couldn't be addressed without rewriting it from scratch. Autopair auto-completes only when it makes sense to do so, for example, when the cursor isn't next to a boundary character:

$ git commit -m Rewrite for Fish 3.0

" 🥊

$ git commit -m "⎢Rewrite for Fish 3.0

Autopair handles identical pairs intelligently, e.g., only when the pair is balanced:

$ "hey (

" 🥊

$ "hey ("⎢

This is more than just checking if you're at the end of the line. Autopair respects this behavior regardless of where the cursor is positioned. Auto-balancing alone fixed issues I had for years with Pisces.

Smaller

Autopair consists of fewer files, and about ½ of Pisces in LOC. That's 100 lines of code less. Less usually means that Autopair will be faster. Performance is critical for a tool that evaluates Fish commands as you type! If that wasn't the case I wouldn't be using it myself.

Do one thing well

No configuration. You want to auto-complete matching pairs in the command line and that's all you get. We're also not trying to chew more than we can bite.

Awesome ✨ Thanks!

but plugin not working for me?

image
as i typed that after t of what shoud have "

Not sure what you mean.

simple.mp4

see here "autopair" feature not working

Thanks for the demo. Can you try something? Uninstall all plugins except Fisher and autopair, start a new session, and try again.

If that doesn't fix it, please share your config.fish with me. There might be something in it that's affecting autopair.

i think i have fixed the issue. not sure how!!? but thx