我的emacs简易配置
;;------------语言环境字符集设置(utf-8)-------------
(set-language-environment 'Chinese-GB)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
(set-file-name-coding-system 'utf-8)
(setq ansi-color-for-comint-mode t)
;;处理shell-mode乱码,好像没作用
;;------语言环境字符集设置结束------------
;;--------------窗口界面设置------------------
(set-foreground-color "grey")
(set-background-color "black")
(set-cursor-color "gold1")
(set-mouse-color "gold1")
(set-scroll-bar-mode nil)
;;取消滚动栏
;;(customize-set-variable 'scroll-bar-mode 'right))
;;设置滚动栏在窗口右侧,而默认是在左侧
(tool-bar-mode nil)
;;取消工具栏
;;启动设置
(setq default-frame-alist
'((vertical-scroll-bars)
(top . 25)
(left . 45)
(width . 120)
(height . 40)
(background-color . "black")
(foreground-color . "grey")
(cursor-color . "gold1")
(mouse-color . "gold1")
(tool-bar-lines . 0)
(menu-bar-lines . 1)
(right-fringe)
(left-fringe)))
;;启动自动最大化(数据自己调整,注意格式,如(top . 0),圆点前后都要留有空格)
;;(setq initial-frame-alist '((top . 0) (left . 0) (width . 142) (height . 49)))
;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
(set-face-foreground 'highlight "white")
(set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
;;------------窗口界面设置结束-----------------
;;-------------方便编程操作设置----------------
;;把c语言风格设置为k&r风格
(add-hook 'c-mode-hook
'(lambda ()
(c-set-style "k&r")))
(autoload 'css-mode "css-mode" "CSS editing mode" t)
;;css-mode.el编辑css文件
(autoload 'htmlize-buffer "htmlize" "HTMLize mode" t)
;;把buffer的内容连同颜色转为html格式
(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))
(defun my-compile()
(interactive)
(save-some-buffers t)
(let((file(file-name-nondirectory buffer-file-name)))
(compile(format "g++ %s -g -o %s" file(file-name-sans-extension file))))
)
(global-linum-mode t)
(global-set-key [f9] 'my-compile)
(set-frame-parameter (selected-frame) 'alpha '(85 50))
(add-to-list 'default-frame-alist '(alpha (85 50)))
(defun 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 ( ) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(85 50) '(100 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)
(setq c-default-style
'((java-mode . "java")(other . "awk")))
;;------------方便编程操作设置结束--------------------
(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.
'(cua-mode t nil (cua-base)))
(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.
)
;;在标题栏显示buffer的名字(默认不显示)
(setq frame-title-format "%b@emacs")
;;显示匹配括号
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;全选
(global-set-key (kbd "C-a") 'mark-whole-buffer)
;滚动页面时比较舒服,不要整页的滚动
(setq scroll-step 1
scroll-margin 3
scroll-conservatively 10000)
;;4格缩进
(setq-default indent-tabs-mode nil) ; tab 改为插入空格
(setq c-basic-offset 4) ; c c++ 缩进4个空格
(setq c-default-style "linux"); 没有这个 { } 就会瞎搞
(setq default-tab-width 4)
;;其中最重要的一段:[F9]编译
(defun my-compile()
(interactive)
(save-some-buffers t)
(let((file(file-name-nondirectory buffer-file-name)))
(compile(format "g++ %s -g -o %s" file(file-name-sans-extension file))))
)
(global-linum-mode t)
(global-set-key [f9] 'my-compile)
我的emacs简易配置的更多相关文章
- emacs简易配置
(setq-default inhibit-startup-message t tab-width 4 c-basic-offset 4 indent-tabs-mode t) (tool-bar-m ...
- ubuntu14.04 下emacs 24 配置
目的: 配置emacs 24 适合编程开发 主要参考JerryZhang的配置(Emacs 简易教程) http://www.perfect-is-shit.com/emacs-simple-tuto ...
- Emacs简易教程
Emacs简易教程阅读: 命令: $emacs 进入之后,输入: C-h t 这里,C-h表示按住[Ctrl]键的同时按h ####### 20090620 *退出: 输入“C-x C-c” *撤销: ...
- LAMP的搭建与简易配置(apache,php已module方式结合)
测试所用环境:centos7.2 apache php 所在主机IP:9.110.187.120 mariadb 所在主机IP:9.110.187.121 第一部分:环境搭建 yum安装软件包 其中a ...
- NGINX按天生成日志文件的简易配置
NGINX按天生成日志文件的简易配置 0x01 最近后端童鞋遇到一个小需求,拆分nginx生成的log文件,最好是按天生成,看着她还有很多bug待改的状态,我说这个简单啊,我来吧.曾经搞node后端的 ...
- [daily][emacs][go] 配置emacs go-mode的编辑环境以及环境变量问题
1. 安装go 安装go-mode 使用emacs编辑go代码的时候,你需要有正常可运行的go环境. 并且有emacs的go-mode package https://www.emacswiki.or ...
- Emacs 安装配置使用教程
Emacs 安装配置使用教程 来源 https://www.jianshu.com/u/a27b97f900f7 序|Preface 先来一篇有趣的简介:Emacs和Vim:神的编辑器和编辑器之神 - ...
- php简易配置函数
nilcms中:php简易配置函数. 文件位置:nc-admin/common.php /* * --------------------------------------------------- ...
- Maven - settings.xml简易配置Demo
前言 这里贴一下settings.xml的一个简易配置demo,就是简单配置了:本地的仓库地址.阿里云镜像.指定使用jdk1.8进行编译. 这里使用的Maven是3.5.0版本的. 配置文件demo ...
随机推荐
- 在进行分布式框架搭建的过程中,出现问题advised by org.springframework.transaction.interceptor.TransactionInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)?
今天在进行宜立方商城,进行文件配置的时间,遇到如下的问题,问题是:advised by org.springframework.transaction.interceptor.TransactionI ...
- 【Linux 运维】Linux 目录
目录 [Linux 运维]Centos7初始化网络配置 [Linux 运维]linux系统修改主机名 [Linux 运维]linux系统关机.重启.注销命令 [Linux 运维]linux系统查看版本 ...
- 遗传算法中几种不同选择算子及Python实现
前言 本文对遗传算法中的几种选择策略进行了总结, 其中包括: Proportionate Roulette Wheel Selection Linear Ranking Selection Expon ...
- C语言的知识与能力予以自评
看到一个问卷不错,拟作为第三次作业的部分内容. 你对自己的未来有什么规划?做了哪些准备?答:多学习几门生存技巧,首先先学会碰壁. 你认为什么是学习?学习有什么用?现在学习动力如何?为什么?答:学习是人 ...
- Web站点性能-宏观手段
1,增加服务器配置,购买性能更强的服务器,cpu.增加内存.增加硬盘(换更大更好的硬盘): 2,修改优化程序: 1)增加缓存: 2)优化代码,优化sql: 3)分离静态资源和动态页面: 3,对服务承担 ...
- Sql server 中关闭ID自增字段(SQL取消ID自动增长)
sql server在导入数据的时候,有时候要考虑id不变,就要先取消自动增长再导入数据,导完后恢复自增. 比如网站改版从旧数据库导入新数据库,数据库结构不相同,可能会使用insert into xx ...
- OSG学习:使用OSG中预定义的几何体
常用的内嵌几何体包括: osg::Box //正方体 osg::Capsule //太空舱 osg::Cone //椎体 osg::Cylinder //柱体 osg::HeightField //高 ...
- JAVA第三次笔记
- p2 关节
P2中使用Constraint及其子类表示关节,也就是将两个刚体按照指定的规则约束在一起,形成有规律的.相互限制的运动模拟.P2关节模拟中,两个刚体没有通过任何刚体连接,只是通过算法模拟出关节运动轨迹 ...
- Building simple plug-ins system for ASP.NET Core(转)
Recently I built plug-ins support to my TemperatureStation IoT solution web site. The code for .NET ...