Adds maximize-vertically function

This commit is contained in:
Ag Ibragimov 2018-01-05 16:43:51 -08:00 committed by syl20bnr
parent d9e5652ae7
commit f0a5c0960c
2 changed files with 13 additions and 2 deletions

View File

@ -115,7 +115,7 @@ automatically applied to."
;; https://tsdh.wordpress.com/2007/03/28/deleting-windows-vertically-or-horizontally/
(defun spacemacs/maximize-horizontally ()
"Delete all windows left or right of the current window."
"Delete all windows to the left and right of the current window."
(interactive)
(require 'windmove)
(save-excursion
@ -124,6 +124,16 @@ automatically applied to."
(while (condition-case nil (windmove-right) (error nil))
(delete-window))))
(defun spacemacs/maximize-vertically ()
"Delete all windows above and below the current window."
(interactive)
(require 'windmove)
(save-excursion
(while (condition-case nil (windmove-up) (error nil))
(delete-window))
(while (condition-case nil (windmove-down) (error nil))
(delete-window))))
(defun spacemacs/toggle-centered-buffer-mode ()
"Toggle `spacemacs-centered-buffer-mode'."
(interactive)

View File

@ -442,7 +442,8 @@
"w/" 'split-window-right
"w=" 'balance-windows-area
"w+" 'spacemacs/window-layout-toggle
"w_" 'spacemacs/maximize-horizontally)
"w_" 'spacemacs/maximize-horizontally
"w|" 'spacemacs/maximize-vertically)
;; text -----------------------------------------------------------------------
(defalias 'count-region 'count-words-region)