This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; describe-symbol-at-point.el --- Describe variable or function at point -*- lexical-binding: t; -*- | |
;; Description: Clear the contents of the *Messages* buffer if it is the current buffer. | |
;; Gits URL: https://gist.github.com/jamescherti/abb288cb98f5f9f08431cc29225273fe | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-describe-elisp-symbol-at-point () | |
"Describe the symbol at point as either a variable or a function. | |
This function determines whether the symbol at point is a variable or a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Clear the contents of the *Messages* buffer if it is the current buffer. | |
;; Gits URL: https://gist.github.com/jamescherti/52e8fe8700ab394163bb99f2b8d456fd | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-clear-messages-buffer () | |
"Clear the contents of the *Messages* buffer if it is the current buffer." | |
(when (string= (buffer-name) "*Messages*") | |
(let ((was-read-only buffer-read-only)) | |
(when was-read-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Enable multi-line commenting and indenting in Emacs | |
;; Gits URL: https://gist.github.com/jamescherti/b8987b3299c0b567f1fdfffc1878a686 | |
;; License: MIT | |
;; Author: James Cherti | |
;; Enable multi-line commenting. This allows comments to span multiple lines, | |
;; which is useful for writing longer comments or docstrings. | |
(setq comment-multi-line t) | |
;; Bind the `RET` (Return) key to `comment-indent-new-line`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Emacs Evil: Comment or uncomment line or visual selection | |
;; Gits URL: https://gist.github.com/jamescherti/2aa95dc674ba024114d25824ddef8d7b | |
;; License: MIT | |
(with-eval-after-load "evil" | |
(evil-define-operator my-evil-comment-or-uncomment (beg end) | |
"Toggle comment for the region between BEG and END." | |
(interactive "<r>") | |
(comment-or-uncomment-region beg end)) | |
(evil-define-key 'normal 'global (kbd "gc") 'my-evil-comment-or-uncomment)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Emacs: Fix issue that prevents `newline-and-indent' | |
;; from using `indent-relative' or `indent-relative-first-indent-point'. | |
;; | |
;; Gits URL: https://gist.github.com/jamescherti/d8f23d7c5a0ad8885934fb6dec75138a | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-indent-relative () | |
"Indent the current line based on the indentation of the previous non-blank line. | |
If the first indentation position of the previous non-blank line is greater than |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Emacs Vdiff: Synchronize the text-scale (font size) across all vdiff buffers | |
;; Gits URL: https://gist.github.com/jamescherti/e1f64d56dc1e6bffa2fcb9d2ae7b7a83 | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-vdiff-sync-text-scale (&rest args) | |
"Synchronize the text-scale (font size) across all vdiff buffers." | |
(when (bound-and-true-p vdiff-mode) | |
(let ((ts-amount text-scale-mode-amount)) | |
(dolist (window (vdiff--all-windows)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Emacs Evil: Configure Jinx (spell checker) | |
;; Gits URL: | |
;; License: MIT | |
;; Author: James Cherti | |
(use-package jinx | |
:defer t | |
:commands jinx-mode | |
:init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Emacs Evil: Start a forward search without jumping to the next item. | |
;; Gits URL: https://gist.github.com/jamescherti/867e9fd0ce640107d0fe0d2f58502fad | |
;; License: MIT | |
;; Author: James Cherti | |
(evil-define-motion my-evil-ex-search-forward (count) | |
"Start a forward search without jumping to the next item." | |
:jump t | |
:type exclusive | |
:repeat evil-repeat-ex-search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Reload the currently active theme to reset all faces. | |
;; Gits URL: https://gist.github.com/jamescherti/202cd241e31af226c5b6d772a0d754e8 | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-reload-theme () | |
"Reload the currently active theme to reset all faces." | |
(interactive) | |
(let ((current-theme (car custom-enabled-themes))) | |
(when current-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Description: Set all attributes of the specified FACE to `unspecified'. | |
;; Gits URL: https://gist.github.com/jamescherti/316e2f87b9e8f0af9a560ee594552083 | |
;; License: MIT | |
;; Author: James Cherti | |
(defun my-reset-face-attributes (face) | |
"Set all attributes of the specified FACE to `unspecified'." | |
(when (facep face) | |
(let ((attributes (face-all-attributes face))) | |
(dolist (attr attributes) |
NewerOlder