From f5012249239eb3b578d5040d939faa6f54f083cd Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Thu, 13 Jun 2024 17:10:11 -0400 Subject: minor: disable eglot by default + minor C++ improvements + no theme by default --- lisp/resize-frame.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lisp/resize-frame.el (limited to 'lisp/resize-frame.el') diff --git a/lisp/resize-frame.el b/lisp/resize-frame.el new file mode 100644 index 0000000..3afeef4 --- /dev/null +++ b/lisp/resize-frame.el @@ -0,0 +1,51 @@ +;;; resize-frame.el --- A minor mode to resize frames easily. -*- lexical-binding: t; -*- + +;; Copyright (C) 2014 kuanyui + +;; Author: kuanyui +;; Keywords: frames, tools, convenience +;; License: WTFPL 1.0 + +;;; Commentary: + +;; Press "ESC `" and use arrow-keys to adjust frames. press any key to done. + +;;; Code: + +(defvar resize-frame-map + (let ((map (make-keymap))) + (define-key map (kbd "") 'enlarge-window) + (define-key map (kbd "") 'shrink-window) + (define-key map (kbd "") 'enlarge-window-horizontally) + (define-key map (kbd "") '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 to adjust frames."))) + +(defun resize-frame-done () + (interactive) + (setq resize-frame nil) + (message "Done.")) + +(global-set-key (kbd "ESC `") 'resize-frame) + +(provide 'resize-frame) +;;; resize-frame.el ends here -- cgit v1.2.1