From 607bf103c32b2b7de7a669fc760852b0b6cb7951 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 5 Mar 2019 18:26:53 +0000 Subject: [PATCH] Parameterizes wpc/find-file function Supports a filename as a parameter to my wrapped version of evil-find-file. --- configs/shared/emacs/.emacs.d/wpc/functions.el | 6 +++--- .../emacs/.emacs.d/wpc/packages/wpc-keybindings.el | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/configs/shared/emacs/.emacs.d/wpc/functions.el b/configs/shared/emacs/.emacs.d/wpc/functions.el index d8419ad77..1905449a6 100644 --- a/configs/shared/emacs/.emacs.d/wpc/functions.el +++ b/configs/shared/emacs/.emacs.d/wpc/functions.el @@ -93,11 +93,11 @@ (evil-window-vsplit) (call-interactively #'yas-new-snippet)) -(defun wpc/edit-init-el () - "Creates a window split and then edits the init.el file." +(defun wpc/find-file-split (filename) + "Creates a window split and then edits `filename'." (interactive) (evil-window-vsplit) - (find-file "~/.emacs.d/init.el")) + (find-file filename)) (defun wpc/jump-to-parent-file () "Jumps to a React store or component's parent file. Useful for store or index file." diff --git a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el index dee4dee12..0adc9ec4d 100644 --- a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el +++ b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el @@ -25,7 +25,6 @@ "sl" #'wpc/evil-window-vsplit-right "sh" #'evil-window-vsplit "sk" #'evil-window-split - "sj" #'wpc/evil-window-split-down "sj" #'wpc/evil-window-split-down) (general-nmap :keymaps 'override @@ -62,8 +61,17 @@ "P" #'smerge-prev "b" #'ivy-switch-buffer "gs" #'magit-status + "es" #'wpc/create-snippet - "ev" #'wpc/edit-init-el + "ev" (lambda () (interactive) (wpc/find-file-split "~/.config/nvim/init.vim")) + "ee" (lambda () (interactive) (wpc/find-file-split "~/.emacs.d/init.el")) + "ez" (lambda () (interactive) (wpc/find-file-split "~/.zshrc")) + "ea" (lambda () (interactive) (wpc/find-file-split "~/aliases.zsh")) + "ef" (lambda () (interactive) (wpc/find-file-split "~/functions.zsh")) + "el" (lambda () (interactive) (wpc/find-file-split "~/variables.zsh")) + "ex" (lambda () (interactive) (wpc/find-file-split "~/.xsessionrc")) + "ei" (lambda () (interactive) (wpc/find-file-split "~/.config/i3/config")) + "B" #'magit-blame "w" #'save-buffer "x" #'evil-save-and-close