The bufferwizard Emacs package offers a suite of helper functions:
(bufferwizard-toggle-highlight-at-point)
: Toggles highlighting for the symbol at point. If a selection is active, it highlights the selected text instead. This function checks whether the symbol at point or the selected text is currently highlighted. If it is, the highlight is removed; otherwise, it is applied. (This serves as a lightweight alternative to thehighlight-symbol
package.)(bufferwizard-replace-symbol-at-point)
: Replace occurrences of a symbol at point with a specified string.(bufferwizard-clone-indirect-buffer)
and(bufferwizard-clone-and-switch-to-indirect-buffer)
: These functions are enhanced versions of the built-inclone-indirect-buffer
. They create an indirect buffer with the same content as the current buffer while preserving the point position, window start, and horizontal scroll position. This package also provides the(bufferwizard-switch-to-base-buffer)
function, which allows switching from an indirect buffer to its corresponding base buffer.
To install bufferwizard
with straight.el
:
- It if hasn't already been done, add the straight.el bootstrap code to your init file.
- Add the following code to the Emacs init file:
(use-package bufferwizard
:ensure t
:straight (bufferwizard
:type git
:host github
:repo "jamescherti/bufferwizard.el"))
To install bufferwizard
with use-package
and :vc
(Emacs >= 30):
(use-package bufferwizard
:ensure t
:vc (:url "https://github.com/jamescherti/bufferwizard.el"
:rev :newest))
The functions (bufferwizard-toggle-highlight-at-point)
and (bufferwizard-replace-symbol-at-point)
depend on built-in functions that can be customized via the following variable:
-
case-fold-search
: This buffer-local variable determines the behavior of(bufferwizard-toggle-highlight-at-point)
and(bufferwizard-replace-symbol-at-point)
. When set to t (default), both symbol highlighting and searches become case-insensitive, matching symbols regardless of case. When set to nil, they become case-sensitive, matching symbols only when the case exactly matches the text in the buffer. Example:;; Setting case-fold-search to nil enables case-sensitive symbol highlighting ;; and search/replace (setq-default case-fold-search nil)
-
case-replace
: When non-nil, this variable ensures that(bufferwizard-replace-symbol-at-point)
preserves the case of the original text during replacements. Example:;; t means (bufferwizard-replace-symbol-at-point) should preserve case in ;; replacements. (setq case-replace t)
The bufferwizard
Emacs package has been written by James Cherti and is distributed under terms of the GNU General Public License version 3, or, at your choice, any later version.
Copyright (C) 2024-2025 James Cherti
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.
Other Emacs packages by the same author:
- 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.
- outline-indent.el: An Emacs package that provides a minor mode that enables code folding and outlining based on indentation levels for various indentation-based text files, such as YAML, Python, and other indented text files.
- 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.
- stripspace.el: Ensure Emacs Automatically removes trailing whitespace before saving a buffer, with an option to preserve the cursor column.
- persist-text-scale.el: Ensure that all adjustments made with text-scale-increase and text-scale-decrease are persisted and restored across sessions.
- pathaction.el: Execute the pathaction command-line tool from Emacs. The pathaction command-line tool enables the execution of specific commands on targeted files or directories. Its key advantage lies in its flexibility, allowing users to handle various types of files simply by passing the file or directory as an argument to the pathaction tool. The tool uses a .pathaction.yaml rule-set file to determine which command to execute. Additionally, Jinja2 templating can be employed in the rule-set file to further customize the commands.