about summary refs log tree commit diff
path: root/configs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-07-30T01·50-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-07-30T01·50-0400
commite6eda451b5eb9d36187892c53b82c733908674fc (patch)
tree81ce10563d24fa44e248e5175d5bfd840853c856 /configs
parentb3a40e423c88e4ac58511d85cce39e1b92b40041 (diff)
Revises custom fns for evil window splitting
Diffstat (limited to 'configs')
-rw-r--r--configs/shared/.emacs28
1 files changed, 22 insertions, 6 deletions
diff --git a/configs/shared/.emacs b/configs/shared/.emacs
index 2c40aca45561..b8104f2a379a 100644
--- a/configs/shared/.emacs
+++ b/configs/shared/.emacs
@@ -347,6 +347,26 @@
   (define-key dired-mode-map (kbd "C-l") nil))
 
 
+(defun wc/evil-window-split-down ()
+  "Convenience function that does 3 things: 1. creates a horizontal split (downward),2. Center both the previous window and the newly created window,3. Moves (downward) to the newly created window."
+  (interactive)
+  (evil-window-split-down)
+  (call-interactively 'evil-window-up)
+  (call-interactively 'evil-scroll-line-to-center)
+  (call-interactively 'evil-window-down)
+  (call-interactively 'evil-scroll-line-to-center))
+
+
+(defun wc/evil-window-split ()
+  "Convenience function that does 3 things: 1. creates a horizontal split (upward),2. Center both the previous window and the newly created window,3. Moves (upward) to the newly created window."
+  (interactive)
+  (evil-window-split)
+  (call-interactively 'evil-scroll-line-to-center)
+  (call-interactively 'evil-window-down)
+  (call-interactively 'evil-scroll-line-to-center)
+  (call-interactively 'evil-window-up))
+
+
 ;; Evil Settings
 (use-package evil
   :ensure t
@@ -383,15 +403,11 @@
               ("M-." . nil)
               ("s" . nil)
               ("C-p" . nil)
-              ("C-h" . evil-window-left)
-              ("C-l" . evil-window-right)
-              ("C-k" . evil-window-up)
-              ("C-j" . evil-window-down)
               ("g c" . comment-or-uncomment-region)
               ("s h" . evil-window-vsplit)
               ("s l" . evil-window-vsplit-right)
-              ("s k" . evil-window-split)
-              ("s j" . evil-window-split-down)
+              ("s k" . wc/evil-window-split)
+              ("s j" . wc/evil-window-split-down)
               ("H" . evil-first-non-blank)
               ("L" . evil-end-of-line)
               ("<S-left>" . evil-window-increase-width)