Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,33 @@ | |||
(defun osx-notify (title message) | (defun osx-notify (title message) | ||
(start-process "osx-notify" nil "terminal-notifier" "-title" title "-message" message)) | (start-process "osx-notify" nil "terminal-notifier" "-title" title "-message" message)) | ||
|
|
||
;; Windows layout | |||
|
|||
(defun change-split-type (split-fn &optional arg) | |||
"Change 3 window style from horizontal to vertical and vice-versa" | |||
(let ((bufList (mapcar 'window-buffer (window-list)))) | |||
(select-window (get-largest-window)) | |||
(funcall split-fn arg) | |||
(mapcar* 'set-window-buffer (window-list) bufList))) | |||
|
|||
(defun change-split-type-2 (&optional arg) | |||
"Changes splitting from vertical to horizontal and vice-versa" | |||
(interactive "P") | |||
(let ((split-type (lambda (&optional arg) | |||
(delete-other-windows-internal) | |||
(if arg (split-window-vertically) | |||
(split-window-horizontally))))) | |||
(change-split-type split-type arg))) | |||
|
|||
(defvar *larsen/split-layout-type* t) | |||
|
|||
(defun toggle-split-layout () | |||
(interactive) | |||
(progn (change-split-type-2 *larsen/split-layout-type*) | |||
(if *larsen/split-layout-type* | |||
(setq *larsen/split-layout-type* nil) | |||
(setq *larsen/split-layout-type* t)))) | |||
|
|||
(global-set-key (kbd "M-<f1>") 'toggle-split-layout) | |||
|
|||
(provide 'larsen-functions) | (provide 'larsen-functions) |