Awesome
enhanced-evil-paredit.el - Prevent Parenthesis Imbalance when Using Evil-mode with Paredit
The enhanced-evil-paredit package prevents parenthesis imbalance when using evil-mode with paredit. It intercepts evil-mode commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure. This guarantees that your Lisp code remains syntactically correct while retaining the editing features of evil-mode.
Installation
To install enhanced-evil-paredit from MELPA:
- If you haven't already done so, add MELPA repository to your Emacs configuration.
- Add the following code to the Emacs init file to install enhanced-evil-paredit:
(use-package enhanced-evil-paredit
:ensure t
:config
(add-hook 'paredit-mode-hook #'enhanced-evil-paredit-mode))
Frequently asked questions
What are the differences between enhanced-evil-paredit and evil-paredit?
The enhanced-evil-paredit
package is a modernized version of evil-paredit
. It has been enhanced and fully functions in recent versions of Emacs (Emacs >= 28). The author decided to develop enhanced-evil-paredit
because the evil-paredit
package is no longer maintained and does not function in recent versions of Emacs and Evil.
Here are the enhancements in enhanced-evil-paredit
:
- Handles paste using
p
andP
, ensuring that the pasted text has balanced parentheses. - Fix call to a non-existent function
(evil-called-interactively-p)
, which has been replaced by(called-interactively-p 'any)
. - Add new functions:
enhanced-evil-paredit-backward-delete
andenhanced-evil-paredit-forward-delete
. enhanced-evil-paredit-mode
only uses the paredit functions when paredit is enabled. Otherwise,enhanced-evil-paredit-mode
uses Evil functions.- Add lexical binding with
lexical-binding: t
. - Suppress Emacs Lisp warnings and add Melpa tests.
- Refactor and improve
enhanced-evil-paredit
. - Create a
enhanced-evil-paredit
customization group for user configuration. - Remove Evil state change from
enhanced-evil-paredit-mode
. - Improve error handling in
enhanced-evil-paredit-check-region
. - Enhance docstrings.
- Remove keymap bindings that are reserved by Emacs.
- Add
&optional
after theend
argument to make it similar to Evil functions.
dd
restores the column when there is a parentheses mismatch.
Author and License
The enhanced-evil-paredit
Emacs package has been written by Roman Gonzalez and James Cherti. It is distributed under terms of the GNU General Public License version 3, or, at your choice, any later version.
Copyright (C) 2024 James Cherti
Copyright (C) 2012-2015 Roman Gonzalez
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.
Links
Other Emacs packages by the same author:
- minimal-emacs.d: This repository hosts a minimal Emacs configuration designed to serve as a foundation for your vanilla Emacs setup and provide a solid base for an enhanced Emacs experience.
- compile-angel.el: Speed up Emacs! This package guarantees that all .el files are both byte-compiled and native-compiled, which significantly speeds up Emacs.
- easysession.el: Easysession is lightweight Emacs session manager that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, the tab-bar, and the Emacs frames (with or without the Emacs frames size, width, and height).
- vim-tab-bar.el: Make the Emacs tab-bar Look Like Vim’s Tab Bar.
- elispcomp: A command line tool that allows compiling Elisp code directly from the terminal or from a shell script. It facilitates the generation of optimized .elc (byte-compiled) and .eln (native-compiled) files.
- tomorrow-night-deepblue-theme.el: The Tomorrow Night Deepblue Emacs theme is a beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette that is pleasing to the eyes. It features a deep blue background color that creates a calming atmosphere. The theme is also a great choice for those who miss the blue themes that were trendy a few years ago.
- Ultyas: A command-line tool designed to simplify the process of converting code snippets from UltiSnips to YASnippet format.
- dir-config.el: Automatically find and evaluate .dir-config.el Elisp files to configure directory-specific settings.
- flymake-bashate.el: A package that provides a Flymake backend for the bashate Bash script style checker.
- flymake-ansible-lint.el: An Emacs package that offers a Flymake backend for
ansible-lint
. - inhibit-mouse.el: A package that disables mouse input in Emacs, offering a simpler and faster alternative to the
disable-mouse
package. - quick-sdcv.el: This package enables Emacs to function as an offline dictionary by using the sdcv command-line tool directly within Emacs.
- enhanced-evil-paredit.el: An Emacs package that prevents parenthesis imbalance when using evil-mode with paredit. It intercepts evil-mode commands such as delete, change, and paste, blocking their execution if they would break the parenthetical structure.