diff options
author | gxlin <[email protected]> | 2021-07-06 22:00:15 +0800 |
---|---|---|
committer | gxlin <[email protected]> | 2021-07-06 22:00:15 +0800 |
commit | 43b356933766807cff3cce9dda6955469f4df49c (patch) | |
tree | b13768fdd9c3d4fd00571870639a9100b1086bbf /.emacs.d/init.el | |
parent | 20f2705342e1c444bda1b4c9a2077408ae14389a (diff) | |
download | dotfiles-43b356933766807cff3cce9dda6955469f4df49c.tar.gz dotfiles-43b356933766807cff3cce9dda6955469f4df49c.tar.bz2 dotfiles-43b356933766807cff3cce9dda6955469f4df49c.zip |
Reorganized emacs config
Diffstat (limited to '.emacs.d/init.el')
-rw-r--r-- | .emacs.d/init.el | 107 |
1 files changed, 16 insertions, 91 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4f08fd7..4c4f865 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,17 +1,17 @@ +;; -*- coding: utf-8; lexical-binding: t; -*- + ;; Make startup faster by reducing frequency of garbage collection. (setq gc-cons-percentage 0.6) (setq gc-cons-threshold most-positive-fixnum) ;; Make gc pauses faster by decreasing the threhold to 8 MiB (default is ;; 800kB) (add-hook 'emacs-startup-hook - (lambda () - (setq gc-cons-threshold (expt 2 23)))) + (lambda () (setq gc-cons-threshold (expt 2 23)))) + +(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) + +(defconst *is-a-mac* (eq system-type 'darwin)) -;; Set up package.el to work with MELPA -(require 'package) -(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/"))) -(package-initialize) (when (version<= "26.0.50" emacs-version) (global-display-line-numbers-mode)) (setq vc-follow-symlinks t) @@ -19,19 +19,9 @@ `(("." . ,(concat user-emacs-directory "backups")))) (setq-default fill-column 72) (menu-bar-mode -1) - -(setq recentf-max-saved-items 100) - -(dolist (package '(use-package)) - (unless (package-installed-p package) - (package-refresh-contents) - (package-install package))) -(require 'use-package) -(setq use-package-always-ensure t) - (xterm-mouse-mode 1) ;; Enable mouse -(add-to-list 'load-path "~/.dotfiles/.emacs.d/") -(add-to-list 'load-path "~/.dotfiles/.emacs.d/modes/") + +(require 'init-package) (use-package atom-one-dark-theme :config @@ -47,78 +37,13 @@ :config (global-undo-tree-mode)) -(require 'init-evil-mode) -(require 'init-org-mode) -(require 'init-lsp-mode) +(require 'init-evil) +(require 'init-org) (require 'init-mu4e) +(require 'init-lang) -(use-package ledger-mode - :mode (("\\.journal$" . ledger-mode)) - :config - (add-hook 'ledger-mode-hook - (setq-local tab-always-indent 'complete) - (setq-local completion-cycle-threshold t))) - -;; Company Mode -(use-package company - :init - (setq company-global-modes - '(emacs-lisp-mode go-mode ledger-mode)) - :hook ((after-init . global-company-mode))) - -;; Projectile -(use-package projectile - :init - (evil-define-key 'normal projectile-mode-map - (kbd "<leader>p") 'projectile-command-map) - :config - (setq projectile-cache-file (expand-file-name ".cache/projectile" user-emacs-directory)) - (projectile-mode 1)) - -(use-package counsel - :after evil - :init - (evil-define-key 'normal ivy-mode-map - (kbd "<leader>fb") 'ivy-switch-buffer - (kbd "<leader>fm") 'counsel-recentf) - :config - (ivy-mode 1) - (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) ") - (setq ivy-re-builders-alist - '((read-file-name-internal . ivy--regex-fuzzy) - (t . ivy--regex-plus)))) - -(use-package vterm - :commands (vterm) - :config - (setq vterm-kill-buffer-on-exit t)) - -(use-package markdown-mode - :ensure t - :commands (markdown-mode gfm-mode) - :mode (("README\\.md\\'" . gfm-mode) - ("\\.md\\'" . markdown-mode) - ("\\.markdown\\'" . markdown-mode)) - :init - (evil-define-key 'normal markdown-mode-map - (kbd "<RET>") 'markdown-follow-link-at-point) - (setq markdown-command "multimarkdown")) - -(use-package exec-path-from-shell - :if (memq window-system '(mac ns)) - :ensure t - :config - (exec-path-from-shell-initialize)) - -(use-package go-mode - :ensure t - :commands (go-mode) - :mode (("\\.go\\'" . go-mode)) - :hook ((go-mode . (lambda () (setq tab-width 4))))) - -(use-package avy) +(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +(when (file-exists-p custom-file) + (load custom-file)) -(use-package esup - :ensure t - :pin melpa) +(require 'init-local nil t) |