From 7a2ca2b5c0fbcde70833875d63e996cb6bae71e6 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 31 Aug 2020 13:45:14 +0100 Subject: Lint zle.el - Prefer dash instead of forward-slash - Remove stale TODOs - Add Version, Package-Requires --- emacs/.emacs.d/wpc/zle.el | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'emacs/.emacs.d/wpc/zle.el') 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 +;; 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 -- cgit 1.4.1