diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/cpp.el | 1 | ||||
-rw-r--r-- | lisp/general.el | 8 | ||||
-rw-r--r-- | lisp/resize-frame.el | 51 | ||||
-rw-r--r-- | lisp/resize_frame.el | 51 |
4 files changed, 106 insertions, 5 deletions
diff --git a/lisp/cpp.el b/lisp/cpp.el index 77a52d8..c22f771 100644 --- a/lisp/cpp.el +++ b/lisp/cpp.el @@ -14,6 +14,7 @@ (c-set-offset 'arglist-cont-non-empty '+) (c-set-offset 'arglist-close '+) (c-set-offset 'statement-cont 0) + (c-set-offset 'statement-case-open 0) ) (setup-c) diff --git a/lisp/general.el b/lisp/general.el index 95966e4..e80bdd7 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -245,7 +245,8 @@ :defer t :init (add-hook 'after-init-hook 'global-company-mode) :config - (setq company-idle-delay 0.1 + (bind-key* (kbd "C-.") 'company-complete) + (setq company-idle-delay nil company-minimum-prefix-length 2 company-tooltip-limit 10 company-backends '((company-capf company-gtags company-elisp company-css company-dabbrev company-nxml)) @@ -258,7 +259,6 @@ :defer t :init (company-quickhelp-mode 1) :config - (setq company-quickhelp-delay 0.1) (setq company-quickhelp-color-background (face-attribute 'default :background)) ) @@ -270,9 +270,7 @@ :bind ("<f2>" . #'eglot-rename) :config (add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd-19")) - (add-to-list 'eglot-server-programs `((dart-mode) "/home/matthew/Programs/flutter/bin/dart" "language-server")) - (add-hook 'c-mode-common-hook 'eglot-ensure) - (add-hook 'dart-mode-hook 'eglot-ensure)) + (add-to-list 'eglot-server-programs `((dart-mode) "/home/matthew/Programs/flutter/bin/dart" "language-server"))) ;; (set-face-underline 'eglot-highlight-symbol-face t) 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 <azazabc123@gmail.com> +;; 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 "<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 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 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 <azazabc123@gmail.com> +;; 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 "<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 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 |