summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--init.el15
-rw-r--r--lisp/cpp.el1
-rw-r--r--lisp/general.el8
-rw-r--r--lisp/resize-frame.el51
-rw-r--r--lisp/resize_frame.el51
6 files changed, 115 insertions, 13 deletions
diff --git a/README.md b/README.md
index b0a5719..eb9124e 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ My emacs configuration file. This configuration only works with Emacs version 28
- Move line up/down: `M-<UP/DOWN>`
- Find references: `M-?`
- Kill buffer: `C-x k`
-- Toggle tree: `C-c ;`
+- Autocomplete: `C-.`
## Fonts
- I make use of `monaco` and `iosevka`.
diff --git a/init.el b/init.el
index ffad45c..1d4992d 100644
--- a/init.el
+++ b/init.el
@@ -29,13 +29,13 @@
gcs-done)))
;; Theme
-(use-package leuven-theme
- :ensure t
- :config
- (load-theme 'leuven t))
+;; (use-package leuven-theme
+;; :ensure t
+;; :config
+;; (load-theme 'leuven t))
-(use-package autothemer
- :ensure t)
+;; (use-package autothemer
+;; :ensure t)
(set-frame-parameter (selected-frame) 'alpha '(99 99))
@@ -54,6 +54,7 @@
;(require 'vc-annotate-lens-mode)
(require 'rust)
(require 'mk)
+(require 'resize-frame)
(require 'server)
@@ -65,7 +66,7 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
- '("ec8ff5e2c8a9eb38e49a9bea6297c2194bbe0c03982630d66db1570f5ae83d90" "2ca3da7d36b0d326f984530a07be54b272b5c313b1361989acf747d8b5616162" "80214de566132bf2c844b9dee3ec0599f65c5a1f2d6ff21a2c8309e6e70f9242" "b3737f86b86d52c7d06820c10dc2609e9192627fc02dd654f4f9eb336f24f511" "a6f9dd4844bfbfaf1162f04ae3c52070154ef28d18b5d482566015cf429492b0" "f149d9986497e8877e0bd1981d1bef8c8a6d35be7d82cba193ad7e46f0989f6a" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default))
+ '("f3781be0be23cc71c89b317489e07a4ad3e885f84c0a618692b53bbd69e60843" "0cf95236abcf59e05b1ea69b4edd53d293a5baec4fe4c3484543fee99bfd2204" "ec8ff5e2c8a9eb38e49a9bea6297c2194bbe0c03982630d66db1570f5ae83d90" "2ca3da7d36b0d326f984530a07be54b272b5c313b1361989acf747d8b5616162" "80214de566132bf2c844b9dee3ec0599f65c5a1f2d6ff21a2c8309e6e70f9242" "b3737f86b86d52c7d06820c10dc2609e9192627fc02dd654f4f9eb336f24f511" "a6f9dd4844bfbfaf1162f04ae3c52070154ef28d18b5d482566015cf429492b0" "f149d9986497e8877e0bd1981d1bef8c8a6d35be7d82cba193ad7e46f0989f6a" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default))
'(package-selected-packages
'(catppuccin-theme ef-themes org-attach-screenshot eglot treemacs-nerd-icons treemacs-all-the-icons nerd-icons kaolin-themes ement dart-mode yaml-mode meson-mode autothemer pyenv-mode pyvenv plantuml-mode ledger-mode centered-window perfect-margin-mode org-download helm-rg htmlize mood-line org-super-agenda material-theme esup glsl-mode fast-scroll yasnippet-snippets jsdoc helm-slack slack smart-mode-line magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2))
'(safe-local-variable-values '((js-indent-level . 4)))
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