my emacs configuration
modified from https://github.com/flyingmachine/emacs-for-clojure
;;;;
;; Packages
;;;; ;; Define package repositories
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("tromey" . "http://tromey.com/elpa/") t)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t) ;; (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
;; ("marmalade" . "http://marmalade-repo.org/packages/")
;; ("melpa" . "http://melpa-stable.milkbox.net/packages/"))) ;; Load and activate emacs packages. Do this first so that the
;; packages are loaded before you start trying to modify them.
;; This also sets the load path.
(package-initialize) ;; Download the ELPA archive description if needed.
;; This informs Emacs about the latest versions of all packages, and
;; makes them available for download.
(when (not package-archive-contents)
(package-refresh-contents)) ;; The packages you want installed. You can also install these
;; manually with M-x package-install
;; Add in your own as you wish:
(defvar my-packages
'(;; makes handling lisp expressions much, much easier
;; Cheatsheet: http://www.emacswiki.org/emacs/PareditCheatsheet
paredit ;; key bindings and code colorization for Clojure
;; https://github.com/clojure-emacs/clojure-mode
clojure-mode ;; extra syntax highlighting for clojure
clojure-mode-extra-font-locking ;; integration with a Clojure REPL
;; https://github.com/clojure-emacs/cider
cider ;; allow ido usage in as many contexts as possible. see
;; customizations/navigation.el line 23 for a description
;; of ido
ido-ubiquitous ;; Enhances M-x to allow easier execution of commands. Provides
;; a filterable list of possible commands in the minibuffer
;; http://www.emacswiki.org/emacs/Smex
smex ;; project navigation
projectile ;; colorful parenthesis matching
rainbow-delimiters ;; edit html tags like sexps
;; tagedit ;; git integration
;;magit
)) (dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p))) ;; Place downloaded elisp files in ~/.emacs.d/vendor. You'll then be able
;; to load them.
;;
;; For example, if you download yaml-mode.el to ~/.emacs.d/vendor,
;; then you can add the following code to this file:
;;
;; (require 'yaml-mode)
;; (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
;;
;; Adding this code will make Emacs enter yaml mode whenever you open
;; a .yml file
(add-to-list 'load-path "~/.emacs.d/vendor") ;; change default start up directory
(setq default-directory "C:/Users/hello/") ;; Go straight to scratch buffer on startup
(setq inhibit-startup-message t) ;; "When several buffers visit identically-named files,
;; Emacs must give the buffers distinct names. The usual method
;; for making buffer names unique adds ‘’, ‘’, etc. to the end
;; of the buffer names (all but one of them).
;; The forward naming method includes part of the file's directory
;; name at the beginning of the buffer name
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward) ;; Turn on recent file mode so that you can more easily switch to
;; recently edited files when you first start emacs
(setq recentf-save-file (concat user-emacs-directory ".recentf"))
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 40) ;; ido-mode allows you to more easily navigate choices. For example,
;; when you want to switch buffers, ido presents you with a list
;; of buffers in the the mini-buffer. As you start to type a buffer's
;; name, ido will narrow down the list of buffers to match the text
;; you've typed in
;; http://www.emacswiki.org/emacs/InteractivelyDoThings
(ido-mode t)
;; This allows partial matches, e.g. "tl" will match "Tyrion Lannister"
(setq ido-enable-flex-matching t)
;; Turn this behavior off because it's annoying
(setq ido-use-filename-at-point nil)
;; Don't try to match file across all "work" directories; only match files
;; in the current directory displayed in the minibuffer
(setq ido-auto-merge-work-directories-length -1)
;; Includes buffer names of recently open files, even if they're not
;; open now
(setq ido-use-virtual-buffers t)
;; This enables ido in all contexts where it could be useful, not just
;; for selecting buffer and file names
(ido-ubiquitous-mode 1)
;; Shows a list of buffers
(global-set-key (kbd "C-x C-b") 'ibuffer) ;; Enhances M-x to allow easier execution of commands. Provides
;; a filterable list of possible commands in the minibuffer
;; http://www.emacswiki.org/emacs/Smex
(setq smex-save-file (concat user-emacs-directory ".smex-items"))
(smex-initialize)
(global-set-key (kbd "M-x") 'smex) ;; projectile everywhere!
(projectile-global-mode) ;; turn on menu bar
(menu-bar-mode 1) ;; Show line numbers
(global-linum-mode) ;; You can uncomment this to remove the graphical toolbar at the top. After
;; awhile, you won't need the toolbar.
;; (when (fboundp 'tool-bar-mode)
;; (tool-bar-mode -1)) ;; Don't show native OS scroll bars for buffers because they're redundant
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode -1)) ;; Color Themes
;; Read http://batsov.com/articles/2012/02/19/color-theming-in-emacs-reloaded/
;; for a great explanation of emacs color themes.
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Custom-Themes.html
;; for a more technical explanation.
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(add-to-list 'load-path "~/.emacs.d/themes")
(load-theme 'tomorrow-night-bright t) ;; increase font size for better readability
(set-face-attribute 'default nil :height 120) ;; These settings relate to how emacs interacts with your operating system
(setq ;; makes killing/yanking interact with the clipboard
x-select-enable-clipboard t ;; I'm actually not sure what this does but it's recommended?
x-select-enable-primary t ;; Save clipboard strings into kill ring before replacing them.
;; When one selects something in another program to paste it into Emacs,
;; but kills something in Emacs before actually pasting it,
;; this selection is gone unless this variable is non-nil
save-interprogram-paste-before-kill t ;; Shows all options when running apropos. For more info,
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Apropos.html
apropos-do-all t ;; Mouse yank commands yank at point instead of at click.
mouse-yank-at-point t) ;; enable cursor blinking
(blink-cursor-mode 1) ;; full path in title bar
(setq-default frame-title-format "%b (%f)") ;; don't pop up font menu
(global-set-key (kbd "s-t") '(lambda () (interactive))) ;; uncomment to disable bell
;; (setq ring-bell-function 'ignore) ;; Highlights matching parenthesis
(show-paren-mode 1) ;; Highlight current line
(global-hl-line-mode 1) ;; When you visit a file, point goes to the last place where it
;; was when you previously visited the same file.
;; http://www.emacswiki.org/emacs/SavePlace
(require 'saveplace)
(setq-default save-place t)
;; keep track of saved places in ~/.emacs.d/places
(setq save-place-file (concat user-emacs-directory "places")) ;; Emacs can automatically create backup files. This tells Emacs to
;; put all backups in ~/.emacs.d/backups. More info:
;; http://www.gnu.org/software/emacs/manual/html_node/elisp/Backup-Files.html
(setq backup-directory-alist `(("." . ,(concat user-emacs-directory
"backups"))))
(setq auto-save-default nil) ;; yay rainbows!
(global-rainbow-delimiters-mode t) (setq electric-indent-mode 1) ;; For editing lisps
;; Automatically load paredit when editing a lisp file
;; More at http://www.emacswiki.org/emacs/ParEdit
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode) ;; eldoc-mode shows documentation in the minibuffer when writing code
;; http://www.emacswiki.org/emacs/ElDoc
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) ;;;;
;; Clojure
;;;; ;; Enable paredit for Clojure
(add-hook 'clojure-mode-hook 'enable-paredit-mode) ;; This is useful for working with camel-case tokens, like names of
;; Java classes (e.g. JavaClassName)
(add-hook 'clojure-mode-hook 'subword-mode) ;; A little more syntax highlighting
(require 'clojure-mode-extra-font-locking) ;;;;
;; Cider
;;;; ;; provides minibuffer documentation for the code you're typing into the repl
(add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode) ;; go right to the REPL buffer when it's finished connecting
(setq cider-repl-pop-to-buffer-on-connect t) ;; When there's a cider error, show its buffer and switch to it
(setq cider-show-error-buffer t)
(setq cider-auto-select-error-buffer t) ;; Where to store the cider history.
(setq cider-repl-history-file "~/.emacs.d/cider-history") ;; Wrap when navigating history.
(setq cider-repl-wrap-history t) ;; enable paredit in your REPL
(add-hook 'cider-repl-mode-hook 'paredit-mode)
my emacs configuration的更多相关文章
- Emacs 自动补全插件 ycmd
Emacs 自动补全,最好的插件当属 ycmd.以下记录我的安装过程. 1. 安装 ycmd server github 官方地址: https://github.com/Valloric/ycmd ...
- Emacs 25.1 error solved: url-http-create-request: Multibyte text in HTTP request
Emacs 25.1 error solved: url-http-create-request: Multibyte text in HTTP request */--> code {colo ...
- 我的.emacs配置
我不是大神,使用vim和emacs只是兴趣,打发空闲时间. 上代码: ;; Added by Package.el. This must come before configurations of ; ...
- org-mode 写 cnblogs 博客
1. 为什么用org-mode写博客 我最开始用Emacs, 是因为org-mode.这是一个专注于写,而让我忽略展示结果的一种写作方式.为 什么这么说?因为所有内容的格式都是可定制的.按照自己喜欢的 ...
- CentOS 6.7 中安装Emacs 24.5
Emacs 版本:http://mirror.bjtu.edu.cn/gnu/emacs/emacs-24.5.tar.gz CentOS 内核版本:2.6.32-573.el6.x86_64 参考资 ...
- Emacs 相关资料翻译
Table of Contents 1. 37 Document Viewing 2. EmacsrelatedTranslation 2.1. Spacemacs 配置层(Configuration ...
- emacs配置详解及C/C++IDE全功能配置演示(附配置文件)
我的emacs插件下载地址: http://pan.baidu.com/share/link?shareid=4196458904&uk=3708780105 说明: 1.为什么使用emacs ...
- 用Emacs收发邮件
使用Emacs,将尽可能多的工作放到Emacs中来完成,这样可以提高工作效率. 1.安装必要的LISP插件和程序 $sudo apt-get install stunnel4 $sudo apt-ge ...
- CentOS 中安装和卸载 Emacs
日志更新记录: [1] 增加 CentOS7.2 (内核版本:3.10.0-514.16.1.el7.x86_64)下Emacs25.2 的安装过程,它与本文的步骤完全一样. Emacs 版本:htt ...
随机推荐
- antd引入普通html使用,将ant Design本地化
一直想着能本地化antd的,不用npm以及dva那么复杂的配置环境来开发,并且本地化以后对以后链接flask的模板渲染机制也能很好的结合.下面是具体的实现方法: 1.将react的相关链接引入: &l ...
- JVM相关小结
对JVM中分层模型.垃圾回收期.垃圾回收算法趁着周末小结一下.有不对的地方,还请指正和讨论~ 1.JVM内存模型 2.JVM垃圾回收期 3.JVM垃圾回收算法 ------------------- ...
- 网页直播、微信直播技术解决方案:EasyNVR与EasyDSS流媒体服务器组合之区分不同场景下的easynvr
近期遇到好多客户咨询关于实现微信直播.或者是将直播页面集成进入自己项目中. 该方案的主要目的:完成在公网一直进行内网摄像头的RTMP/HLS直播! 实现方案的具体实现: EasyNVR+EasyDSS ...
- EasyNVR RTSP转RTMP-HLS流媒体服务器前端构建之:内部搜索功能的实现
上一篇介绍了处理接口获取的数据,本篇将介绍如何在接收到的数据中搜索出自己符合条件的数据: 为了页面的美观,我们往往会以分页的形式来进行数据的展示.但是,当需要展示出来的数据太多的时候,我们很难迅速的找 ...
- 高性能流媒体服务器EasyDSS前端重构(四)- webpack + video.js 打造流媒体服务器前端
接上篇 接上篇<高性能流媒体服务器EasyDSS前端重构(三)- webpack + vue + AdminLTE 多页面引入 element-ui> 本文围绕着实现EasyDSS高性能流 ...
- 九度OJ 1151:位操作练习 (位操作)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1679 解决:924 题目描述: 给出两个不大于65535的非负整数,判断其中一个的16位二进制表示形式,是否能由另一个的16位二进制表示形 ...
- protobuf json xml比较
1 protobuf/xml/json对比 从数据的存储格式的角度进行对比 假如要存储一个键值对: {price:150} 1.1 protobuf的表示方式 message Test { opti ...
- 关于gcc
1 the architecture of gcc 2 自己编译gcc时的 --build --host --target选项的含义和用法 <1> --build 执行本次的gcc编译的主 ...
- 我的Android进阶之旅------>真正在公司看几天代码的感触
仅以此文来回顾这一周我的工作情况,以及由此而触发的感想. ============================================================= 来到新公司5天了, ...
- discuz论坛搬家
很多站长第一次做网站的时候,无奈选择了速度不是很稳定的空间,慢慢会发现有很多物美价廉速度相当快的空间 这个时候,站长在网站搬家的过程中就会遇到很多困难,今天老袋鼠给大家详细讲解一下discuz论坛搬家 ...