我不是大神,使用vim和emacs只是兴趣,打发空闲时间。

上代码:

;; Added by Package.el.  This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize) (custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(display-time-mode t)
'(inhibit-startup-screen t)
'(package-selected-packages
(quote
(markdown-mode easy-kill ace-window w3 seq realgud-ipdb yasnippet csv-mode company-statistics flymake docbook enwc auctex all python org html5-schema json-mode company-math ##))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "宋体" :foundry "outline" :slant normal :weight normal :height 120 :width normal))))) (set-scroll-bar-mode nil)
(tool-bar-mode nil) (setq initial-frame-alist '((top . 0)(left . 0)(width . 165)(height . 40))) ;; Date Setting
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(setq display-time-use-mail-icon t)
(setq display-time-interval 10) ;; Closing the sounds
(setq visible-bell t) ;; Show the column and line
(setq column-number-mode t)
(setq line-number-mode t) ;; autosave
(setq auto-save-mode nil) (setq make-backup-files nil)
(setq-default make-backup-files nil) ;; Show the directory and files
(setq speedbar-show-unknown-files t) ;; It is convenient for us to write code.
(load-library "hideshow")
(add-hook 'c-mode-hook 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'perl-mode-hook 'hs-minor-mode)
(add-hook 'php-mode-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
(add-hook 'org-mode-hook 'turn-on-foot-lock)
;; Editing css
(autoload 'css-mode "css-mode" "CSS editing mode" t) (autoload 'htmlize-buffer "htmlize" "HTMLize mode" t) (autoload 'folding-mode "folding" "Folding mode" t)
(autoload 'turn-off-folding-mode "folding" "Folding mode" t)
(autoload 'turn-on-folding-mode "folding" "Folding mode" t) ;; The file pattern is associated with the filename suffix
(setq auto-mode-alist
(append '(("\\.py\\'" . python-mode)
("\\.s?html?\\'" . html-helper-mode)
("\\.asp\\'" . html-helper-mode)
("\\.phtml\\'" . html-helper-mode)
("\\.css\\'" . css-mode))
auto-mode-alist)) ;; Set keyboard
(global-set-key [F11] 'compile)
(global-set-key [F12] 'gdb) ;; increase package-archives
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize) ;; configure the markdown-mode
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) (autoload 'gfm-mode "markdown-mode"
"Major mode for editing GitHub Flavored Markdown files" t)
(add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))

然后看下(这头牛真不错):

emacs开发网站

Main repository:

git clone -b master git://git.sv.gnu.org/emacs.git

ELPA repository:

git clone git://git.sv.gnu.org/emacs/elpa

官方文档在这里emacs开发配置,还是需要硬读英文文档。


最新更新:

(setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")

("melpa" . "http://elpa.emacs-china.org/melpa/")))

;; -----------------------------------My main configuration---------------------------------------

(custom-set-variables

;; custom-set-variables was added by Custom.

;; If you edit it by hand, you could mess it up, so be careful.

;; Your init file should contain only one such instance.

;; If there is more than one, they won't work right.

'(global-linum-mode t)

'(inhibit-startup-screen t)

'(electric-pair-mode t)

'(package-selected-packages

'(flycheck-ycmd company-ycmd ycmd elpy yasnippet s pyvenv py-autopep8 material-theme highlight-indentation flycheck company better-defaults auto-complete)))

(setq initial-frame-alist '((top . 0)(left . 0)(width . 170)(height . 43)))

(tool-bar-mode 0)

(menu-bar-mode 0)

(scroll-bar-mode 0)

(setq initial-scratch-message "")

(setq tool-bar-mode nil)

(setq visible-bell t)

(setq auto-save-mode nil)

(setq backup-directory-alist (quote ("." . "/home/D/Software/Centos_7/backups/")))

(setq-default auto-save-timeout 15)

(setq-default auto-save-interval 100)

(setq make-backup-files nil)

(setq

backup-by-copying t

delete-old-versions t

kept-new-versions 3

kept-old-versions 1

version-control t)

(setq default-tab-width 4)

(setq indent-tabs-mode nil)

;; ----------------------------------Python 3.4 IDE configuration---------------------------------

(require 'package)

(add-to-list 'package-archives

'("melpa" . "http://melpa.org/packages/") t)

(package-initialize)

(defvar myPackages

'(better-defaults

elpy

auto-complete

py-autopep8

flycheck

material-theme))

(when (not package-archive-contents)

(package-refresh-contents))

(mapc #'(lambda (package)

(unless (package-installed-p package)

(package-install package)))

myPackages)

(require 'elpy)

(setq elpy-rpc-python-command "python3")

(setq python-shell-interpreter "python3")

(setq pyvenv-virtualenvwrapper-python "/usr/bin/python3")

(elpy-enable)

(ac-config-default)

(load-theme 'material t) ;; load material theme

(global-set-key (kbd "RET") 'newline-and-indent)

(when (require 'flycheck nil t)

(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))

(add-hook 'elpy-mode-hook 'flycheck-mode))

;; enable autopep8 formatting on save

(require 'py-autopep8)

(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)

;;--------------------------------- My ycmd configuration-------------------------------------

;;;; To use ycmd-mode in all supported modes

(require 'ycmd)

(add-hook 'after-init-hook #'global-ycmd-mode)

;;;; Specify only support c/c++ mode

;;(require 'ycmd)

;;(add-hook 'c++-mode-hook 'company-mode)

;;(add-hook 'c++-mode-hook 'ycmd-mode)

;;;; Specify how to run the server

(set-variable 'ycmd-server-command '("/usr/bin/python3" "/home/D/ycmd/ycmd"))

;;;; Specify a global emacs configuration

(set-variable 'ycmd-global-config "/home/D/ycmd/examples/.ycm_extra_conf.py")

;;;; Completion framework

(require 'company-ycmd)

(company-ycmd-setup)

(add-hook 'after-init-hook #'global-company-mode)

;;;; Enable flycheck

(require 'flycheck-ycmd)

(flycheck-ycmd-setup)

(add-hook 'after-init-hook #'global-flycheck-mode)

;;;; Set always complete immediately

(setq company-idle-delay 0)

;;;; ---------------------------------------------------

我的.emacs配置的更多相关文章

  1. emacs配置eslint 语法检查.找不到node解决

    使用emacs配置eslint 当调用语法检查时报错 Suspicious state from syntax checker javascript-eslint: Checker javascrip ...

  2. emacs配置详解及C/C++IDE全功能配置演示(附配置文件)

    我的emacs插件下载地址: http://pan.baidu.com/share/link?shareid=4196458904&uk=3708780105 说明: 1.为什么使用emacs ...

  3. 一些有用的 Emacs 配置(窗口快速切换、一键透明效果、任意位置删除整行等)

    本篇文章记录的是一些有用的 Emacs 配置,有些是自己原创,有些是借鉴别人(能记起来出处的我放了链接). 规定:C 代表 Ctrl,M 代表 Alt. 1.设置一次跳跃 n 行的快捷键 按 C-M- ...

  4. emacs 配置

    个人的Emacs配置,环境是archlinux,参考了不少网上资料,因为太多,就不一一列举了,在这里感谢那些作者的辛苦经验劳动. (custom-set-variables ;; custom-set ...

  5. 绝世emacs配置for Ubuntu

    反正过不了几天就要退役了,把emacs配置放出来造福(祸害)大众? 浓浓的OIER风格,除了方便打代码就没别的用处(F8并不这样认为?),只可惜windows下的弄丢了,只有Ubuntu下的. F1不 ...

  6. 存个emacs配置

    emacs配置 (global-set-key [f9] 'compile-file) (global-set-key [f10] 'gud-gdb) (global-set-key (kbd &qu ...

  7. emacs 配置.emacs

    emacs 配置.emacs (require 'package) (package-initialize) (add-to-list'package-archives '("melpa&q ...

  8. purcell的emacs配置中的自动补全功能开启

    标记一下,原文参看purcell的emacs配置中的自动补全功能开启 修改init-auto-complete.el文件 ;;(setq-default ac-expand-on-auto-compl ...

  9. 中国大陆无法访问Steve Purcell的emacs配置解决办法

    因为大陆网络问题,没办法访问Steve Purcell的emacs配置中的melpa.org,所以我们更改目录即可. 1.删除自己的配置. $ rm ~/.emacs $ rm -rf ~/.emac ...

  10. emacs配置&博客界面源代码

    emacs配置 如果想要考场简单配置也可以去下面看,需要别的考场配置可以自己在下面比较全的里面找 考试备忘录(有新的就会更的...) By Junlier (global-set-key [f9] ' ...

随机推荐

  1. web自动化中pytest框架的使用(二)---参数化

    1.pytest--参数化 在测试用例的前面加上@pytest.mark.parametrize("参数名",列表数据) 参数名:用来接收每一项数据,并作为测试用例的参数 列表数据 ...

  2. TensorFlow-keras fit的callbacks参数,定值保存模型

    from tensorflow.python.keras.preprocessing.image import load_img,img_to_array from tensorflow.python ...

  3. spring源码阅读笔记09:循环依赖

    前面的文章一直在研究Spring创建Bean的整个过程,创建一个bean是一个非常复杂的过程,而其中最难以理解的就是对循环依赖的处理,本文就来研究一下spring是如何处理循环依赖的. 1. 什么是循 ...

  4. git在push时候出现timeout的解决方法

    1.先对照一下公钥是否正确:linux下生成的.ssh在~/.ssh,命令行直接cd ~/.ssh即可:2.本次出现的问题如下: 出现了连接不上的情况,传输协议用的是ssh,此时需要进行如下操作: 进 ...

  5. docker(1)

    什么是Docker? Docker 最初是dotCloud公司创始人Solomon Hykes在法国期间发起的一个公司内部项目,它是基于dotCloud公司多年云服务技术的一次革新. Docker使用 ...

  6. Python与Excel交互——Xlwings实战

    这一期直接来实战. 比如说,我们在一个快递网站上爬取了几个快递的轨迹信息,我们需要将数据保存下来,一个常规做法是把数据保存在数据库里(Mysql,MongoDB,Redis),另一个是用Excel的形 ...

  7. js基石之---易读、易复用、易重构的 JavaScript 代码规范

    易读.易复用.易重构的 JavaScript 代码规范 1.变量命名规范有意义 Bad: const yyyymmdstr = moment().format("YYYY/MM/DD&quo ...

  8. http请求返回的数字代表的含义

    一些常见的状态码为: 200 - 服务器成功返回网页 404 - 请求的网页不存在 503 - 服务器超时 下面提供 HTTP 状态码的完整列表.点击链接可了解详情.您也可以访问 HTTP 状态码上的 ...

  9. mac OS 安装 Eclipse

    安装Eclipse前先确认你的Mac上是否已安装Java运行环境.进入终端,输入"java -version",如果返回了java版本号则说明已安装 访问Eclipse官方首页ht ...

  10. NodeJs mysql 开启事务

    如题:node后台使用mysql数据库,并使用事务来管理数据库操作. 这里主要讲一个事务的封装并写了一个INSERT 插入操作. code: 基础code: db.config.js const my ...