1. ;;------------语言环境字符集设置(utf-8)-------------
  2. (set-language-environment 'Chinese-GB)
  3. (set-keyboard-coding-system 'utf-8)
  4. (set-clipboard-coding-system 'utf-8)
  5. (set-terminal-coding-system 'utf-8)
  6. (set-buffer-file-coding-system 'utf-8)
  7. (set-default-coding-systems 'utf-8)
  8. (set-selection-coding-system 'utf-8)
  9. (modify-coding-system-alist 'process "*" 'utf-8)
  10. (setq default-process-coding-system '(utf-8 . utf-8))
  11. (setq-default pathname-coding-system 'utf-8)
  12. (set-file-name-coding-system 'utf-8)
  13. (setq ansi-color-for-comint-mode t)
  14. ;;处理shell-mode乱码,好像没作用
  15. ;;------语言环境字符集设置结束------------
  16. ;;--------------窗口界面设置------------------
  17. (set-foreground-color "grey")
  18. (set-background-color "black")
  19. (set-cursor-color "gold1")
  20. (set-mouse-color "gold1")
  21. (set-scroll-bar-mode nil)
  22. ;;取消滚动栏
  23. ;;(customize-set-variable 'scroll-bar-mode 'right))
  24. ;;设置滚动栏在窗口右侧,而默认是在左侧
  25. (tool-bar-mode nil)
  26. ;;取消工具栏
  27. ;;启动设置
  28. (setq default-frame-alist
  29. '((vertical-scroll-bars)
  30. (top . 25)
  31. (left . 45)
  32. (width . 120)
  33. (height . 40)
  34. (background-color . "black")
  35. (foreground-color . "grey")
  36. (cursor-color . "gold1")
  37. (mouse-color . "gold1")
  38. (tool-bar-lines . 0)
  39. (menu-bar-lines . 1)
  40. (right-fringe)
  41. (left-fringe)))
  42. ;;启动自动最大化(数据自己调整,注意格式,如(top . 0),圆点前后都要留有空格)
  43. ;;(setq initial-frame-alist '((top . 0) (left . 0) (width . 142) (height . 49)))
  44. ;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
  45. (set-face-foreground 'highlight "white")
  46. (set-face-background 'highlight "blue")
  47. (set-face-foreground 'region "cyan")
  48. (set-face-background 'region "blue")
  49. (set-face-foreground 'secondary-selection "skyblue")
  50. (set-face-background 'secondary-selection "darkblue")
  51. ;;------------窗口界面设置结束-----------------
  52. ;;-------------方便编程操作设置----------------
  53. ;;把c语言风格设置为k&r风格
  54. (add-hook 'c-mode-hook
  55. '(lambda ()
  56. (c-set-style "k&r")))
  57. (autoload 'css-mode "css-mode" "CSS editing mode" t)
  58. ;;css-mode.el编辑css文件
  59. (autoload 'htmlize-buffer "htmlize" "HTMLize mode" t)
  60. ;;把buffer的内容连同颜色转为html格式
  61. (setq auto-mode-alist
  62. ;; 将文件模式和文件后缀关联起来
  63. (append '(("\\.py\\'" . python-mode)
  64. ("\\.s?html?\\'" . html-helper-mode)
  65. ("\\.asp\\'" . html-helper-mode)
  66. ("\\.phtml\\'" . html-helper-mode)
  67. ("\\.css\\'" . css-mode))
  68. auto-mode-alist))
  69. (defun my-compile()
  70. (interactive)
  71. (save-some-buffers t)
  72. (let((file(file-name-nondirectory buffer-file-name)))
  73. (compile(format "g++ %s -g -o %s" file(file-name-sans-extension file))))
  74. )
  75. (global-linum-mode t)
  76. (global-set-key [f9] 'my-compile)
  77. (set-frame-parameter (selected-frame) 'alpha '(85 50))
  78. (add-to-list 'default-frame-alist '(alpha (85 50)))
  79. (defun toggle-transparency ()
  80. (interactive)
  81. (let ((alpha (frame-parameter nil 'alpha)))
  82. (set-frame-parameter
  83. nil 'alpha
  84. (if (eql (cond ((numberp alpha) alpha)
  85. ((numberp (cdr alpha)) (cdr alpha))
  86. ;; Also handle undocumented ( ) form.
  87. ((numberp (cadr alpha)) (cadr alpha)))
  88. 100)
  89. '(85 50) '(100 100)))))
  90. (global-set-key (kbd "C-c t") 'toggle-transparency)
  91. (setq c-default-style
  92. '((java-mode . "java")(other . "awk")))
  93. ;;------------方便编程操作设置结束--------------------
  94. (custom-set-variables
  95. ;; custom-set-variables was added by Custom.
  96. ;; If you edit it by hand, you could mess it up, so be careful.
  97. ;; Your init file should contain only one such instance.
  98. ;; If there is more than one, they won't work right.
  99. '(cua-mode t nil (cua-base)))
  100. (custom-set-faces
  101. ;; custom-set-faces was added by Custom.
  102. ;; If you edit it by hand, you could mess it up, so be careful.
  103. ;; Your init file should contain only one such instance.
  104. ;; If there is more than one, they won't work right.
  105. )
  106. ;;在标题栏显示buffer的名字(默认不显示)
  107. (setq frame-title-format "%b@emacs")
  108. ;;显示匹配括号
  109. (show-paren-mode t)
  110. (setq show-paren-style 'parentheses)
  111. ;;全选
  112. (global-set-key (kbd "C-a") 'mark-whole-buffer)
  113. ;滚动页面时比较舒服,不要整页的滚动
  114. (setq scroll-step 1
  115. scroll-margin 3
  116. scroll-conservatively 10000)
  117. ;;4格缩进
  118. (setq-default indent-tabs-mode nil) ; tab 改为插入空格
  119. (setq c-basic-offset 4) ; c c++ 缩进4个空格
  120. (setq c-default-style "linux"); 没有这个 { } 就会瞎搞
  121. (setq default-tab-width 4)
  122. ;;其中最重要的一段:[F9]编译
  123. (defun my-compile()
  124. (interactive)
  125. (save-some-buffers t)
  126. (let((file(file-name-nondirectory buffer-file-name)))
  127. (compile(format "g++ %s -g -o %s" file(file-name-sans-extension file))))
  128. )
  129. (global-linum-mode t)
  130. (global-set-key [f9] 'my-compile)

我的emacs简易配置的更多相关文章

  1. emacs简易配置

    (setq-default inhibit-startup-message t tab-width 4 c-basic-offset 4 indent-tabs-mode t) (tool-bar-m ...

  2. ubuntu14.04 下emacs 24 配置

    目的: 配置emacs 24 适合编程开发 主要参考JerryZhang的配置(Emacs 简易教程) http://www.perfect-is-shit.com/emacs-simple-tuto ...

  3. Emacs简易教程

    Emacs简易教程阅读: 命令: $emacs 进入之后,输入: C-h t 这里,C-h表示按住[Ctrl]键的同时按h ####### 20090620 *退出: 输入“C-x C-c” *撤销: ...

  4. LAMP的搭建与简易配置(apache,php已module方式结合)

    测试所用环境:centos7.2 apache php 所在主机IP:9.110.187.120 mariadb 所在主机IP:9.110.187.121 第一部分:环境搭建 yum安装软件包 其中a ...

  5. NGINX按天生成日志文件的简易配置

    NGINX按天生成日志文件的简易配置 0x01 最近后端童鞋遇到一个小需求,拆分nginx生成的log文件,最好是按天生成,看着她还有很多bug待改的状态,我说这个简单啊,我来吧.曾经搞node后端的 ...

  6. [daily][emacs][go] 配置emacs go-mode的编辑环境以及环境变量问题

    1. 安装go 安装go-mode 使用emacs编辑go代码的时候,你需要有正常可运行的go环境. 并且有emacs的go-mode package https://www.emacswiki.or ...

  7. Emacs 安装配置使用教程

    Emacs 安装配置使用教程 来源 https://www.jianshu.com/u/a27b97f900f7 序|Preface 先来一篇有趣的简介:Emacs和Vim:神的编辑器和编辑器之神 - ...

  8. php简易配置函数

    nilcms中:php简易配置函数. 文件位置:nc-admin/common.php /* * --------------------------------------------------- ...

  9. Maven - settings.xml简易配置Demo

    前言 这里贴一下settings.xml的一个简易配置demo,就是简单配置了:本地的仓库地址.阿里云镜像.指定使用jdk1.8进行编译. 这里使用的Maven是3.5.0版本的. 配置文件demo ...

随机推荐

  1. 局域网安全-MAC Flood/Spoof

    原文发表于:2010-09-22 转载至cu于:2012-07-21 很早之前就看过秦柯讲的局域网安全的视频.但是看了之后在实际工作当中很少用到(指我个人的工作环境中,惭愧啊…),时间长了,好多技术细 ...

  2. CSS 实用实例

    背景颜色 1. 颜色背景 <style type="text/css">body { font-size: 16px;">h1 { font-size: ...

  3. JS加密库

    作者声明:本博客中所写的文章,都是博主自学过程的笔记,参考了很多的学习资料,学习资料和笔记会注明出处,所有的内容都以交流学习为主.有不正确的地方,欢迎批评指正 本文主要是参考aicoder马伦老师的博 ...

  4. 个人第十一周PSP

    11.24 --11.30本周例行报告 1.PSP(personal software process )个人软件过程. 类型 任务 开始时间                结束时间 中断时间 实际用 ...

  5. 王者荣耀交流协会第三次Scrum立会

    会议时间:2017年10月22号   18:00-18:32,时长32分钟. 会议地点:中快餐厅二楼第二排倒数第二个桌子. 立会内容: 1.每位同学汇报了今日工作. 2.通过讨论我们决定用存excel ...

  6. 四则运算3+psp0

    题目要求: 1.程序可以判断用户的输入答案是否正确,如果错误,给出正确答案,如果正确,给出提示. 2.程序可以处理四种运算的混合算式. 3.要求两人合作分析,合作编程,单独撰写博客. 团队成员:张绍佳 ...

  7. HDU 5862 Counting Intersections 扫描线+树状数组

    题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5862 Counting Intersections Time Limit: 12000/ ...

  8. C语言的问卷调查

    1.你对自己的未来有什么规划?做了哪些准备? 未来想当一个网络工程师,为了这个目标我正在努力学习网络.网页及相关的知识. 2.你认为什么是学习?学习有什么用?现在学习动力如何?为什么? 学习就是不断尝 ...

  9. [二叉查找树] 1115. Counting Nodes in a BST (30)

    1115. Counting Nodes in a BST (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Y ...

  10. iOS- 利用AFNetworking(AFN) - 实现文件上传

    官方建议AFN的使用方法 1. 定义一个全局的AFHttpClient:包含有 1> baseURL 2> 请求 3> 操作队列 NSOperationQueue 2. 由AFHTT ...