我不是大神,使用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. vue中使用echarts 制作某市各个街道镇的地图

    我要制作的是青州的各街道镇的地图,于是我上网搜,很感谢这篇文章的作者给的提点和帮助https://www.jianshu.com/p/7337c2f56876 现在我把自己的制作过程做个整理,以山东省 ...

  2. Idea上tomcat部署细节

    ​ 一.On Update action: (1)Update resources:更新项目变更的.jsp,.xml文件等资源文件,而不会更新源码文件:(仅修改项目的JS文件.JSP文件.CSS文件推 ...

  3. Flutter Weekly Issue 53

    插件 left-scroll-actions A useful left scroll actions widget like WeChat.一款仿微信效果的 Flutter 左滑菜单插件.现在支持i ...

  4. 关于暴力破解的一些学习笔记(pikachu)

    这几天的笔记都懒得发博客都写在本地了,随缘搬上来 什么是暴力破解 就是在攻击者不知道目标账号密码情况下的,对目标系统的常识性登陆 一般会采用一些工具+特定的字典 来实现高效的连续的尝试性登陆 一个有效 ...

  5. 如何在没有安装 Python 的机器上运行 Python 程序

    cmd 命令 1. pip install pyinstaller 2. pyinstaller <path to your prog.py> 3. 应用程序在prog.py同路径下的 d ...

  6. linux uniq 命令实用手册

    Linux uniq 命令用于处理文本内容中的重复行. 这里我们只介绍其常用参数,其完整用法可参见man uniq. 例如,我们有如下文件内容: >>> cat log.txt __ ...

  7. MySql id 设定为主键不自增后,再给 sort 字段增加自增属性

    需求 id 已经被设置为主键,但是没有给它设置 自增 属性.sort 起到一个排序的作用,需要给它设置一个 自增 属性 加自增属性的前提 表中的属性没有增加自增 赋予自增属性的字段,必须带有 索引 S ...

  8. JNI与NDK简析(一)

    1 JNI 简介 在Android Framework中,需要提供一种媒介或 桥梁,将Java层(上层)与C/C++层(下层)有机的联系起来,使得他们互相协调完成某些任务.而充当这种媒介的就是Java ...

  9. Linux / mac OS Shell常用命令

    一.文件.目录操作命令 1.ls命令 功能:显示文件和目录的信息 ls 以默认方式显示当前目录文件列表 ls -a 显示所有文件包括隐藏文件 ls -l 显示文件属性,包括大小,日期,符号连接,是否可 ...

  10. codeforce 272E Dima and Horses (假DFS)

    E. Dima and Horses Dima came to the horse land. There are n horses living in the land. Each horse in ...