Add resize-frame minor-mod
This commit is contained in:
parent
a5061a5904
commit
b9d9f3d789
1 changed files with 56 additions and 0 deletions
56
config.org
56
config.org
|
|
@ -24,6 +24,62 @@ This configuration requires the installation of :
|
||||||
|
|
||||||
When first checking out this config, run =irony-install-server= to make and install the irony-server.
|
When first checking out this config, run =irony-install-server= to make and install the irony-server.
|
||||||
|
|
||||||
|
* Resize frame
|
||||||
|
|
||||||
|
Minor-mode to easily resize frames (works with EXWM (firefox, ...)).
|
||||||
|
Courtesy goes to kuanyui (https://gist.github.com/kuanyui/65a408d393871048771c):
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
;;; resize-frame.el --- A minor mode to resize frames easily. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2014 kuanyui
|
||||||
|
|
||||||
|
;; Author: kuanyui <azazabc123@gmail.com>
|
||||||
|
;; Keywords: frames, tools, convenience
|
||||||
|
;; License: WTFPL 1.0
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Press "ESC `" and use arrow-keys or i/j/k/l to adjust frames. press any key to done.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(defvar resize-frame-map
|
||||||
|
(let ((map (make-keymap)))
|
||||||
|
(define-key map (kbd "<up>") 'enlarge-window)
|
||||||
|
(define-key map (kbd "<down>") 'shrink-window)
|
||||||
|
(define-key map (kbd "<right>") 'enlarge-window-horizontally)
|
||||||
|
(define-key map (kbd "<left>") 'shrink-window-horizontally)
|
||||||
|
(set-char-table-range (nth 1 map) t 'resize-frame-done)
|
||||||
|
(define-key map (kbd "C-p") 'enlarge-window)
|
||||||
|
(define-key map (kbd "C-n") 'shrink-window)
|
||||||
|
(define-key map (kbd "C-f") 'enlarge-window-horizontally)
|
||||||
|
(define-key map (kbd "C-b") 'shrink-window-horizontally)
|
||||||
|
map))
|
||||||
|
|
||||||
|
(define-minor-mode resize-frame
|
||||||
|
"A simple minor mode to resize-frame.
|
||||||
|
C-c C-c to apply."
|
||||||
|
;; The initial value.
|
||||||
|
:init-value nil
|
||||||
|
;; The indicator for the mode line.
|
||||||
|
:lighter " ResizeFrame"
|
||||||
|
;; The minor mode bindings.
|
||||||
|
:keymap resize-frame-map
|
||||||
|
:global t
|
||||||
|
(if (<= (length (window-list)) 1)
|
||||||
|
(progn (setq resize-frame nil)
|
||||||
|
(message "Only root frame exists, abort."))
|
||||||
|
(message "Use arrow-keys or i/j/k/l to adjust frames.")))
|
||||||
|
|
||||||
|
(defun resize-frame-done ()
|
||||||
|
(interactive)
|
||||||
|
(setq resize-frame nil)
|
||||||
|
(message "Done."))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-x C-r") 'resize-frame)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* General stuff
|
* General stuff
|
||||||
** Unsorted
|
** Unsorted
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue