add mwim
This commit is contained in:
7 files changed
+47
-14
No files matched your search
@@ -25,3 +25,6 @@
|
|||||||
[submodule "site-lisp/symbol-overlay"]
|
[submodule "site-lisp/symbol-overlay"]
|
||||||
path = site-lisp/symbol-overlay
|
path = site-lisp/symbol-overlay
|
||||||
url = https://github.com/wolray/symbol-overlay.git
|
url = https://github.com/wolray/symbol-overlay.git
|
||||||
|
[submodule "site-lisp/mwim"]
|
||||||
|
path = site-lisp/mwim
|
||||||
|
url = https://github.com/alezost/mwim.el.git
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
;; -*- coding: utf-8; lexical-binding: t; -*-
|
;; -*- coding: utf-8; lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar creature-gc-cons-threshold
|
(defvar creature/gc-cons-threshold
|
||||||
(if (display-graphic-p) (* 64 1024 1024) (* 16 1024 1024))
|
(if (display-graphic-p) (* 64 1024 1024) (* 16 1024 1024))
|
||||||
"The default value to use for `gc-cons-threshold'.
|
"The default value to use for `gc-cons-threshold'.
|
||||||
If freezing sometimes, decrease it. If stuttering, increase it.")
|
If freezing sometimes, decrease it. If stuttering, increase it.")
|
||||||
|
|
||||||
(defvar creature-gc-cons-upper-limit
|
(defvar creature/gc-cons-upper-limit
|
||||||
(if (display-graphic-p) (* 512 1024 1024) (* 128 1024 1024))
|
(if (display-graphic-p) (* 512 1024 1024) (* 128 1024 1024))
|
||||||
"The temporary value for `gc-cons-threshold' to defer it.")
|
"The temporary value for `gc-cons-threshold' to defer it.")
|
||||||
|
|
||||||
(defvar creature-gc-timer (run-with-idle-timer 10 t #'garbage-collect)
|
(defvar creature/gc-timer (run-with-idle-timer 10 t #'garbage-collect)
|
||||||
"Run garbage collection when idle 10s.")
|
"Run garbage collection when idle 10s.")
|
||||||
|
|
||||||
(defvar default-file-name-handler-alist file-name-handler-alist
|
(defvar default-file-name-handler-alist file-name-handler-alist
|
||||||
"Temporary `file-name-handler-alist' for restore after startup.")
|
"Temporary `file-name-handler-alist' for restore after startup.")
|
||||||
|
|
||||||
;; Speed up startup
|
;; Speed up startup
|
||||||
(defun creature-enlarge-gc-cons-threshold ()
|
(defun creature/enlarge-gc-cons-threshold ()
|
||||||
"Enlarge garbage collection threshold."
|
"Enlarge garbage collection threshold."
|
||||||
(setq gc-cons-percentage 0.6
|
(setq gc-cons-percentage 0.6
|
||||||
gc-cons-threshold creature-gc-cons-upper-limit))
|
gc-cons-threshold creature/gc-cons-upper-limit))
|
||||||
|
|
||||||
(defun creature-normalize-gc-cons-threshold ()
|
(defun creature/normalize-gc-cons-threshold ()
|
||||||
"Normalize garbage collection threshold."
|
"Normalize garbage collection threshold."
|
||||||
(setq gc-cons-percentage 0.1
|
(setq gc-cons-percentage 0.1
|
||||||
gc-cons-threshold creature-gc-cons-threshold))
|
gc-cons-threshold creature/gc-cons-threshold))
|
||||||
|
|
||||||
(creature-enlarge-gc-cons-threshold)
|
(creature/enlarge-gc-cons-threshold)
|
||||||
(setq file-name-handler-alist nil)
|
(setq file-name-handler-alist nil)
|
||||||
|
|
||||||
(add-hook 'emacs-startup-hook
|
(add-hook 'emacs-startup-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(creature-normalize-gc-cons-threshold)
|
(creature/normalize-gc-cons-threshold)
|
||||||
(setq file-name-handler-alist default-file-name-handler-alist)
|
(setq file-name-handler-alist default-file-name-handler-alist)
|
||||||
|
|
||||||
(setq read-process-output-max (* 1024 1024))
|
(setq read-process-output-max (* 1024 1024))
|
||||||
@@ -45,9 +45,9 @@ If freezing sometimes, decrease it. If stuttering, increase it.")
|
|||||||
|
|
||||||
;; Avoid GC while minibuffer active.
|
;; Avoid GC while minibuffer active.
|
||||||
(add-hook 'minibuffer-setup-hook
|
(add-hook 'minibuffer-setup-hook
|
||||||
#'creature-enlarge-gc-cons-threshold)
|
#'creature/enlarge-gc-cons-threshold)
|
||||||
(add-hook 'minibuffer-exit-hook
|
(add-hook 'minibuffer-exit-hook
|
||||||
#'creature-normalize-gc-cons-threshold)))
|
#'creature/normalize-gc-cons-threshold)))
|
||||||
|
|
||||||
(defconst creature/config-dir
|
(defconst creature/config-dir
|
||||||
(file-name-directory
|
(file-name-directory
|
||||||
@@ -101,6 +101,7 @@ If freezing sometimes, decrease it. If stuttering, increase it.")
|
|||||||
(require 'init-built-in)
|
(require 'init-built-in)
|
||||||
(require 'init-git)
|
(require 'init-git)
|
||||||
(require 'init-edit)
|
(require 'init-edit)
|
||||||
|
(require 'init-theme)
|
||||||
|
|
||||||
(require 'which-key)
|
(require 'which-key)
|
||||||
(setq which-key-show-early-on-C-h t)
|
(setq which-key-show-early-on-C-h t)
|
||||||
|
|||||||
@@ -27,9 +27,6 @@
|
|||||||
;; Highlight trail whitespace
|
;; Highlight trail whitespace
|
||||||
(setq show-trailing-whitespace t)
|
(setq show-trailing-whitespace t)
|
||||||
|
|
||||||
(global-whitespace-mode 1)
|
|
||||||
|
|
||||||
|
|
||||||
;; Save minibuffer history
|
;; Save minibuffer history
|
||||||
(savehist-mode)
|
(savehist-mode)
|
||||||
(setq history-length 1000
|
(setq history-length 1000
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
;; -*- coding: utf-8; lexical-binding: t; -*-
|
;; -*- coding: utf-8; lexical-binding: t; -*-
|
||||||
|
|
||||||
(require 'lazy-load)
|
(require 'lazy-load)
|
||||||
|
|
||||||
;;; symbol-overlay-map
|
;;; symbol-overlay-map
|
||||||
@@ -19,4 +20,10 @@
|
|||||||
"symbol-overlay")
|
"symbol-overlay")
|
||||||
|
|
||||||
|
|
||||||
|
;;; mwim
|
||||||
|
(lazy-load-global-keys
|
||||||
|
'(("C-a" . mwim-beginning-of-code-or-line)
|
||||||
|
("C-e" . mwim-end-of-code-or-line))
|
||||||
|
"mwim")
|
||||||
|
|
||||||
(provide 'init-edit)
|
(provide 'init-edit)
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
;; -*- coding: utf-8; lexical-binding: t; -*-
|
;; -*- coding: utf-8; lexical-binding: t; -*-
|
||||||
|
|
||||||
(require 'lazy-load)
|
(require 'lazy-load)
|
||||||
(lazy-load-global-keys
|
(lazy-load-global-keys
|
||||||
'(("C-x g" . magit-status))
|
'(("C-x g" . magit-status))
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
;; -*- coding: utf-8; lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Pulse
|
||||||
|
(defvar creature/pulse-enable t
|
||||||
|
"Whether enable pulse for scroll and switch window.")
|
||||||
|
|
||||||
|
(defun creature/pulse-line (&rest _)
|
||||||
|
"Pulse the current line."
|
||||||
|
(when creature/pulse-enable
|
||||||
|
(pulse-momentary-highlight-one-line (point))))
|
||||||
|
|
||||||
|
;; pulse setup, like beacon
|
||||||
|
(with-eval-after-load 'pulse
|
||||||
|
(setq pulse-delay 0.04))
|
||||||
|
|
||||||
|
(dolist (command '(scroll-up
|
||||||
|
scroll-down
|
||||||
|
recenter))
|
||||||
|
(advice-add command :after #'creature/pulse-line))
|
||||||
|
(add-to-list 'window-selection-change-functions #'creature/pulse-line)
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-theme)
|
||||||
Submodule
+1
Submodule site-lisp/mwim added at b4f3edb4c0.
Reference in new issue
Block a user