Initial commit.

This commit is contained in:
CAPELLE Mikaël 2020-01-13 15:14:54 +01:00
commit 96a9c67ada
155 changed files with 20314 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# Emacs file
*~
amx-items
custom-set-variables.el
.python-environments
auto-save-list
elpa
.last-package-update-day
projectile.cache
projectile-bookmarks.eld
eshell/
early-init-do-not-edit/
places
transient/
elpy/
recentf
.cache

36
.gitmodules vendored Normal file
View File

@ -0,0 +1,36 @@
[submodule "site-elisp\\color-rg"]
path = site-elisp\\color-rg
url = https://github.com/manateelazycat/color-rg.git
[submodule "site-elisp\\awesome-pair"]
path = site-elisp\\awesome-pair
url = https://github.com/manateelazycat/awesome-pair.git
[submodule "site-elisp\\header2"]
path = site-elisp\\header2
url = https://github.com/emacsmirror/header2.git
[submodule "site-elisp\\grep-dired"]
path = site-elisp\\grep-dired
url = https://github.com/manateelazycat/grep-dired.git
[submodule "site-elisp\\leetcode"]
path = site-elisp\\leetcode
url = https://github.com/kaiwk/leetcode.el.git
[submodule "site-elisp\\delete-block"]
path = site-elisp\\delete-block
url = https://github.com/manateelazycat/delete-block.git
[submodule "site-elisp\\instant-rename-tag"]
path = site-elisp\\instant-rename-tag
url = https://github.com/manateelazycat/instant-rename-tag.git
[submodule "site-elisp\\emacs-application-framework"]
path = site-elisp\\emacs-application-framework
url = https://github.com/manateelazycat/emacs-application-framework.git
[submodule "site-elisp\\snails"]
path = site-elisp\\snails
url = https://github.com/manateelazycat/snails.git
[submodule "site-elisp\\multi-term"]
path = site-elisp\\multi-term
url = https://github.com/manateelazycat/multi-term.git
[submodule "site-elisp\\epaint"]
path = site-elisp\\epaint
url = https://github.com/chuntaro/epaint.git
[submodule "site-elisp\\aweshell"]
path = site-elisp\\aweshell
url = https://github.com/MatthewZMD/aweshell.git

68
early-init.el Normal file
View File

@ -0,0 +1,68 @@
;;; early-init.el --- -*- lexical-binding: t -*-
;;
;; Filename: early-init.el
;; Description: Early initialization
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Sun Jun 9 17:58:05 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Tue Sep 17 01:13:45 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d init early-init
;; Compatibility: emacs-version >= 27
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; Emacs27 introduces early-init.el, which is run before init.el,
;; before package and UI initialization happens.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; DeferGC
(setq gc-cons-threshold 100000000)
;; -DeferGC
;; UnsetPES
(setq package-enable-at-startup nil)
;; -UnsetPES
;; UnsetFNHA
(defvar file-name-handler-alist-original file-name-handler-alist)
(setq file-name-handler-alist nil)
;; -UnsetFNHA
;; UnsetSRF
(setq site-run-file nil)
;; -UnsetSRF
;; DisableUnnecessaryInterface
(menu-bar-mode -1)
(unless (and (display-graphic-p) (eq system-type 'darwin))
(push '(menu-bar-lines . 0) default-frame-alist))
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
;; -DisableUnnecessaryInterface
(provide 'early-init)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; early-init.el ends here

47
elisp/init-ace-window.el Normal file
View File

@ -0,0 +1,47 @@
;;; init-ace-window.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-ace-window.el
;; Description: Initialize Ace-Window
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Tue Apr 23 10:00:42 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Thu Aug 8 16:02:47 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d ace-window
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes ace-window
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; AceWindowPac
(use-package ace-window
:bind ("C-x C-o" . ace-window))
;; -AceWindowPac
(provide 'init-ace-window)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-ace-window.el ends here

168
elisp/init-all-the-icons.el Normal file
View File

@ -0,0 +1,168 @@
;;; init-all-the-icons.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-all-the-icons.el
;; Description: Initialize All-The-Icons
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 17:06:08 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Tue Dec 24 11:47:45 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d all-the-icons
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes all-the-icons, all-the-icons-dired, all-the-icons-ivy
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-const))
(use-package all-the-icons
:if *sys/gui*
:config
(with-no-warnings
;; FIXME: Align the directory icons
;; @see https://github.com/domtronn/all-the-icons.el/pull/173
(defun all-the-icons-icon-for-dir (dir &optional chevron padding)
"Format an icon for DIR with CHEVRON similar to tree based directories."
(let* ((matcher (all-the-icons-match-to-alist (file-name-base (directory-file-name dir)) all-the-icons-dir-icon-alist))
(path (expand-file-name dir))
(chevron (if chevron (all-the-icons-octicon (format "chevron-%s" chevron) :height 0.8 :v-adjust -0.1) ""))
(padding (or padding "\t"))
(icon (cond
((file-symlink-p path)
(all-the-icons-octicon "file-symlink-directory" :height 1.0 :v-adjust 0.0))
((all-the-icons-dir-is-submodule path)
(all-the-icons-octicon "file-submodule" :height 1.0 :v-adjust 0.0))
((file-exists-p (format "%s/.git" path))
(format "%s" (all-the-icons-octicon "repo" :height 1.1 :v-adjust 0.0)))
(t (apply (car matcher) (list (cadr matcher) :v-adjust 0.0))))))
(format "%s%s%s%s%s" padding chevron padding icon padding)))
(defun all-the-icons-reset ()
"Reset (unmemoize/memoize) the icons."
(interactive)
(dolist (f '(all-the-icons-icon-for-file
all-the-icons-icon-for-mode
all-the-icons-icon-for-url
all-the-icons-icon-family-for-file
all-the-icons-icon-family-for-mode
all-the-icons-icon-family))
(ignore-errors
(memoize-restore f)
(memoize f)))
(message "Reset all-the-icons")))
(add-to-list 'all-the-icons-mode-icon-alist
'(bongo-playlist-mode all-the-icons-material "playlist_play" :height 1.2 :v-adjust -0.2 :face 'all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(bongo-library-mode all-the-icons-material "library_music" :height 1.1 :v-adjust -0.2 :face 'all-the-icons-dgreen))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-group-mode all-the-icons-fileicon "gnu" :face 'all-the-icons-silver))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-summary-mode all-the-icons-octicon "inbox" :height 1.0 :v-adjust 0.0 :face 'all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-article-mode all-the-icons-octicon "mail" :height 1.1 :v-adjust 0.0 :face 'all-the-icons-lblue))
(add-to-list 'all-the-icons-mode-icon-alist
'(message-mode all-the-icons-octicon "mail" :height 1.1 :v-adjust 0.0 :face 'all-the-icons-lblue))
(add-to-list 'all-the-icons-mode-icon-alist
'(diff-mode all-the-icons-octicon "git-compare" :v-adjust 0.0 :face all-the-icons-lred))
(add-to-list 'all-the-icons-mode-icon-alist
'(flycheck-error-list-mode all-the-icons-octicon "checklist" :height 1.1 :v-adjust 0.0 :face all-the-icons-lred))
(add-to-list 'all-the-icons-mode-icon-alist
'(elfeed-search-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(elfeed-show-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-lorange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-list-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-item-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-lorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.[bB][iI][nN]$" all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-icon-alist
'("\\.c?make$" all-the-icons-fileicon "gnu" :face all-the-icons-dorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.conf$" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-icon-alist
'("\\.toml$" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(conf-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(conf-space-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(forge-topic-mode all-the-icons-alltheicon "git" :face all-the-icons-blue))
(add-to-list 'all-the-icons-icon-alist
'("\\.xpm$" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-dgreen))
(add-to-list 'all-the-icons-mode-icon-alist
'(help-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1 :face all-the-icons-purple))
(add-to-list 'all-the-icons-mode-icon-alist
'(helpful-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1 :face all-the-icons-purple))
(add-to-list 'all-the-icons-mode-icon-alist
'(Info-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1))
(add-to-list 'all-the-icons-icon-alist
'("NEWS$" all-the-icons-faicon "newspaper-o" :height 0.9 :v-adjust -0.2))
(add-to-list 'all-the-icons-icon-alist
'("Cask\\'" all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.2 :face all-the-icons-blue))
(add-to-list 'all-the-icons-mode-icon-alist
'(cask-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.2 :face all-the-icons-blue))
(add-to-list 'all-the-icons-icon-alist
'(".*\\.ipynb\\'" all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebooklist-mode all-the-icons-faicon "book" :face all-the-icons-lorange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebook-mode all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebook-multilang-mode all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-dorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.epub\\'" all-the-icons-faicon "book" :height 1.0 :v-adjust -0.1 :face all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(nov-mode all-the-icons-faicon "book" :height 1.0 :v-adjust -0.1 :face all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(gfm-mode all-the-icons-octicon "markdown" :face all-the-icons-lblue)))
;; ATIDiredPac
(use-package all-the-icons-dired
:after all-the-icons
:if *sys/gui*
:diminish
:custom-face
(all-the-icons-dired-dir-face ((t `(:foreground ,(face-background 'default)))))
:hook (dired-mode . all-the-icons-dired-mode)
:config
;; Workaround for all-the-icons bug until PR merged https://github.com/domtronn/all-the-icons.el/pull/150
(when (require 'all-the-icons nil 'noerror)
(setq all-the-icons-mode-icon-alist
(delete '(erc-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0 :face all-the-icons-white) all-the-icons-mode-icon-alist))
(add-to-list 'all-the-icons-mode-icon-alist '(erc-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0))))
;; -ATIDiredPac
(provide 'init-all-the-icons)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-all-the-icons.el ends here

58
elisp/init-avy.el Normal file
View File

@ -0,0 +1,58 @@
;;; init-avy.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-avy.el
;; Description: Initialize Avy
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 11:12:49 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Thu Nov 7 05:55:40 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d avy
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes avy
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-global-config))
;; AvyPac
(use-package avy
:defer t
:bind
(("C-z c" . avy-goto-char-timer)
("C-z l" . avy-goto-line))
:custom
(avy-timeout-seconds 0.3)
(avy-style 'pre)
:custom-face
(avy-lead-face ((t (:background "#51afef" :foreground "#870000" :weight bold)))));
;; -AvyPac
(provide 'init-avy)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-avy.el ends here

82
elisp/init-cc.el Normal file
View File

@ -0,0 +1,82 @@
;;; init-cc.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-cc.el
;; Description: Initialize C family languages
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Fri Mar 15 10:58:29 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Thu Dec 26 02:07:34 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d c c++ go ccls
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initialize ccls modern-cpp-font-lock go-mode
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-const))
;; CCLSPac
(use-package ccls
:defer t
:if (not *sys/win32*)
:hook ((c-mode c++-mode objc-mode) .
(lambda () (require 'ccls) (lsp)))
:custom
(ccls-executable (executable-find "ccls")) ; Add ccls to path if you haven't done so
(ccls-sem-highlight-method 'font-lock)
(ccls-enable-skipped-ranges nil)
:config
(lsp-register-client
(make-lsp-client
:new-connection (lsp-tramp-connection (cons ccls-executable ccls-args))
:major-modes '(c-mode c++-mode cuda-mode objc-mode)
:server-id 'ccls-remote
:multi-root nil
:remote? t
:notification-handlers
(lsp-ht ("$ccls/publishSkippedRanges" #'ccls--publish-skipped-ranges)
("$ccls/publishSemanticHighlight" #'ccls--publish-semantic-highlight))
:initialization-options (lambda () ccls-initialization-options)
:library-folders-fn nil)))
;; -CCLSPac
;; CPPFontLockPac
(use-package modern-cpp-font-lock
:diminish t
:init (modern-c++-font-lock-global-mode t))
;; -CPPFontLockPac
;; GoPac
(use-package go-mode
:mode "\\.go\\'"
:hook (before-save . gofmt-before-save))
;; -GoPac
(provide 'init-cc)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-cc.el ends here

49
elisp/init-comment.el Normal file
View File

@ -0,0 +1,49 @@
;;; init-comment.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-comment.el
;; Description: Initialize Evil-Nerd-Commenter
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Fri Apr 5 00:21:58 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Wed Oct 16 16:44:25 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d evil-nerd-commenter
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes evil-nerd-commenter
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; EvilNerdCommenPac
(use-package evil-nerd-commenter
:bind
(("C-c M-;" . c-toggle-comment-style)
("M-;" . evilnc-comment-or-uncomment-lines)))
;; -EvilNerdCommenPac
(provide 'init-comment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-comment.el ends here

224
elisp/init-company.el Normal file
View File

@ -0,0 +1,224 @@
;;; init-company.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-company.el
;; Description: Initialize Company
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Fri Mar 15 10:02:00 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Fri Dec 27 22:11:06 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d company company-tabnine
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes company
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-const))
;; ComPac
(use-package company
:diminish company-mode
:hook ((prog-mode LaTeX-mode latex-mode ess-r-mode) . company-mode)
:bind
(:map company-active-map
([tab] . smarter-yas-expand-next-field-complete)
("TAB" . smarter-yas-expand-next-field-complete))
("M-/" . company-complete)
:custom
(company-minimum-prefix-length 1)
(company-tooltip-align-annotations t)
(company-begin-commands '(self-insert-command))
(company-require-match 'never)
;; Don't use company in the following modes
(company-global-modes '(not shell-mode eaf-mode))
;; Trigger completion immediately.
(company-idle-delay 0.1)
;; Number the candidates (use M-1, M-2 etc to select completions).
(company-show-numbers t)
:config
(unless *clangd* (delete 'company-clang company-backends))
(global-company-mode 1)
(defun smarter-yas-expand-next-field-complete ()
"Try to `yas-expand' and `yas-next-field' at current cursor position.
If failed try to complete the common part with `company-complete-common'"
(interactive)
(if yas-minor-mode
(let ((old-point (point))
(old-tick (buffer-chars-modified-tick)))
(yas-expand)
(when (and (eq old-point (point))
(eq old-tick (buffer-chars-modified-tick)))
(ignore-errors (yas-next-field))
(when (and (eq old-point (point))
(eq old-tick (buffer-chars-modified-tick)))
(company-complete-common))))
(company-complete-common))))
;; -ComPac
;; CompanyLSPPac
;; (use-package company-lsp
;; :defer t
;; :custom (company-lsp-cache-candidates 'auto))
;; ;; -CompanyLSPPac
;; CompanyTabNinePac
;; (use-package company-tabnine
;; :defer 1
;; :custom
;; (company-tabnine-max-num-results 9)
;; :bind
;; (("M-q" . company-other-backend)
;; ("C-z t" . company-tabnine))
;; :hook
;; (lsp-after-open . (lambda ()
;; (setq company-tabnine-max-num-results 3)
;; (add-to-list 'company-transformers 'company//sort-by-tabnine t)
;; (add-to-list 'company-backends '(company-lsp :with company-tabnine :separate))))
;; (kill-emacs . company-tabnine-kill-process)
;; :config
;; ;; Enable TabNine on default
;; (add-to-list 'company-backends #'company-tabnine)
;; ;; Integrate company-tabnine with lsp-mode
;; (defun company//sort-by-tabnine (candidates)
;; (if (or (functionp company-backend)
;; (not (and (listp company-backend) (memq 'company-tabnine company-backend))))
;; candidates
;; (let ((candidates-table (make-hash-table :test #'equal))
;; candidates-lsp
;; candidates-tabnine)
;; (dolist (candidate candidates)
;; (if (eq (get-text-property 0 'company-backend candidate)
;; 'company-tabnine)
;; (unless (gethash candidate candidates-table)
;; (push candidate candidates-tabnine))
;; (push candidate candidates-lsp)
;; (puthash candidate t candidates-table)))
;; (setq candidates-lsp (nreverse candidates-lsp))
;; (setq candidates-tabnine (nreverse candidates-tabnine))
;; (nconc (seq-take candidates-tabnine 3)
;; (seq-take candidates-lsp 6))))))
;; ;; -CompanyTabNinePac
;; CompanyBoxPac
(use-package company-box
:diminish
:functions (my-company-box--make-line
my-company-box-icons--elisp)
:commands (company-box--get-color
company-box--resolve-colors
company-box--add-icon
company-box--apply-color
company-box--make-line
company-box-icons--elisp)
:hook (company-mode . company-box-mode)
:custom
(company-box-backends-colors nil)
(company-box-show-single-candidate t)
(company-box-max-candidates 50)
(company-box-doc-delay 0.3)
:config
;; Support `company-common'
(defun my-company-box--make-line (candidate)
(-let* (((candidate annotation len-c len-a backend) candidate)
(color (company-box--get-color backend))
((c-color a-color i-color s-color) (company-box--resolve-colors color))
(icon-string (and company-box--with-icons-p (company-box--add-icon candidate)))
(candidate-string (concat (propertize (or company-common "") 'face 'company-tooltip-common)
(substring (propertize candidate 'face 'company-box-candidate) (length company-common) nil)))
(align-string (when annotation
(concat " " (and company-tooltip-align-annotations
(propertize " " 'display `(space :align-to (- right-fringe ,(or len-a 0) 1)))))))
(space company-box--space)
(icon-p company-box-enable-icon)
(annotation-string (and annotation (propertize annotation 'face 'company-box-annotation)))
(line (concat (unless (or (and (= space 2) icon-p) (= space 0))
(propertize " " 'display `(space :width ,(if (or (= space 1) (not icon-p)) 1 0.75))))
(company-box--apply-color icon-string i-color)
(company-box--apply-color candidate-string c-color)
align-string
(company-box--apply-color annotation-string a-color)))
(len (length line)))
(add-text-properties 0 len (list 'company-box--len (+ len-c len-a)
'company-box--color s-color)
line)
line))
(advice-add #'company-box--make-line :override #'my-company-box--make-line)
;; Prettify icons
(defun my-company-box-icons--elisp (candidate)
(when (derived-mode-p 'emacs-lisp-mode)
(let ((sym (intern candidate)))
(cond ((fboundp sym) 'Function)
((featurep sym) 'Module)
((facep sym) 'Color)
((boundp sym) 'Variable)
((symbolp sym) 'Text)
(t . nil)))))
(advice-add #'company-box-icons--elisp :override #'my-company-box-icons--elisp)
(when (and *sys/gui*
(require 'all-the-icons nil t))
(declare-function all-the-icons-faicon 'all-the-icons)
(declare-function all-the-icons-material 'all-the-icons)
(declare-function all-the-icons-octicon 'all-the-icons)
(setq company-box-icons-all-the-icons
`((Unknown . ,(all-the-icons-material "find_in_page" :height 0.85 :v-adjust -0.2))
(Text . ,(all-the-icons-faicon "text-width" :height 0.8 :v-adjust -0.05))
(Method . ,(all-the-icons-faicon "cube" :height 0.8 :v-adjust -0.05 :face 'all-the-icons-purple))
(Function . ,(all-the-icons-faicon "cube" :height 0.8 :v-adjust -0.05 :face 'all-the-icons-purple))
(Constructor . ,(all-the-icons-faicon "cube" :height 0.8 :v-adjust -0.05 :face 'all-the-icons-purple))
(Field . ,(all-the-icons-octicon "tag" :height 0.8 :v-adjust 0 :face 'all-the-icons-lblue))
(Variable . ,(all-the-icons-octicon "tag" :height 0.8 :v-adjust 0 :face 'all-the-icons-lblue))
(Class . ,(all-the-icons-material "settings_input_component" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-orange))
(Interface . ,(all-the-icons-material "share" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-lblue))
(Module . ,(all-the-icons-material "view_module" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-lblue))
(Property . ,(all-the-icons-faicon "wrench" :height 0.8 :v-adjust -0.05))
(Unit . ,(all-the-icons-material "settings_system_daydream" :height 0.85 :v-adjust -0.2))
(Value . ,(all-the-icons-material "format_align_right" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-lblue))
(Enum . ,(all-the-icons-material "storage" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-orange))
(Keyword . ,(all-the-icons-material "filter_center_focus" :height 0.85 :v-adjust -0.2))
(Snippet . ,(all-the-icons-material "format_align_center" :height 0.85 :v-adjust -0.2))
(Color . ,(all-the-icons-material "palette" :height 0.85 :v-adjust -0.2))
(File . ,(all-the-icons-faicon "file-o" :height 0.85 :v-adjust -0.05))
(Reference . ,(all-the-icons-material "collections_bookmark" :height 0.85 :v-adjust -0.2))
(Folder . ,(all-the-icons-faicon "folder-open" :height 0.85 :v-adjust -0.05))
(EnumMember . ,(all-the-icons-material "format_align_right" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-lblue))
(Constant . ,(all-the-icons-faicon "square-o" :height 0.85 :v-adjust -0.05))
(Struct . ,(all-the-icons-material "settings_input_component" :height 0.85 :v-adjust -0.2 :face 'all-the-icons-orange))
(Event . ,(all-the-icons-faicon "bolt" :height 0.8 :v-adjust -0.05 :face 'all-the-icons-orange))
(Operator . ,(all-the-icons-material "control_point" :height 0.85 :v-adjust -0.2))
(TypeParameter . ,(all-the-icons-faicon "arrows" :height 0.8 :v-adjust -0.05))
(Template . ,(all-the-icons-material "format_align_center" :height 0.85 :v-adjust -0.2)))
company-box-icons-alist 'company-box-icons-all-the-icons)))
;; -CompanyBoxPac
(provide 'init-company)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-company.el ends here

112
elisp/init-const.el Normal file
View File

@ -0,0 +1,112 @@
;;; init-const.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-const.el
;; Description: Initialize Constants
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Mon Mar 18 14:20:54 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Mon Dec 9 20:49:39 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d constants
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes constants
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; UserInfo
(setq user-full-name "Mikaël Capelle")
(setq user-mail-address "capelle.mikael@gmail.com")
;; -UserInfo
;; Consts
(defconst *sys/gui*
(display-graphic-p)
"Are we running on a GUI Emacs?")
(defconst *sys/win32*
(eq system-type 'windows-nt)
"Are we running on a WinTel system?")
(defconst *sys/linux*
(eq system-type 'gnu/linux)
"Are we running on a GNU/Linux system?")
(defconst *sys/mac*
(eq system-type 'darwin)
"Are we running on a Mac system?")
(defconst *sys/root*
(string-equal "root" (getenv "USER"))
"Are you a ROOT user?")
(defconst *rg*
(executable-find "rg")
"Do we have ripgrep?")
(defconst *python*
(executable-find "python")
"Do we have python?")
(defconst *python3*
(executable-find "python3")
"Do we have python3?")
(defconst *tr*
(executable-find "tr")
"Do we have tr?")
(defconst *mvn*
(executable-find "mvn")
"Do we have Maven?")
(defconst *clangd*
(or (executable-find "clangd") ;; usually
(executable-find "/usr/local/opt/llvm/bin/clangd")) ;; macOS
"Do we have clangd?")
(defconst *gcc*
(executable-find "gcc")
"Do we have gcc?")
(defconst *git*
(executable-find "git")
"Do we have git?")
(defconst *pdflatex*
(executable-find "pdflatex")
"Do we have pdflatex?")
(defconst *eaf-env*
(and *sys/linux* *sys/gui* *python3*
(executable-find "pip")
(not (equal (shell-command-to-string "pip freeze | grep '^PyQt\\|PyQtWebEngine'") "")))
"Check basic requirements for EAF to run.")
;; -Consts
(provide 'init-const)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-const.el ends here

56
elisp/init-crux.el Normal file
View File

@ -0,0 +1,56 @@
;;; init-crux.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-crux.el
;; Description: Initialize Crux
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Tue Dec 24 13:15:38 2019 (-0500)
;; Version: 2.0.0
;; Last-Updated: Thu Dec 26 22:02:32 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d crux
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes Crux
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; CruxPac
(use-package crux
:bind
(("C-a" . crux-move-beginning-of-line)
("C-x 4 t" . crux-transpose-windows)
("C-x K" . crux-kill-other-buffers)
("C-k" . crux-smart-kill-line))
:config
(crux-with-region-or-buffer indent-region)
(crux-with-region-or-buffer untabify)
(crux-with-region-or-point-to-eol kill-ring-save)
(defalias 'rename-file-and-buffer #'crux-rename-file-and-buffer))
;; -CruxPac
(provide 'init-crux)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-crux.el ends here

91
elisp/init-dashboard.el Normal file
View File

@ -0,0 +1,91 @@
;;; init-dashboard.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-dashboard.el
;; Description: Initialize Dashboard
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 17:21:46 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Mon Dec 23 18:19:44 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d dashboard
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes dashboard
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; DashboardPac
(use-package dashboard
:demand
:diminish (dashboard-mode page-break-lines-mode)
:bind ("C-z d" . open-dashboard)
:custom
(dashboard-banner-logo-title "Close the world. Open the nExt.")
(dashboard-startup-banner
(expand-file-name "images/KEC_Dark_BK_Small.png" user-emacs-directory))
(dashboard-items '((recents . 7)
(bookmarks . 7)
(agenda . 5)))
(dashboard-set-heading-icons t)
(dashboard-set-navigator t)
(initial-buffer-choice (lambda () (get-buffer dashboard-buffer-name)))
(dashboard-navigator-buttons
(if (featurep 'all-the-icons)
`(((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust -0.05)
"M-EMACS" "Browse M-EMACS Homepage"
(lambda (&rest _) (browse-url "https://github.com/MatthewZMD/.emacs.d")))
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1)
"Configuration" "" (lambda (&rest _) (edit-configs)))))
`((("" "M-EMACS" "Browse M-EMACS Homepage"
(lambda (&rest _) (browse-url "https://github.com/MatthewZMD/.emacs.d")))
("" "Configuration" "" (lambda (&rest _) (edit-configs)))))))
:custom-face
(dashboard-banner-logo-title ((t (:family "Love LetterTW" :height 123))))
:config
(dashboard-modify-heading-icons '((recents . "file-text")
(bookmarks . "book")))
(dashboard-setup-startup-hook)
;; Open Dashboard function
(defun open-dashboard ()
"Open the *dashboard* buffer and jump to the first widget."
(interactive)
(if (get-buffer dashboard-buffer-name)
(kill-buffer dashboard-buffer-name))
(dashboard-insert-startupify-lists)
(switch-to-buffer dashboard-buffer-name)
(goto-char (point-min))
(delete-other-windows)))
;; -DashboardPac
;; PBLPac
(use-package page-break-lines
:diminish
:init (global-page-break-lines-mode))
;; -PBLPac
(provide 'init-dashboard)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-dashboard.el ends here

102
elisp/init-dired.el Normal file
View File

@ -0,0 +1,102 @@
;;; init-dired.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-dired.el
;; Description: Initialize Dired and Related Configurations
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 11:37:00 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Wed Dec 25 02:33:09 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d dired auto-save
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes dired, super-save, disk-usage
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; DiredPackage
(use-package dired
:ensure nil
:bind
(("C-x C-j" . dired-jump)
("C-x j" . dired-jump-other-window))
:custom
;; Always delete and copy recursively
(dired-recursive-deletes 'always)
(dired-recursive-copies 'always)
;; Auto refresh Dired, but be quiet about it
(global-auto-revert-non-file-buffers t)
(auto-revert-verbose nil)
;; Quickly copy/move file in Dired
(dired-dwim-target t)
;; Move files to trash when deleting
(delete-by-moving-to-trash t)
;; Load the newest version of a file
(load-prefer-newer t)
;; Detect external file changes and auto refresh file
(auto-revert-use-notify nil)
(auto-revert-interval 3) ; Auto revert every 3 sec
:config
;; Enable global auto-revert
(global-auto-revert-mode t)
;; Reuse same dired buffer, to prevent numerous buffers while navigating in dired
(put 'dired-find-alternate-file 'disabled nil)
:hook
(dired-mode . (lambda ()
(local-set-key (kbd "<mouse-2>") #'dired-find-alternate-file)
(local-set-key (kbd "RET") #'dired-find-alternate-file)
(local-set-key (kbd "^")
(lambda () (interactive) (find-alternate-file ".."))))))
;; -DiredPackage
;; DiskUsage
(use-package disk-usage
:commands (disk-usage))
;; -DiskUsage
;; SuperSave
(use-package super-save
:diminish
:custom
(super-save-auto-save-when-idle t)
(auto-save-default nil)
(make-backup-files nil)
:config
(super-save-mode 1))
;; -SuperSave
;; SaveAllBuffers
(defun save-all-buffers ()
"Instead of `save-buffer', save all opened buffers by calling `save-some-buffers' with ARG t."
(interactive)
(save-some-buffers t))
(global-set-key (kbd "C-x C-s") nil)
(global-set-key (kbd "C-x C-s") #'save-all-buffers)
;; -SaveAllBuffers
(provide 'init-dired)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-dired.el ends here

View File

@ -0,0 +1,47 @@
;;; init-discover-my-major.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-discover-my-major.el
;; Description: Initialize Discover-My-Major
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 15:38:29 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Thu Aug 8 16:05:23 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d discover-my-major
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes discover-my-major
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; DiscMyMajor
(use-package discover-my-major
:bind ("C-h C-m" . discover-my-major))
;; -DiscMyMajor
(provide 'init-discover-my-major)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-discover-my-major.el ends here

52
elisp/init-dumb-jump.el Normal file
View File

@ -0,0 +1,52 @@
;;; init-dumb-jump.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-dumb-jump.el
;; Description: Initialize Dumb Jump
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Fri Mar 15 10:11:21 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Sat Aug 24 22:07:00 2019 (+0000)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes dumb-jump
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; DumbJump
(use-package dumb-jump
:bind
(:map prog-mode-map
(("C-c C-o" . dumb-jump-go-other-window)
("C-c C-j" . dumb-jump-go)
("C-c C-i" . dumb-jump-go-prompt)))
:custom (dumb-jump-selector 'ivy))
;; -DumbJump
(provide 'init-dumb-jump)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-dumb-jump.el ends here

67
elisp/init-eaf.el Normal file
View File

@ -0,0 +1,67 @@
;;; init-eaf.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-eaf.el
;; Description: Initialize Emacs Application Framework
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Tue Jun 4 00:26:09 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Fri Dec 27 22:07:41 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d pdf-tools
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes Emacs Application Framework
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-const))
;; EAFPac
(use-package eaf
:load-path (lambda () (expand-file-name "site-elisp/emacs-application-framework" user-emacs-directory))
:if *eaf-env*
:custom
(eaf-find-alternate-file-in-dired t)
(browse-url-browser-function 'eaf-open-browser) ;; Make EAF Browser my default browser
:config
(defalias 'browse-web #'eaf-open-browser)
;; I already bind "RET", "<mouse-2>", "^" to `dired-find-alternate-file' in `init-dired.el'.
;; Comment this line out of you don't want to use EAF to open available files in dired.
;; (global-set-key [remap dired-find-alternate-file] #'eaf-file-open-in-dired)
(eaf-bind-key scroll_up "RET" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_down_page "DEL" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_down_page "u" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_up_page "d" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_to_end "M->" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_to_home "M-<" eaf-pdf-viewer-keybinding)
(eaf-bind-key quit-window "q" eaf-pdf-viewer-keybinding)
(eaf-bind-key take_photo "p" eaf-camera-keybinding))
;; -EAFPac
(provide 'init-eaf)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-eaf.el ends here

73
elisp/init-edit.el Normal file
View File

@ -0,0 +1,73 @@
;;; init-edit.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-edit.el
;; Description: Initialize Editing Configuration
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 28 13:25:24 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Tue Dec 24 11:50:24 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d iedit
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes iedit, awesome-pair, delete-block
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-global-config))
;; IEditPac
(use-package iedit
:bind ("C-z ," . iedit-mode)
:diminish)
;; -IEditPac
;; AwesomePairPac
(use-package awesome-pair
:load-path (lambda () (expand-file-name "site-elisp/awesome-pair" user-emacs-directory))
:bind
(:map prog-mode-map
(("M-D" . awesome-pair-kill)
("SPC" . awesome-pair-space)
("=" . awesome-pair-equal)
("M-F" . awesome-pair-jump-right)
("M-B" . awesome-pair-jump-left)))
:hook (prog-mode . awesome-pair-mode))
;; -AwesomePairPac
;; DeleteBlockPac
(use-package delete-block
:load-path (lambda () (expand-file-name "site-elisp/delete-block" user-emacs-directory))
:bind
(("M-d" . delete-block-forward)
("C-<backspace>" . delete-block-backward)
("M-<backspace>" . delete-block-backward)
("M-DEL" . delete-block-backward)))
;; -DeleteBlockPac
(provide 'init-edit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-edit.el ends here

48
elisp/init-ein.el Normal file
View File

@ -0,0 +1,48 @@
;;; init-ein.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-ein.el
;; Description: Initialize Emacs IPython Notebook Client
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 21 14:04:50 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Thu Aug 8 16:05:40 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d ein jupyter
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes Jupyter (formerly IPython) client for Emacs
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; EINPac
(use-package ein
:disabled
:defer t)
;; -EINPac
(provide 'init-ein)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-ein.el ends here

58
elisp/init-epaint.el Normal file
View File

@ -0,0 +1,58 @@
;;; init-epaint.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-epaint.el
;; Description: Initialize epaint
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Mon Sep 16 15:47:34 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Mon Sep 16 16:17:43 2019 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d epaint
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes epaint
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-const))
;; EPaintPac
(use-package epaint
:if *sys/gui*
:load-path (lambda () (expand-file-name "site-elisp/epaint" user-emacs-directory))
:commands (epaint)
:init
(with-eval-after-load (quote epaint-context)
(unless (boundp (quote cl-struct-epaint-drawable))
(defvar cl-struct-epaint-drawable (quote epaint-drawable)))
(unless (boundp (quote cl-struct-epaint-gc))
(defvar cl-struct-epaint-gc (quote epaint-gc)))))
;; -EPaintPac
(provide 'init-epaint)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-epaint.el ends here

140
elisp/init-erc.el Normal file
View File

@ -0,0 +1,140 @@
;;; init-erc.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-erc.el
;; Description: Initialize ERC
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Tue Jul 30 22:15:50 2019 (-0400)
;; Version: 2.0.0
;; Last-Updated: Wed Dec 4 01:57:57 2019 (-0500)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d erc irc
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes erc
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile
(require 'init-global-config)
(require 'init-func))
;; ERCPac
(use-package erc
:ensure nil
:init
(use-package erc-hl-nicks :defer t)
(use-package erc-image :defer t)
:custom-face
(erc-notice-face ((t (:foreground "#ababab"))))
:custom
(erc-autojoin-channels-alist '(("freenode.net" "#emacs")))
(erc-track-exclude-types '("NICK" "PART" "MODE" "324" "329" "332" "333" "353" "477"))
(erc-hide-list '("JOIN" "PART" "QUIT"))
(erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
(erc-server-coding-system '(utf-8 . utf-8))
(erc-interpret-mirc-color t)
(erc-kill-buffer-on-part t)
(erc-kill-queries-on-quit t)
(erc-kill-server-buffer-on-quit t)
(erc-autojoin-timing 'ident)