本配置由我从零开始配置,所以对每个地方都很了解,如果对哪里不懂的可以发邮件给我提问. 具体配置请看/etc下的配置文件 EvanMeek’s Email 预览
(setq-default cursor-type 'bar)
(set-fontset-font t ?中 (font-spec :face "WenQuanYi Micro Hei" :size 22))
;; 去除默认启动界面
(setq inhibit-startup-message t)
(fset 'yes-or-no-p 'y-or-n-p)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(set-frame-font "Sarasa Mono SC 16")
;; (global-set-key (kbd "<f5>") 'revert-buffer)
;; 让ido-mode的匹配更加丝滑
;; (setq indo-enable-flex-matching t)
;; ido-mode可在任何地方运行
;; (setq ido-everywhere t)
;; 开启ido-mode
;; (ido-mode 1)
;; 交互式选择buffer
;; (defalias 'list-buffers 'ibuffer)
;; 这个模块可以撤销或者撤回上一次窗口的操作
;; (winner-mode 1)
;; emacs的主题
;; (use-package solarized-theme
;; :ensure t
;; :config
;; (load-theme 'solarized-dark t))
;; (add-to-list 'custom-theme-load-path "/home/evanmeek/.emacs.d/themes/")
;; (load-theme 'oswald)
;; (use-package lazycat-theme
;; :load-path "/home/evanmeek/.emacs.d/site-lisp/lazycat-theme"
;; :config
;; (lazycat-theme-load)
;; (lazycat-theme-load-with-sunrise))
;; (load-theme 'oswald t)
(load-theme 'wombat t)
(set-cursor-color "green2")
;;取消GUI功能
(setq use-file-dialog nil
use-dialog-box nil
inhibit-startup-screen t
inhibit-startup-message t)
;; 关闭备份
(setq make-backup-files nil
auto-save-default nil)
;; 关闭锁文件
(setq create-lockfiles nil)
;; 总是加载最新的文件
(setq load-prefer-newer t)
;; 关闭字体缓存gc
(setq inhibit-compacting-font-caches nil)
;; 关闭烦人的提示
(setq ring-bell-function 'ignore
blink-cursor-mode nil)
;; 任何地方都使用UTF-8
(set-charset-priority 'unicode)
(setq locale-coding-system 'utf-8) ; pretty
(set-terminal-coding-system 'utf-8) ; pretty
(set-keyboard-coding-system 'utf-8) ; pretty
(set-selection-coding-system 'utf-8) ; please
(prefer-coding-system 'utf-8) ; with sugar on top
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
;; 更友好和平滑的滚动
;; (setq scroll-step 2
;; scroll-margin 2
;; hscroll-step 2
;; hscroll-margin 2
;; scroll-conservatively 101
;; scroll-up-aggressively 0.01
;; scroll-down-aggressively 0.01
;; scroll-preserve-screen-position 'always)
;; 关闭自动调节行高
(setq auto-window-vscroll nil)
;; 创建新行的动作
(global-set-key (kbd "RET") 'newline-and-indent)
(global-set-key (kbd "S-<return>") 'comment-indent-new-line)
;; 让光标无法离开视线
(setq mouse-yank-at-point nil)
;; 行宽
(setq-default fill-column 80)
;; 让'_'被视为单词的一部分
(add-hook 'after-change-major-mode-hook
(lambda ()
(modify-syntax-entry ?_ "w")))
;; "-" 同上)
(add-hook 'after-change-major-mode-hook
(lambda ()
(modify-syntax-entry ?- "w")))
;; 没有制表符
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;; 设置gc大小
(setq gc-cons-threshold 100000000)
;; 读取进程数据量
(setq read-process-output-max(* 1024 1024)); ; 1mb
;; (global-set-key (kbd "<f9>") 'whitespace-mode)
;; (define-key key-translation-map (kbd ",") nil)
;; (progn
;; ;;define set of key sequences
;;
;; (define-key my-leader-key-map (kbd "RET") 'execute-extended-command)
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") ')
;; (defind-key my-leader-key-map (kbd "") '))
;; (define-key my-leader-key-map (kbd "w d") 'delete-window)
(define-prefix-command 'leader-key)
(which-key-add-key-based-replacements
"M-SPC b" "音乐"
"M-SPC o" "开启"
"M-SPC t" "切换")
(global-set-key (kbd "M-SPC") 'leader-key)
(global-set-key (kbd "C-(") 'backward-sexp)
(global-set-key (kbd "C-)") 'forward-sexp)
;; (use-package paren
;; :ensure nil
;; :hook (after-init . show-paren-mode)
;; :custom
;; (show-paren-when-point-inside-paren t)
;; (show-paren-when-point-in-periphery t))
;; ;; The selected region of text can be deleted
;; (use-package delsel
;; :ensure nil
;; :hook (after-init . delete-selection-mode))
;; ;; Show line/column number
;; (use-package simple
;; :ensure nil
;; :custom
;; ;; save current clipboard text
;; (save-interprogram-paste-before-kill t)
;; ;; eliminate duplicates
;; (kill-do-not-save-duplicates t)
;; :hook (after-init . (lambda ()
;; (line-number-mode)
;; (column-number-mode)
;; (size-indication-mode))))
;; ;; Back to the previous position
;; ;; (use-package saveplace
;; ;; :ensure nil
;; ;; :hook (after-init . save-place-mode))
;; ;; Update buffer whenever file changes
;; (use-package autorevert
;; :ensure nil
;; :hook (after-init . global-auto-revert-mode))
;; ;; Workaround with minified source files
;; (use-package so-long
;; :ensure nil
;; :when (>= emacs-major-version 27)
;; :hook (after-init . global-so-long-mode))
;; ;; Make escape more nature
;; (use-package minibuffer
;; :ensure nil
;; :bind ([escape] . abort-recursive-edit))
;; ;; What day is it today?
;; (use-package calendar
;; :ensure nil
;; :hook (calendar-today-visible . calendar-mark-today)
;; :custom
;; (calendar-mark-diary-entries-flag t)
;; ;; start from Monday
;; (calendar-week-start-day 1)
;; ;; year/month/day
;; (calendar-date-string 'iso))
;; ;; lifelog
;; (use-package diary-lib
;; :ensure nil
;; :custom
;; (diary-number-of-entries 7)
;; (diary-comment-start "#"))
;; ;; View help page when we open
;; (use-package help
;; :ensure nil
;; :custom
;; (help-window-select t))
;; ;; Dynamic abbrev
;; ;; Stolen from https://protesilaos.com/dotemacs/
;; (use-package dabbrev
;; :ensure nil
;; :commands (dabbrev-expand dabbrev-completion)
;; :custom
;; (dabbrev-abbrev-char-regexp "\\sw\\|\\s_")
;; (dabbrev-abbrev-skip-leading-regexp "\\$\\|\\*\\|/\\|=")
;; (dabbrev-backward-only nil)
;; (dabbrev-case-distinction nil)
;; (dabbrev-case-fold-search t)
;; (dabbrev-case-replace nil)
;; (dabbrev-check-other-buffers t)
;; (dabbrev-eliminate-newlines nil)
;; (dabbrev-upcase-means-case-search t))
;; ;; Better abbrev expansion
;; (use-package hippie-exp
;; :ensure nil
;; :after dabbrev
;; :custom
;; (hippie-expand-try-functions-list
;; '(try-expand-dabbrev
;; try-expand-dabbrev-visible
;; try-expand-dabbrev-all-buffers
;; try-expand-dabbrev-from-kill
;; try-expand-list-all-buffers
;; try-expand-list
;; try-expand-line-all-buffers
;; try-expand-line
;; try-complete-file-name-partially
;; try-complete-file-name
;; try-expand-all-abbrevs))
;; :bind ("M-/" . hippie-expand))
;; ;; Make align be a simple thing
;; (use-package align
;; :ensure nil
;; :bind (("C-c [" . align-regexp)
;; ("C-c ]" . align-regexp)))
;; Needed by `webpaste'
(use-package browse-url
:ensure nil
:custom
(browse-url-generic-program "google-chrome"))
(use-package emojify
:hook 'after-init-hook #'global-emojify-mode)
(use-package all-the-icons
:ensure t)
为dired添加图标支持
(use-package all-the-icons-dired
:load-path "/home/evanmeek/.emacs.d/site-lisp/all-the-icons-dired/"
:after (dired all-the-icons)
:hook
('dired-mode-hook #'all-the-icons-dired-mode))
(use-package page-break-lines
:ensure nil
:config
(turn-on-page-break-lines-mode))
(use-package
dashboard
:ensure t
:config (dashboard-setup-startup-hook)
(dashboard-modify-heading-icons '((recents . "file-text")
(bookmarks . "book")))
;; 设置标题
(setq dashboard-banner-logo-title "Life is fantastic!")
;; 设置banner
;; (setq dashboard-startup-banner "/home/evanmeek/.emacs.d/var/banner/logo.png")
(setq dashboard-center-content t)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-set-navigator t)
(setq dashboard-footer-messages '("为了想要的一切而努力!")))
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1)
:config
(setq doom-modeline-height 40))
;;;###autoload
(defun +evan/toggle-transparency ()
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(80 . 80) '(100 . 100)))))
(define-key leader-key (kbd "t t") #'+evan/toggle-transparency)
一款能将大部分内容以浮空的形式显示的插件
;; 浮动窗口
(use-package posframe
:ensure t)
为已有键绑定做很好的提示
;; 使用which-key来查看按键的作用
(use-package which-key
:ensure t
:custom
(which-key-popup-type 'side-window)
;; config 可以对此插件单独配置,这样写有助于管理各个插件的单独配置
:config
(which-key-mode))
一款非常好用的管理窗格的插件
;; 更好的窗口切换工具
(use-package ace-window
:ensure t
:init
(progn
(global-set-key [remap other-window] 'ace-window)
(custom-set-faces
'(aw-leading-char-face
((t (:inherit ace-jump-face-foreground :height 3.0 :foreground "red")))))))
swiper是一个很好用的增强工具,它增强了搜索的功能,以及提供了很多基础函数更好的实现方式。
;; 一个很好用的搜索以及很多基础函数的更好实现的插件
(use-package swiper
:defer 2
:bind
(("C-s" . swiper)
("C-r" . swiper)
("C-c C-r" . ivy-resume)
("M-x" . counsel-M-x)
("C-x C-f" . counsel-find-file))
:config
(progn
(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(setq ivy-display-style 'fancy)
(define-key read-expression-map (kbd "C-r") 'counsel-expression-history)))
提供了一些实用功能
;; 一些有用的小功能
(use-package
counsel
:defer 2
:ensure t
:bind
(("C-x C-r" . 'counsel-recentf)
("C-x d" . 'counsel-dired)))
一款查找字符并快速跳转的工具
;; 查找字符跳转工具
(use-package avy
:ensure t
:bind (("M-g :" . 'avy-goto-char)
("M-g '" . 'avy-goto-char-2)
("M-g \"" . 'avy-goto-char-timer)
("M-g f" . 'avy-goto-line)
("M-g w" . 'avy-goto-word-1)
("M-g e" . 'avy-goto-word-0)))
;; (use-package ivy-posframe
;; :ensure nil
;; :config
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
;; ;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-center)))
;; ;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-window-center)))
;; ;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-bottom-left)))
;; ;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-window-bottom-left)))
;; ;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-top-center)))
;; (ivy-posframe-mode 1))
一款输入法插件,但其实并不是一个输入法,只是在Emacs中rime输入法的前端实现,但是却非常好用! 强烈推荐!
;; 使用rime输入法
(use-package rime
:ensure t
:custom
(default-input-method "rime")
:config
(setq rime-user-data-dir "~/.config/fcitx/rime")
(setq rime-posframe-properties
(list :background-color "#333333"
:foreground-color "#dcdccc"
:font "Sarasa Mono SC-16"
:internal-border-width 10))
(setq default-input-method "rime"
rime-show-candidate 'posframe))
;; (use-package xah-fly-keys
;; :ensure t
;; :config
;; (xah-fly-keys-set-layout "qwerty")
;; (xah-fly-keys 1))
类似mode-line的一个插件,但是没有mode-line那么繁杂
;; (use-package awesome-tray
;; :load-path "/home/evanmeek/.emacs.d/site-lisp/awesome-tray"
;; :config
;; (awesome-tray-mode 1))
由王勇大佬开发的自动补全括号的功能
(use-package
awesome-pair
:load-path "/home/evanmeek/.emacs.d/site-lisp/awesome-pair"
:disabled
:config (dolist (hook (list 'c-mode-common-hook 'c-mode-hook 'c++-mode-hook 'java-mode-hook
'haskell-mode-hook 'emacs-lisp-mode-hook 'lisp-interaction-mode-hook
'lisp-mode-hook 'maxima-mode-hook 'ielm-mode-hook 'sh-mode-hook
'makefile-gmake-mode-hook 'php-mode-hook 'python-mode-hook
'js-mode-hook 'go-mode-hook 'qml-mode-hook 'jade-mode-hook
'css-mode-hook 'ruby-mode-hook 'coffee-mode-hook 'rust-mode-hook
'qmake-mode-hook 'lua-mode-hook 'swift-mode-hook
'minibuffer-inactive-mode-hook))
(add-hook hook '(lambda ()
(awesome-pair-mode 1))))
(define-key awesome-pair-mode-map (kbd "(") 'awesome-pair-open-round)
(define-key awesome-pair-mode-map (kbd "[") 'awesome-pair-open-bracket)
(define-key awesome-pair-mode-map (kbd "{") 'awesome-pair-open-curly)
(define-key awesome-pair-mode-map (kbd ")") 'awesome-pair-close-round)
(define-key awesome-pair-mode-map (kbd "]") 'awesome-pair-close-bracket)
(define-key awesome-pair-mode-map (kbd "}") 'awesome-pair-close-curly)
(defpine-key awesome-pair-mode-map (kbd "=") 'awesome-pair-equal)
(define-key awesome-pair-mode-map (kbd "%") 'awesome-pair-match-paren)
(define-key awesome-pair-mode-map (kbd "\"") 'awesome-pair-double-quote)
(define-key awesome-pair-mode-map (kbd "SPC") 'awesome-pair-space)
(define-key awesome-pair-mode-map (kbd "M-o") 'awesome-pair-backward-delete)
(define-key awesome-pair-mode-map (kbd "C-d") 'awesome-pair-forward-delete)
(define-key awesome-pair-mode-map (kbd "C-k") 'awesome-pair-kill)
(define-key awesome-pair-mode-map (kbd "M-\"") 'awesome-pair-wrap-double-quote)
(define-key awesome-pair-mode-map (kbd "M-[") 'awesome-pair-wrap-bracket)
(define-key awesome-pair-mode-map (kbd "M-{") 'awesome-pair-wrap-curly)
(define-key awesome-pair-mode-map (kbd "M-(") 'awesome-pair-wrap-round)
(define-key awesome-pair-mode-map (kbd "M-)") 'awesome-pair-unwrap)
(define-key awesome-pair-mode-map (kbd "M-p") 'awesome-pair-jump-right)
(define-key awesome-pair-mode-map (kbd "M-n") 'awesome-pair-jump-left)
(define-key awesome-pair-mode-map (kbd "M-:") 'awesome-pair-jump-out-pair-and-newline))
;; (use-package awesome-tab
;; :load-path "/home/evanmeek/.emacs.d/site-lisp/awesome-tab"
;; :config
;; (awesome-tab-mode t))
(use-package company-english-helper
:load-path "/home/evanmeek/.emacs.d/site-lisp/company-english-helper"
:config
(define-key leader-key (kbd "t e") 'toggle-company-english-helper))
Emacs中的Telegram
(use-package
telega
:defer 2
:init (setq telega-proxies
'((:server "localhost"
:port 1080
:enable t
:type (:@type "proxyTypeSocks5"))))
(setq telega-chat-fill-column 65)
(setq telega-emoji-use-images nil)
:config
(set-fontset-font t 'unicode (font-spec :family "Symbola") nil 'prepend)
(with-eval-after-load 'company (add-hook 'telega-chat-mode-hook (lambda ()
(make-local-variable
'company-backends)
(dolist (it
'(telega-company-botcmd
telega-company-emoji))
(push it company-backends)))))
(with-eval-after-load 'all-the-icons (add-to-list 'all-the-icons-mode-icon-alist
'(telega-root-mode all-the-icons-fileicon
"telegram"
:heigt 1.0
:v-adjust -0.2
:face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist '(telega-chat-mode
all-the-icons-fileicon
"telegram"
:heigt 1.0
:v-adjust -0.2
:face all-the-icons-blue)))
(telega-notifications-mode 1)
(telega-mode-line-mode 1))
一款真正的终端仿真器
(use-package vterm
:defer 2
:config
(define-key 'leader-key (kbd "o t") 'vterm))
有道词典
(use-package youdao-dictionary
:defer 2
:ensure t
:config
(setq url-automatic-caching t)
(which-key-add-key-based-replacements "C-x y" "有道翻译")
:bind
(("C-x y t" . 'youdao-dictionary-search-at-point-tooltip)
("C-x y p" . 'youdao-dictionary-play-voice-at-point)
("C-x y r" . 'youdao-dictionary-search-and-replace)
("C-x y i" . 'youdao-dictionary-search-from-input)))
(use-package
bongo
:config (defun bongo-init ()
(interactive)
(let ((buffer (current-buffer)))
(bongo)
(setq bongo-insert-whole-directory-trees "ask")
(bongo-insert-file "~/Music")
(bongo-insert-enqueue-region (point-min)
(point-max))
(bongo-play-random)
(switch-to-buffer buffer)))
(define-key 'leader-key (kbd "b RET") 'bongo-dwim)
(define-key 'leader-key (kbd "b i") 'bongo-init)
(define-key 'leader-key (kbd "b x") 'bongo-kill-region)
(define-key 'leader-key (kbd "b d") 'bongo-kill-line)
(define-key 'leader-key (kbd "b _") 'bongo-undo)
(define-key 'leader-key (kbd "b SPC") 'bongo-pause/resume)
(define-key 'leader-key (kbd "b TAB") 'bongo-toggle-collapsed)
(define-key 'leader-key (kbd "b h") 'bongo-seek-backward-10)
(define-key 'leader-key (kbd "b l") 'bongo-seek-forward-10)
(define-key 'leader-key (kbd "b a") 'bongo-insert-enqueue)
(define-key 'leader-key (kbd "b n") 'bongo-play-next)
(define-key 'leader-key (kbd "b p") 'bongo-play-previous)
(define-key 'leader-key (kbd "b r") 'bongo-play-random)
(define-key 'leader-key (kbd "b s") 'bongo-sprinkle))
彩虹括号
(use-package
rainbow-delimiters
:ensure t
:config
;; 设置每一级括号的颜色
(set-face-foreground 'rainbow-delimiters-depth-1-face "orange red")
(set-face-foreground 'rainbow-delimiters-depth-2-face "gold")
(set-face-foreground 'rainbow-delimiters-depth-3-face "yellow")
(set-face-foreground 'rainbow-delimiters-depth-4-face "spring green")
(set-face-foreground 'rainbow-delimiters-depth-5-face "cyan")
(set-face-foreground 'rainbow-delimiters-depth-6-face "magenta")
(set-face-foreground 'rainbow-delimiters-depth-7-face "goldenrod")
(set-face-foreground 'rainbow-delimiters-depth-8-face "IndianRed1")
(set-face-foreground 'rainbow-delimiters-depth-9-face "ivory1")
(set-face-bold 'rainbow-delimiters-depth-1-face "orange red")
(set-face-bold 'rainbow-delimiters-depth-2-face "gold")
(set-face-bold 'rainbow-delimiters-depth-3-face "yellow")
(set-face-bold 'rainbow-delimiters-depth-4-face "spring green")
(set-face-bold 'rainbow-delimiters-depth-5-face "cyan")
(set-face-bold 'rainbow-delimiters-depth-6-face "magenta")
(set-face-bold 'rainbow-delimiters-depth-7-face "goldenrod")
(set-face-bold 'rainbow-delimiters-depth-8-face "IndianRed1")
(set-face-bold 'rainbow-delimiters-depth-9-face "ivory1")
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
EAF 是一个全新的图形应用框架,通过扩展Emacs的多媒体能力,最终达到 Live in Emacs 的终极目标。
(use-package eaf
:disabled
:load-path "~/.emacs.d/site-lisp/emacs-application-framework" ; Set to "/usr/share/emacs/site-lisp/eaf" if installed from AUR
:custom
(eaf-find-alternate-file-in-dired t)
(eaf-proxy-type "http")
(eaf-proxy-host "127.0.0.1")
(eaf-proxy-port "1080")
:config
(eaf-setq eaf-browser-dark-mode "true")
(eaf-setq eaf-mindmap-dark-mode "true")
(eaf-setq eaf-pdf-dark-mode "true")
(eaf-setq eaf-browser-default-zoom "1.5")
(eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding)
(eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding)
(eaf-bind-key take_photo "p" eaf-camera-keybinding))
(use-package socks
:ensure t
:custom
(url-gateway-method 'socks)
(socks-server '("Default server" "localhost" 1080 5)))
(use-package pdf-tools
:ensure t)
(use-package windmove
:ensure t
:init (windmove-default-keybindings)
:config
(which-key-add-key-based-replacements "M-SPC w" "窗口")
:bind (:map leader-key
("w f" . #'windmove-right)
("w b" . #'windmove-left)
("w p" . #'windmove-up)
("w n" . #'windmove-down)))
启动时间测试
(use-package esup
:ensure t
;; To use MELPA Stable use ":pin mepla-stable",
:pin melpa
:commands (esup))
一款补全框架
(use-package
company
:defer 2
:hook (after-init . global-company-mode)
:init (setq company-tooltip-align-annotations t company-idle-delay 0 company-echo-delay 0
company-minimum-prefix-length 2 company-require-match nil company-dabbrev-ignore-case
nil company-dabbrev-downcase nil company-show-numbers t)
:config
(with-eval-after-load 'company
(define-key company-active-map (kbd "M-n") nil)
(define-key company-active-map (kbd "M-p") nil)
(define-key company-active-map (kbd "C-n") #'company-select-next)
(define-key company-active-map (kbd "C-p") #'company-select-previous)))
(use-package company-tabnine
:ensure t
:after 'company-mode 'company-tabnine-mode
:config
(add-to-list 'company-backends #'company-tabnine))
自动提示
;; 自动补全
;; (use-package
;; auto-complete
;; :ensure t
;; :init (progn (ac-config-default)
;; (global-auto-complete-mode t)))
(use-package lsp-mode
:ensure t
:config
(add-hook 'prog-mode-hook #'lsp)
(setq lsp-keymap-prefix "C-c l"))
一款轻量级别的LSP客户端,依赖于posframe和company-mode
;; (use-package nox
;; :init (load (expand-file-name "/home/evanmeek/.emacs.d/site-lisp/nox/jsonrpc.el"))
;; :load-path "/home/evanmeek/.emacs.d/site-lisp/nox/"
;; :config (dolist (hook (list 'js-mode-hook 'rust-mode-hook 'python-mode-hook 'ruby-mode-hook
;; 'java-mode-hook 'sh-mode-hook 'php-mode-hook 'c-mode-common-hook
;; 'c-mode-hook 'c++-mode-hook 'haskell-mode-hook))
;; (add-hook hook '(lambda ()
;; (nox-ensure)))))
显示隐藏结构数据,例如函数体
(use-package hideshow
:ensure nil
:diminish hs-minor-mode
:bind (:map prog-mode-map
("C-c TAB" . hs-toggle-hiding)
("C-c p +" . hs-show-all))
:hook (prog-mode . hs-minor-mode))
必备
(use-package
org
:ensure t)
一款美化org-mode样式的插件
;; org-mode 更漂亮的子弹哈哈哈
(use-package
org-bullets
:ensure t
:config
(add-hook 'org-mode-hook (lambda ()
(org-bullets-mode t))))
一款能将org文件做成PPT的工具 介绍页面
(use-package
ox-reveal
:after 'org
:ensure t
:config
(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/"))
;; 对reveal提供代码语法高亮支持
(use-package
htmlize
:ensure t)
一款可以临时下载安装插件的插件,通常用于测试插件的用法。
;; 使用try来临时使用任何插件
(use-package try
;; ensure 是关键词(key),设置为t表示确保次插件已被安装
:ensure t)
代码检查
(use-package flycheck
:ensure t
:init (global-flycheck-mode)
:bind (:map leader-key
("t t" . global-flycheck-mode))
:config
(which-key-add-key-based-replacements
"M-SPC t t" "开关flycheck"))
lsp-mode的高级UI功能
(use-package lsp-ui
:ensure t
:hook
((lsp . lsp-ui-sideline-mode-hook)
(lsp . lsp-ui-doc-mode-hook)
(lsp . lsp-ui-imenu-mode-hook)
(lsp . lsp-ui-peek-mode-hook)
)
:custom
(lsp-ui-doc-delay 1))
提供company对lsp-mode的支持
(use-package company-lsp
:ensure t
:config
(push 'company-lsp company-backends))
(use-package lsp-python-ms
:ensure t
:hook
(('python-mode-hook #'lsp)))
(use-package js2-mode
:ensure t)
(use-package lsp-python-ms
:ensure t
:hook (python-mode . (lambda ()
(require 'lsp-python-ms)
(lsp)))
:custom
(lsp-python-ms-executable "~/.emacs.d/var/python-language-server/output/bin/Release/linux-x64/publish/Microsoft.Python.LanguageServer"))