diff options
author | William Carroll <wpcarro@gmail.com> | 2020-08-31T12·45+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-08-31T12·45+0100 |
commit | 7a2ca2b5c0fbcde70833875d63e996cb6bae71e6 (patch) | |
tree | 15201248c6a3a9f98f3c04cb430b5dfd4cc9a36a /emacs/.emacs.d/wpc/zle.el | |
parent | fd804c7b6ff5406fd5af6287d4398c6fd1277580 (diff) |
Lint zle.el
- Prefer dash instead of forward-slash - Remove stale TODOs - Add Version, Package-Requires
Diffstat (limited to '')
-rw-r--r-- | emacs/.emacs.d/wpc/zle.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/emacs/.emacs.d/wpc/zle.el b/emacs/.emacs.d/wpc/zle.el index 1b01da938456..d4aa88258fc4 100644 --- a/emacs/.emacs.d/wpc/zle.el +++ b/emacs/.emacs.d/wpc/zle.el @@ -1,5 +1,8 @@ ;;; zle.el --- Functions to mimmick my ZLE KBDs -*- lexical-binding: t -*- + ;; Author: William Carroll <wpcarro@gmail.com> +;; Version: 0.0.1 +;; Package-Requires: ((emacs "24")) ;;; Commentary: ;; This is primarily for personal use. The keybindings that I choose are those @@ -20,13 +23,11 @@ ;; Consider running `(zle-minor-mode)' to run this globally. Depending on your ;; configuration, it could be non-disruptive, disruptive, or extremely ;; disruptive. -;; -;; TODO: Consider adding (general-unbind 'insert "C-v") herein. ;;; Code: ;; subshell (C-j) -(defun zle/subshell () +(defun zle-subshell () "Insert the characters necessary to create a subshell." (interactive) (insert-char ?$) @@ -35,7 +36,7 @@ (insert-char ?\)))) ;; variable (C-v) -(defun zle/variable () +(defun zle-variable () "Insert the characters to reference a variable." (interactive) (insert-char ?$) @@ -44,7 +45,7 @@ (insert-char ?}))) ;; 2x dash (C-M--) -(defun zle/dash-dash () +(defun zle-dash-dash () "Insert the characters for flags with 2x dashes." (interactive) (insert-char ? ) @@ -52,7 +53,7 @@ (insert-char ?-)) ;; 1x quotes (M-') -(defun zle/single-quote () +(defun zle-single-quote () "Insert the characters to quickly create single quotes." (interactive) (insert-char ? ) @@ -61,7 +62,7 @@ (insert-char ?'))) ;; 2x quotes (M-") -(defun zle/double-quote () +(defun zle-double-quote () "Insert the characters to quickly create double quotes." (interactive) (insert-char ? ) @@ -69,14 +70,14 @@ (save-excursion (insert-char ?\"))) -(defvar zle/kbds +(defvar zle-kbds (let ((map (make-sparse-keymap))) (bind-keys :map map - ("C-j" . zle/subshell) - ("C-v" . zle/variable) - ("C-M--" . zle/dash-dash) - ("M-'" . zle/single-quote) - ("M-\"" . zle/double-quote)) + ("C-j" . zle-subshell) + ("C-v" . zle-variable) + ("C-M--" . zle-dash-dash) + ("M-'" . zle-single-quote) + ("M-\"" . zle-double-quote)) map) "Keybindings shaving milliseconds off of typing.") @@ -84,7 +85,7 @@ "A minor mode mirroring my ZLE keybindings." :init-value nil :lighter " zle" - :keymap zle/kbds) + :keymap zle-kbds) (provide 'zle) ;;; zle.el ends here |