我的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-parameternil '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 1scroll-margin 3scroll-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 ...
随机推荐
- leetcode27_C++Remove Element
给定一个数组 nums 和一个值 val,你需要原地移除所有数值等于 val 的元素,返回移除后数组的新长度. 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成 ...
- 华为笔试——C++转换字符串问题
题目:转换字符串 题目介绍: 将输入字符串中下标为偶数的字符连成一个新的字符串输出,需要注意两点: 1. 如果输入字符串的长度超过20,则转换失败,返回“ERROR!”字符串: 2. 输入字符串只能由 ...
- rest_framework组件
认证组件 局部认证 在需要认证的视图类里加上authentication_classes = [认证组件1类名,认证组件2类名....] 示例如下: seralizers.py from rest_f ...
- Beta发布——视频博客
1.视频链接 视频上传至优酷自频道,地址链接:http://v.youku.com/v_show/id_XMzkzNzAxNDk2OA==.html?spm=a2hzp.8244740.0.0 2.视 ...
- scrum立会报告+燃尽图(第三周第一次)
此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2284 项目地址:https://coding.net/u/wuyy694 ...
- U盘安装OSX
1.插入U盘,磁盘工具,格式化U盘为Mac OS X拓展 (日志式): 2.去网站搜索recovery disk assistant,此文件大约1.1M,直接打开使用它制作启动盘,进度条完毕就完成了. ...
- HDU 5234 Happy birthday 01背包
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5234 bc:http://bestcoder.hdu.edu.cn/contests/con ...
- HDU 5661 Claris and XOR 贪心
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5661 bc(中文):http://bestcoder.hdu.edu.cn/contests ...
- 读 《我是一只IT小小鸟》 有感
在没有上大学之前,我很迷茫自己将来要从事什么行业.有人说,人生的每一个阶段都应该有自己的目标,然而,我上大学之前,甚至大一下学期之前,我对于我今后的从业道路,人生规划,都是迷茫的.高考结束成绩出来后, ...
- IIS 7.0 的 ASP.NET 应用程序生命周期概述
文章:IIS 7.0 的 ASP.NET 应用程序生命周期概述 地址:https://msdn.microsoft.com/zh-cn/library/bb470252(v=vs.100).aspx ...