Skip to content

Idea to relax the "balanced" rule #30

@mihaicristiantanase

Description

@mihaicristiantanase

This is not a bug report, but, rather, a suggestion.

There are lots of other useful features in Paredit that I rely on (automatically closing of opened parentheses, moving of parentheses with automatic indentation, joining and splitting s-expressions, etc.). I like to think of those features/commands as non-intrusive, meaning, they don't interfere with the normal editing.

However, from what I experienced, there seem to be a lot of "unexpected" behaviors when doing normal editing (x, X, D, ce, Backspace, etc.). Just to point out, I'm not referring to bugs here, but of the main feature of Paredit: keeping the parentheses balanced at all cost.
My suggestion, is to add a flag, let's call it g:paredit_strictmode, which controls whether or not Paredit is activated when doing normal editing.
So, with the following combination:

let g:paredit_mode = 1
let g:paredit_strictmode = 0

I can do the usual stuff like:

  • insert a opening parenthesis, and Paredit automatically adds the closing one;
  • jump to start of defun with [[;
  • move parenthesis with Leader>;

but, I can also do:

  • delete closing parenthesis with Backspace, D, etc.;
  • move opening parenthesis manually;

Please let me know what you think, or if this is in the scope of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions