Parameterizes wpc/find-file function

Supports a filename as a parameter to my wrapped version of
evil-find-file.
This commit is contained in:
William Carroll 2019-03-05 18:26:53 +00:00
parent 731faded8d
commit 607bf103c3
2 changed files with 13 additions and 5 deletions

View file

@ -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."

View file

@ -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