diff options
author | William Carroll <wpcarro@gmail.com> | 2019-03-05T18·26+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2019-03-05T18·26+0000 |
commit | 607bf103c32b2b7de7a669fc760852b0b6cb7951 (patch) | |
tree | 1f773b15d4e0470f060b3dd955667abfd7b1aba7 /configs | |
parent | 731faded8ddc845ab5a55f050c9ebc14a85f5c5a (diff) |
Parameterizes wpc/find-file function
Supports a filename as a parameter to my wrapped version of evil-find-file.
Diffstat (limited to 'configs')
-rw-r--r-- | configs/shared/emacs/.emacs.d/wpc/functions.el | 6 | ||||
-rw-r--r-- | configs/shared/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 d8419ad77157..1905449a615e 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 dee4dee128d4..0adc9ec4dd85 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 |