Files
.emacs.d/modules/siren-window-management.el
Jim Myhrberg c791150a06 Add rewritten config, dubbed emacs-siren
I've taken a lot of inspiration from Emacs-Prelude when it came to the
structure of this rewritten config. I didn't want to use Prelude as I
don't agree with all it's defaults, nor do I want to have to deal with
any future changes in Prelude that might break things for me. So instead
I went down the fully custom path, but heavily inspired by Prelude, both
in terms of file/code structure, and also some of it's features.

Compared to my old config setup, it's got most of the same things, but
nearly everything is in a module file now, making it easy to fully
enable/disable certain features.
2015-10-04 08:56:07 +01:00

33 lines
909 B
EmacsLisp

;;
;; window-management
;;
(defun ignore-error-wrapper (fn)
"Funtion return new function that ignore errors.
The function wraps a function with `ignore-errors' macro."
(lexical-let ((fn fn))
(lambda ()
(interactive)
(ignore-errors
(funcall fn)))))
(siren-require-packages '(buffer-move))
(require 'windmove)
(require 'buffer-move)
;; Navigate to windows
(global-set-key (kbd "M-k") (ignore-error-wrapper 'windmove-down))
(global-set-key (kbd "M-i") (ignore-error-wrapper 'windmove-up))
(global-set-key (kbd "M-j") (ignore-error-wrapper 'windmove-left))
(global-set-key (kbd "M-l") (ignore-error-wrapper 'windmove-right))
;; Swap buffers between windows
(global-set-key (kbd "M-K") 'buf-move-down)
(global-set-key (kbd "M-I") 'buf-move-up)
(global-set-key (kbd "M-J") 'buf-move-left)
(global-set-key (kbd "M-L") 'buf-move-right)
(provide 'siren-window-management)