当前时区 GMT+8, 现在时间是 2008-8-22 07:45
游客:
注册
登录
仅登录论坛
|
搜索
帮助
中国Linux公社论坛
»
应用编程技术与项目孵化
» emacs 写C程序问题,几个实用的function
‹‹ 上一主题
|
下一主题 ››
投票
交易
悬赏
活动
打印
|
推荐
|
订阅
|
收藏
标题: emacs 写C程序问题,几个实用的function
xxdragen
新手上路
UID 53450
精华 0
积分 5
帖子 6
阅读权限 10
注册 2003-7-30
来自 China
状态 离线
#1
发表于 2007-12-25 23:03
资料
短消息
加为好友
emacs 写C程序问题,几个实用的function
大家好,我用emacs写C程序,现在有几个问题:
1 如何高亮显示所有同名局部变量?
2 如果更改一个变量的名称(或者一个struct 里元素的名称),如何让所有的引用都同时更名?(这个好像对struct很困难)
3 怎么format一个C文件? (以前用Eclipse写Java程序的时候可以很简单的format一个Java文件,不知道对Emacs有没有类似的包)
我再贡献我自己配置里面的几个function,挺方便的,大家看看吧。有些我自己写的,但是因为我对Lisp并不是很熟,大家不要见笑。能用就好。
(defun insert-new-line-up ()
"Opens a new line before the current line. Equivalent to beginning-of-line, open-line"
(interactive) (beginning-of-line) (open-line 1) (indent-according-to-mode)
)
(global-set-key [(control shift return)] 'insert-new-line-up)
(defun insert-new-line-down()
"Opens a new line after the current line."
(interactive) (beginning-of-line 2) (open-line 1) (indent-according-to-mode)
)
(global-set-key [(control return)] 'insert-new-line-down)
;;++++++++++++++ scroll one line up and down ++++++++++++++
(defun scroll-up-one-line ()
(interactive)
(scroll-up 1))
(defun scroll-down-one-line ()
(interactive)
(scroll-down 1))
(global-set-key [(control down)] 'scroll-up-one-line)
(global-set-key [(control up)] 'scroll-down-one-line)
这个我忘了下载地址了,大家自己google一下吧。
;go to the last edit point.
(require 'goto-last-change)
(global-set-key [(meta left)] 'goto-last-change)
投票
交易
悬赏
活动
论坛跳转 ...
> 公告区
> 系统安装
> 硬件配置
> 共创 LINUX 专区
> 新华 LINUX 专区
> Magic Linux技术支持区
> Magic Linux开发培训版
> 中文化与桌面美化
> 桌面使用小技巧
> 命令行使用小技巧与SHELL编程
> 网络工具
> 办公软件
> 多媒体应用
> 游戏乐园
> 服务器与网络安全
> Linux资源共享区
> Debian/LFS/Gentoo专题版
> Linux高质量字体研究
> easyright计算机研究所
> Linux认证考试专题版
> 应用编程技术与项目孵化
> 网站开发技术与项目孵化
> 参与国际开源项目
> 翻译汉化
> 中文GNOME用户交流区
> Skyeye项目专栏
> lumit项目专栏
> eva项目专栏
> fanx项目专栏
> 连连看for Linux项目专栏
> OurLinux杂志专区
> BitStorm项目专栏
> AVS项目专栏
> VirgoFTP项目专栏
> EGui开源项目
> RT-Thread实时操作系统
> 内核源代码阅读交流
> 内核安装和升级
> 嵌入式开发
> 校园行动联盟
> Linux与公社文化杂谈
> 求职与招聘
> 公社接待中心
Powered by
Discuz!
5.5.0
© 2001-2007
Comsenz Inc.
TOP
清除 Cookies
-
联系我们
-
中国Linux公社
-
WAP