|
|
@ -1,24 +1,80 @@ |
|
|
|
;; -*- lexical-binding: t; -*- |
|
|
|
|
|
|
|
;; Configure Melpa |
|
|
|
(defvar file-name-handler-alist-old file-name-handler-alist) |
|
|
|
|
|
|
|
(setq file-name-handler-alist nil |
|
|
|
message-log-max 16384 |
|
|
|
gc-cons-threshold 402653184 |
|
|
|
gc-cons-percentage 0.6 |
|
|
|
auto-window-vscroll nil) |
|
|
|
|
|
|
|
(add-hook 'after-init-hook |
|
|
|
`(lambda () |
|
|
|
(setq file-name-handler-alist file-name-handler-alist-old |
|
|
|
gc-cons-threshold 800000 |
|
|
|
gc-cons-percentage 0.1) |
|
|
|
(garbage-collect)) t) |
|
|
|
|
|
|
|
(setq package--init-file-ensured t |
|
|
|
package-enable-at-startup nil |
|
|
|
;; package-user-dir doom-elpa-dir |
|
|
|
;; package-gnupghome-dir (expand-file-name "gpg" doom-elpa-dir) |
|
|
|
package-archives |
|
|
|
`(("gnu" . "https://elpa.gnu.org/packages/") |
|
|
|
("melpa" . "https://melpa.org/packages/") |
|
|
|
("org" . "https://orgmode.org/elpa/"))) |
|
|
|
|
|
|
|
(package-initialize) |
|
|
|
|
|
|
|
;; Configure Use-Package |
|
|
|
(eval-when-compile |
|
|
|
(add-to-list 'load-path (concat user-emacs-directory "elpa/use-package-20190716.1829")) |
|
|
|
(add-to-list 'load-path (concat user-emacs-directory "elpa/bind-key-20180513.430")) |
|
|
|
;; Configure Melpa |
|
|
|
;; Package management |
|
|
|
;; set load-path manually |
|
|
|
;; don't call package-initialize |
|
|
|
(eval-and-compile |
|
|
|
(setq load-prefer-newer t |
|
|
|
package-user-dir "~/.emacs.d/elpa" |
|
|
|
package--init-file-ensured t ; so it doesn't call package initialize |
|
|
|
package-enable-at-startup nil) ; do not automatically load packages |
|
|
|
|
|
|
|
(unless (file-directory-p package-user-dir) |
|
|
|
(make-directory package-user-dir t))) |
|
|
|
|
|
|
|
(setq use-package-verbose t |
|
|
|
use-package-always-defer nil ;I'm not used to that |
|
|
|
use-package-minimum-reported-time 0.01) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Initialize package management |
|
|
|
(eval-when-compile ; when byte compiled skip this |
|
|
|
(require 'package) |
|
|
|
|
|
|
|
;; add aditional package archives |
|
|
|
(setq package-archives |
|
|
|
`(("gnu" . "https://elpa.gnu.org/packages/") |
|
|
|
("melpa" . "https://melpa.org/packages/") |
|
|
|
("org" . "https://orgmode.org/elpa/"))) |
|
|
|
|
|
|
|
;; initialize packages and ensure that use-package is installed |
|
|
|
(package-initialize) |
|
|
|
(unless (package-installed-p 'use-package) |
|
|
|
(package-refresh-contents) |
|
|
|
(package-install 'use-package)) ; install if it's missing |
|
|
|
(require 'use-package) |
|
|
|
(require 'bind-key)) |
|
|
|
(setq use-package-always-ensure t)) |
|
|
|
|
|
|
|
;; Define custom keymap prefixes |
|
|
|
(eval-and-compile |
|
|
|
(mapc #'(lambda (entry) |
|
|
|
(define-prefix-command (cdr entry)) |
|
|
|
(bind-key (car entry) (cdr entry))) |
|
|
|
'( |
|
|
|
;; ("C-," . my-ctrl-comma-map) |
|
|
|
;; ("<C-m>" . my-ctrl-m-map) |
|
|
|
;; ("C-h e" . my-ctrl-h-e-map) |
|
|
|
;; ("C-h x" . my-ctrl-h-x-map) |
|
|
|
("C-c b" . my-ctrl-c-b-map) |
|
|
|
;; ("C-c e" . my-ctrl-c-e-map) |
|
|
|
;; ("C-c m" . my-ctrl-c-m-map) |
|
|
|
;; ("C-c w" . my-ctrl-c-w-map) |
|
|
|
;; ("C-c y" . my-ctrl-c-y-map) |
|
|
|
;; ("C-c H" . my-ctrl-c-H-map) |
|
|
|
;; ("C-c N" . my-ctrl-c-N-map) |
|
|
|
;; ("C-c (" . my-ctrl-c-open-paren-map) |
|
|
|
;; ("C-c -" . my-ctrl-c-minus-map) |
|
|
|
;; ("C-c =" . my-ctrl-c-equals-map) |
|
|
|
;; ("C-c ." . my-ctrl-c-r-map) |
|
|
|
))) |
|
|
|
|
|
|
|
|
|
|
|
;; Compile function |
|
|
|
(defun compile-init () |
|
|
@ -77,6 +133,9 @@ |
|
|
|
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p) |
|
|
|
|
|
|
|
(setq browse-url-generic-program "brave" |
|
|
|
browse-url-browser-function 'browse-url-generic) |
|
|
|
|
|
|
|
(defun display-startup-echo-area-message () |
|
|
|
"Display startup echo area message." |
|
|
|
(message "Initialized in %s" (emacs-init-time))) |
|
|
@ -189,7 +248,7 @@ |
|
|
|
;; :defer t) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; https://github.com/jwiegley/use-package/blob/master/bind-key.el |
|
|
|
(use-package bind-key |
|
|
|
:ensure t |
|
|
|
:bind |
|
|
@ -205,6 +264,21 @@ |
|
|
|
("M-l" . downcase-dwim) |
|
|
|
) |
|
|
|
|
|
|
|
;; https://github.com/winterTTr/ace-jump-mode |
|
|
|
(use-package ace-jump-mode |
|
|
|
:bind |
|
|
|
(("C-c SPC" . just-one-space) |
|
|
|
("M-SPC" . ace-jump-mode))) |
|
|
|
|
|
|
|
;; https://github.com/abo-abo/ace-window |
|
|
|
(use-package ace-window |
|
|
|
:ensure t |
|
|
|
:bind |
|
|
|
("M-o" . ace-window) |
|
|
|
:init |
|
|
|
(setq aw-keys '(?a ?s ?h ?t ?g ?y ?n ?e ?o ?i)) |
|
|
|
) |
|
|
|
|
|
|
|
;; https://github.com/hlissner/emacs-doom-themes |
|
|
|
(use-package doom-themes |
|
|
|
:ensure t |
|
|
@ -218,6 +292,13 @@ |
|
|
|
:config |
|
|
|
(load-theme 'base16-onedark t)) |
|
|
|
|
|
|
|
;; https://github.com/Malabarba/beacon |
|
|
|
(use-package beacon |
|
|
|
:diminish |
|
|
|
:commands beacon-mode |
|
|
|
:init |
|
|
|
(setq beacon-size 80)) |
|
|
|
|
|
|
|
;; https://github.com/coldnew/linum-relative |
|
|
|
(use-package linum-relative |
|
|
|
:ensure t |
|
|
@ -279,6 +360,7 @@ |
|
|
|
:bind |
|
|
|
("C-c k" . helm-ag)) |
|
|
|
|
|
|
|
;; https://github.com/magnars/expand-region.el |
|
|
|
(use-package expand-region |
|
|
|
:ensure t |
|
|
|
:bind |
|
|
@ -294,6 +376,32 @@ |
|
|
|
("C-{" . mc/mark-previous-like-this) |
|
|
|
("C-(" . mc/unmark-previous-like-this)) |
|
|
|
|
|
|
|
;; https://github.com/joodland/bm |
|
|
|
(use-package bm |
|
|
|
:bind (("C-c b b" . bm-toggle) |
|
|
|
("C-c b n" . bm-next) |
|
|
|
("C-c b p" . bm-previous)) |
|
|
|
:commands (bm-repository-load |
|
|
|
bm-buffer-save |
|
|
|
bm-buffer-save-all |
|
|
|
bm-buffer-restore) |
|
|
|
:init |
|
|
|
(setq bm-restore-repository-on-load t) |
|
|
|
(setq bm-repository-file (concat user-emacs-directory "bookmark-repo")) |
|
|
|
(add-hook 'after-init-hook 'bm-repository-load) |
|
|
|
(add-hook 'find-file-hooks 'bm-buffer-restore) |
|
|
|
(add-hook 'after-revert-hook #'bm-buffer-restore) |
|
|
|
(add-hook 'kill-buffer-hook #'bm-buffer-save) |
|
|
|
(add-hook 'after-save-hook #'bm-buffer-save) |
|
|
|
(add-hook 'vc-before-checkin-hook #'bm-buffer-save) |
|
|
|
(add-hook 'kill-emacs-hook #'(lambda nil |
|
|
|
(bm-buffer-save-all) |
|
|
|
(bm-repository-save)))) |
|
|
|
|
|
|
|
;; https://github.com/rmuslimov/browse-at-remote |
|
|
|
(use-package browse-at-remote |
|
|
|
:bind ("C-c B" . browse-at-remote)) |
|
|
|
|
|
|
|
;; https://github.com/justbur/emacs-which-key |
|
|
|
(use-package which-key |
|
|
|
:ensure t |
|
|
@ -309,12 +417,11 @@ |
|
|
|
;; https://github.com/joaotavora/yasnippet |
|
|
|
(use-package yasnippet |
|
|
|
:ensure t |
|
|
|
:bind ("<tab>" . yas-expand) |
|
|
|
:hook (prog-mode . yas-minor-mode) |
|
|
|
:init |
|
|
|
(setq yas-snippet-dirs (list (concat user-emacs-directory "snippets"))) |
|
|
|
:config |
|
|
|
(yas-reload-all) |
|
|
|
(yas-minor-mode 1)) |
|
|
|
(yas-reload-all)) |
|
|
|
|
|
|
|
;; https://company-mode.github.io/ |
|
|
|
(use-package company |
|
|
@ -356,6 +463,17 @@ |
|
|
|
:ensure t |
|
|
|
:mode "\\.json\\'") |
|
|
|
|
|
|
|
;; https://github.com/antonj/scss-mode |
|
|
|
(use-package scss-mode |
|
|
|
:ensure t |
|
|
|
:mode ("\\.s?css\\'" . scss-mode)) |
|
|
|
|
|
|
|
;; https://elpa.gnu.org/packages/csv-mode.html |
|
|
|
(use-package csv-mode |
|
|
|
:disabled |
|
|
|
:ensure t |
|
|
|
:mode ("\\.csv\\'" . csv-mode)) |
|
|
|
|
|
|
|
;; https://orgmode.org/elpa.html |
|
|
|
(use-package org |
|
|
|
:commands (org-cycle-agenda-files org-capture) |
|
|
@ -470,8 +588,11 @@ |
|
|
|
;; If there is more than one, they won't work right. |
|
|
|
'(package-selected-packages |
|
|
|
(quote |
|
|
|
(doom-themes linum-relative org-bullets org-plus-contrib web-mode gitconfig-mode gitignore-mode rainbow-delimiters company company-mode projectile magit helm-ag helm-swoop yasnippet fic-mode which-key pdf-tools better-defaults use-package))) |
|
|
|
'(safe-local-variable-values (quote ((whitespace-line-column . 120))))) |
|
|
|
(browse-at-remote bm yasnippet which-key web-mode use-package scss-mode rainbow-delimiters projectile org-plus-contrib org-bullets multiple-cursors magit linum-relative json-mode helm-swoop helm-ag gitignore-mode gitconfig-mode fic-mode expand-region doom-themes doom-modeline dashboard company beacon ace-window ace-jump-mode))) |
|
|
|
'(safe-local-variable-values |
|
|
|
(quote |
|
|
|
((eval org-content 2) |
|
|
|
(whitespace-line-column . 120))))) |
|
|
|
(custom-set-faces |
|
|
|
;; custom-set-faces was added by Custom. |
|
|
|
;; If you edit it by hand, you could mess it up, so be careful. |
|
|
|