How to call enlarge-window function depends on current window in Emacs -
i set keybinding following.
(global-set-key [m-down] 'shrink-window) (global-set-key [m-up] 'enlarge-window)
so m-up can enlarge-window , m-down otherwise. want enlarge window m-up if current window lower side. , if current window upper side m-up want call shrink-window function.
likewise want shrink window m-down if current window lower side , enlarge if current window upper side.
in other words, want indicate direction of window separator.
how can write function?
i finishing code answer came up. oh well.
(require 'windmove) (global-set-key [m-up] (lambda() (interactive) (call-interactively (if (windmove-find-other-window 'up) 'enlarge-window 'shrink-window)))) (global-set-key [m-down] (lambda() (interactive) (call-interactively (if (not (windmove-find-other-window 'up)) 'enlarge-window 'shrink-window))))
Comments
Post a Comment