水木-emacs的FAQ

    技术2022-05-11  80

    水木-emacs的FAQ

    清华水木 null 〖 返回〗〖转发〗

    1、【 在 scaner (默默相随) 的大作中提到: 】 ∶ emacs不同于vi,按着向下,没有个底, ∶ 一保存,结果文件结尾是n个空行, ∶ 有什么命令能快速的删除这些空行吗? 可以让它有底 next-line-add-newlines =nil就行了.  -- ※ 修改:·costa 於 Jun 18 17:42:34 修改本文·[FROM: 166.111.136.199] ※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.136.199] 发信人: costa (老猫~continue), 信区: Linux        标  题: Re: emacs的一个问题 发信站: BBS 水木清华站 (Mon Jun 19 11:49:50 2000)  【 在 scaner (默默相随) 的大作中提到: 】 ∶ emacs不同于vi,按着向下,没有个底, ∶ 一保存,结果文件结尾是n个空行, ∶ 有什么命令能快速的删除这些空行吗? hehe,今天看了manpage,发现删除无数空白行: C-x,C-o  ===================================2/【 在 mydoggy (MSN★191-2232776) 的大作中提到: 】 ∶ 1 如何在emacs中设置C风格的自动缩进? ∶ 2 如何更改tab的长度? ∶ 3 如何改变x下emacs默认的字体和前、背景色? ∶ THX~~  编辑 ~/.emacs 加入 (defun my-c-mode-common-hook ()   ;; add my personal style and set it for the current buffer   (c-set-style "bsd")   ;; offset customizations not in my-c-style   (c-set-offset 'member-init-intro '++)   ;; other customizations   (setq tab-width 4         ;; this will make sure spaces are used instead of tabs         indent-tabs-mode nil)   ;; we like auto-newline and hungry-delete   (c-toggle-auto-hungry-state 1)   (font-lock-mode 2)   ;; keybindings for all supported languages.  We can put these in   ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,   ;; java-mode-map, and idl-mode-map inherit from it.   (define-key c-mode-base-map "C-m" 'newline-and-indent)   )  (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (setq auto-mode-alist (cons '(".C$" . c++-mode) auto-mode-alist))  (setq auto-mode-alist (cons '(".cc$" . c++-mode) auto-mode-alist))  (setq auto-mode-alist (cons '(".c$" . c++-mode) auto-mode-alist))  (setq auto-mode-alist (cons '(".h$" . c++-mode) auto-mode-alist))  (setq auto-mode-alist (cons '(".cpp$" . c++-mode) auto-mode-alist))  (setq auto-mode-alist (cons '(".cxx$" . c++-mode) auto-mode-alist)) 编辑 .Xdefaults 文件  emacs*Background: DarkSlateGray emacs*Foreground: Wheat emacs*pointerColor: Orchid emacs*cursorColor: Orchid emacs*bitmapIcon: on emacs*font: 8x16 emacs.geometry: 80x40 自己看着改吧, hehe==========================================================3、vi+ctags前面有文章讲过了 emacs+etags实际上是类似的, 先用etags为source tree生成TAGS文件 然后在emacs里面用M-.来查找函数及变量的定义  id-utils可以查到某个函数的调用情况, 先用mkid生成ID文件, 然后 gid xxx就行了. 如果在emscs里面, 可以使用id-utils带的lisp代码 来运行gid, 找到某个函数的所有引用情况后, 用C-x `就可以直接跳 到调用的地方 【 在 jeffzhys (Ricky) 的大作中提到: 】 ∶ 呵呵,具体讲讲如何使用的说   ==============================4、标  题: Re: 关于vim和emacs做为编程编辑器的优劣? 发信站: BBS 水木清华站 (Tue Sep 26 15:26:48 2000)  emacs下面用cvs只需要记住C-x q就行了. emacs就会按顺序执行check out和check in. 如果修改了文件的话, check in时会自动创建一个buffer让你写change log(C-c C-c就 可以继续check in) 还有vc-dired, ediff等等都是很好用的  【 在 smilerliu (终于把昵称换了) 的大作中提到: 】 ∶ 我觉得emacs就是把vi,gcc,make,gdb,rcs/cvs等拉到一起的集成环境. ∶ 不过我觉得它集成的并不太好,不如分开用来得灵活. ∶ 个人比较喜欢vi+gcc+make+gdb+cvs, 而不喜欢emacs那样不够灵活的集成环境.   =================================5、标  题: Re: 有好的编辑器 发信站: BBS 水木清华站 (Sat Apr 29 15:26:16 2000)  【 在 fkbch (无灵子@笨愚斋) 的大作中提到: 】 ∶ 我在console下用emacs的viper, 结果不知道meta成什么了(原来是alt) ∶ 谁知道?? ∶ 呵呵 我知道了, 在你的.emacs里面加上 (setq viper-mode t) (require 'viper) (if (null window-system)     (setq viper-no-multiple-ESC 'twice))  就可以在console下面如常用alt作为meta键了, 如果用X的话, viper-no-multiple-ESC 的值应该是t  具体可以看M-x customize-variable viper-no-multiple-ESC  =================================iamafan@linuxaid.com.cn

    责任编辑:知识库管理员(2001-01-03 16:20)

    最新回复(0)