Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

[Plugin] Support auto close brackets pairs #46

Open
NNBnh opened this issue Apr 24, 2022 · 2 comments
Open

[Plugin] Support auto close brackets pairs #46

NNBnh opened this issue Apr 24, 2022 · 2 comments
Labels
plugin request This belongs in a separate plugin

Comments

@NNBnh
Copy link
Contributor

NNBnh commented Apr 24, 2022

As the title suggests!

Links that might be useful:

@vamolessa
Copy link
Owner

vamolessa commented Apr 24, 2022

Could you achieve what you're after with this snippet?

map insert "(" "()<left>"
map insert "[" "[]<left>"
map insert "{" "{}<left>"
map insert "'" "''<left>"
map insert '"' '""<left>'
map insert "`" "``<left>"

I've also added it to config_recipes.md.

@NNBnh NNBnh changed the title Support auto close brackets pairs [Plugin] Support auto close brackets pairs Apr 25, 2022
@NNBnh NNBnh changed the title [Plugin] Support auto close brackets pairs Support auto close brackets pairs Apr 25, 2022
@NNBnh
Copy link
Contributor Author

NNBnh commented Apr 25, 2022

That is a simple solution, but still lack many features like:

  • Auto delete the closing bracket when the cursor is in the middle of an empty brackets pair with Backspace (e.g: foo{|}bar => foo|bar where | is the cursor).
  • When pressing a closing bracket, if the cursor is inside a brackets pair and at the left of a closing bracket, move the cursor to the right of the closing bracket instead of insert a new closing bracket (e.g: "foo bar|" => "foo bar"| where | is the cursor).
  • Enable/disable brackets based on language/file format.
    ...

Now thinking again, I think this should be implemented through plugin. When Pepper add support for plugin, I will definitely try to implemented this.

@NNBnh NNBnh changed the title Support auto close brackets pairs [Plugin] Support auto close brackets pairs Apr 25, 2022
@vamolessa vamolessa added the plugin request This belongs in a separate plugin label Aug 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin request This belongs in a separate plugin
Projects
None yet
Development

No branches or pull requests

2 participants