emacs python自带的游戏都怎么玩?能够添加吗

博客访问: 586595
博文数量: 104
博客积分: 554
博客等级: 中士
技术积分: 2487
注册时间:
分类: LINUX 16:31:17
;; 修正windos emacs find-grep 输出NULL;; Prevent issues with the Windows null device (NUL);; when using cygwin find with rgrep.(if (equal system-type 'windows-nt)&&& (progn&&&&& (defadvice grep-compute-defaults (around grep-compute-defaults-advice-null-device)&&&&&&& "Use cygwin's /dev/null as the null-device."&&&&&&& (let ((null-device "/dev/null"))&&&&&&&&& ad-do-it))&&&&& (ad-activate 'grep-compute-defaults)));; 中英文字体配置;; monaco-11,YaHei-18 org-mode 表格不会乱,2个英文字宽 = 1个中文字宽(if (equal system-type 'windows-nt)&&& (progn&&& & (set-frame-font "Monaco-11")&&& & (dolist (charset '(kana han symbol cjk-misc bopomofo))&&& &&& (set-fontset-font (frame-parameter nil 'font)&&& &&& &&& &&& &&& &&& & charset&&& &&& &&& &&& &&& &&& & (font-spec :family "Microsoft Yahei" :size 18)))& ))(if (equal system-type 'gnu/linux)&&& (progn&&&&& (set-frame-font "Monaco-10")&&&&& (dolist (charset '(kana han symbol cjk-misc bopomofo))&&&&&&& (set-fontset-font (frame-parameter nil 'font)&&&&&&&&&&&&&&&&&&&&&&&&& charset&&&&&&&&&&&&&&&&&&&&&&&&& (font-spec :family "Microsoft Yahei" :size 16)))&&&&& )); 在emacs中执行make,gdb调试找不到交叉编译程序
;; add cross compile paht to emacs exec path
;; 添加交叉编译环境变量
(setenv "PATH" (concat "/usr/local/CodeSourcery/Sourcery_G++_Lite/bin/:" (getenv "PATH")))
(setq exec-path (cons "/usr/local/CodeSourcery/Sourcery_G++_Lite/bin/" exec-path))
;; 禁止emacs23.2内部自带的cedet
(setq load-path (remove "/usr/share/emacs/cedet" load-path))
(setq load-path (remove "/usr/share/emacs/23.2/lisp/cedet" load-path));;C-h v load-path 检查是否去掉emacs内置cedet
(require 'cedet)
;; (load-file "~/.emacs.d/plugins/cedet-1.0/common/cedet.el")
(require 'ecb)
(require 'semantic-ia)
;; 最基本功能
;; semantic-idle-scheduler-mode,enable这个mode让cedet在emacs空闲的时候自动分析buffer内容
;; semantic-minor-mode,semanticdb是semantic用来保存分析后的内容的,所以也是应该enable的
;; semanticdb-load-ebrowse-caches,Load all semanticdb controlled EBROWSE caches.
;; (semantic-load-enable-minimum-features)
;; imenu,imenu显示semantic分析出的类,函数等tags
;; semantic-idle-summary-mode,光标停留在一个类/函数等tag上时,会在minibuffer显示出这个函数原型
;; senator-minor-mode,在emacs上增加一个senator的菜单
;; semantic-mru-bookmark-mode 支持跳转
;; (semantic-load-enable-code-helpers)
;; (semantic-load-enable-code-helpers)
;; semantic-stickyfunc-mode
;; 这个mode会根据光标位置把当前函数名显示在buffer顶上
;; semantic-decoration-mode
;; 打开这个mode后,semantic会在类/函数等tag上方加一条蓝色的线,
;; 源文件很大的时候用它可以提示出哪些是类和函数的头。
;; semantic-idle-completions-mode
;; 这个mode打开后,光标在某处停留一段时间后,semantic会自动提示此处可以补全的内容。
;; (semantic-load-enable-guady-code-helpers)
(semantic-load-enable-guady-code-helpers)
(global-semantic-highlight-func-mode 1)
;; (global-semantic-idle-local-symbol-highlight-mode 1)
(global-semantic-show-parser-state-mode 1)
(global-semantic-idle-summary-mode 0)
;; semantic-highlight-func-mode
;; 打开这个mode的话,semantic会用灰的底色把光标所在函数名高亮显示,
;;global-semantic-idle-local-symbol-highlight-mode
;; 用过XCode或eclipse的人应该会喜欢高亮光标处变量的功能:就是在函数内部,光标停留在一个变量上,整个函数内部用这个变量的地方都高亮了。在 emacs里只要打开semantic-idle-tag-highlight-mode,光标在变量处停留一会,就会把相同的变量全都高亮
;; semantic-decoration-on-*-members
;; 把private和protected的函数用颜色标识出来
;; which-func-mode
;; 这个其实就是emacs自带的which-function-mode,把光标当前所在的函数名显示在mode-line上
;; (semantic-load-enable-excessive-code-helpers)
;; semantic-highlight-edits-mode
;; 打开这个mode后,emacs会把最近修改过的内容高亮出来
;; semantic-show-unmatched-syntax-mode
;; 这个mode会把semantic解析不了的内容用红色下划线标识出来
;; semantic-show-parser-state-mode
;; 打开这个mode,semantic会在modeline上显示出当前解析状态
;; 未解析时显示为”!”,正在解析时显示”@”,解析完后显示”-”,如果buffer修改后未重新解析显示为”^”
;; semantic会在空闲时自动解析,另外可以打开senator-minor-mode,按[C-c , ,]或者在senator菜单中选[Force Tag Refresh]强制它马上解析。
;; (semantic-load-enable-semantic-debugging-helpers)
;; (global-srecode-minor-mode 1)
(global-semantic-mru-bookmark-mode 1)
(require 'semantic-decorate-include)
;;semanticdb 设置
;; 优化tags功能有几个方法
;; 1.声明ede项目来限制semantic的搜索
;; 2.显式的声明所有项目根文件夹
;; 3.使用semanticdb-create-ebrowse or semantic-create-cscope-database
;; 创建databases为常用的文件夹(/usr/include,/usr/local/include,etc)
;; 4.自定义semanticdb-find-default-throttle变量为某个xx-mode
;; 例如c-mode时,不使用系统include file
;; (setq-mode-local c-mode semanticdb-find-default-throttle
;;&&&&&&&&&&&&&&&&&&&&&&&&&&&& '(project unloaded system recursive))
(require 'semanticdb)
(setq semanticdb-default-save-directory
&&&&&& (expand-file-name "~/.emacs.d/.semanticdb"))
;;设置 throttle,semantic按照指定的顺序查找头文件
(setq-mode-local c-mode
&&&&&&&&&&& semanticdb-find-default-throttle
&&&&&&&&&&& '(file local project unloaded system recursive))
;; 避免semantic占用CPU过多,单位second
(setq-default semantic-idle-scheduler-idle-time 600)
;; (setq semanticdb-search-system-databases t)
;; ;; 设置semanticdb的默认路径
;; (setq semanticdb-default-system-save-directory "~/.semanticdb")
;; project root path,检索/usr/include
;; (setq semanticdb-project-roots
;;&&&&&&&&&& (list
;;&&&&&&&& (expand-file-name "/")))
;; (semantic-load-enable-all-exuberent-ctags-support)
;; (semanticdb-enable-exuberent-ctags 'c-mode)
;; (semanticdb-enable-exuberent-ctags 'c++-mode)
;; if you want to enable support for gnu global
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;;;;C/C++语言启动时自动加载semantic对/usr/include的索引数据库,
;; (setq semanticdb-search-system-databases t)
;;&&& (add-hook 'c-mode-common-hook&&&&&&&&&&&&&&&&&&&&&&&&& ;;&&&&&&&&&&& (lambda ()&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;;&&&&&&&&&&&&& (setq semanticdb-project-system-databases&&& ;;&&&&&&&&&&&&&&&&&&& (list (semanticdb-create-database&&&&& ;;&&&&&&&&&&&&&&&&&&&&&&&&&&&& semanticdb-new-database-class
;;&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include")))))&&&&&&&&&&
;; Include settings, cedet能找系统头文件到并跳转到头文件
;; M-x semantic-c-describe-environment 查看当前系统c头文件路径
(require 'semantic-gcc)
(setq semanticdb-project-roots (list (expand-file-name "/")))
;; 很多工程中都会把头文件和实现文件分开放置,比如头文件放在include(或者inc,public,common等)目录中,
;; 实现文件放在src目录中,这些目录semantic是不能自己找的,解决方法
(defconst cedet-user-include-dirs
& (list ".." "../include" "../inc" "../common" "../public" "." "./include"
&&&&&&& "../.." "../../include" "../../inc" "../../common" "../../public"))
;; C-h v semantic-dependency-system-include-path : defines the system include path
;; C-h v semantic-c-dependency-system-include-path:system include path used by the C language.
(defconst cedet-sys-include-dirs
& (list&&&&&&& "/usr/include/c++/4.4"
&&&&&&&&&&&&&& "/usr/include/c++/4.4/i486-linux-gnu"
&&&&&&&&&&&&&& "/usr/include/c++/4.4/backward"
&&&&&&&&&&&&&& "/usr/local/include"
&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include"
&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed"
&&&&&&&&&&&&&& "/usr/include"))
;; semantic-add-system-include 根据mode把路径加入到semantic-dependency-system-include-path里
(let ((include-dirs cedet-user-include-dirs))
& (when (eq system-type 'gnu/linux)
&&& (setq include-dirs (append include-dirs cedet-sys-include-dirs)))
& (mapc (lambda (dir)
&&&&&&&&& (semantic-add-system-include dir 'c++-mode)
&&&&&&&&& (semantic-add-system-include dir 'c-mode))
&&&&&&& include-dirs))
(setq semantic-c-dependency-system-include-path
&&&&& (list
&&&&&&&&&&&&&& "/usr/include/c++/4.4"
&&&&&&&&&&&&&& "/usr/include/c++/4.4/i486-linux-gnu"
&&&&&&&&&&&&&& "/usr/include/c++/4.4/backward"
&&&&&&&&&&&&&& "/usr/local/include"
&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include"
&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed"
&&&&&&&&&&&&&& "/usr/include"))
(setq cedet-sys-include-dirs (list
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/c++/4.4"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/c++/4.4/i486-linux-gnu"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/c++/4.4/backward"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/local/include"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/bits"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/glib-2.0"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/gnu"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/gtk-2.0"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/gtk-2.0/gdk-pixbuf"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/gtk-2.0/gtk"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/local/include"
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/local/include"))
;; 如果semantic不能正确解析系统头文件,可尝试下面两种方法
;; 1.(add-to-list 'semantic-lex-c-preprocessor-symbol-file "/home/foo/project/a.h"),semantic正确解析某些特殊的宏
;; 2.(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("SOMESYMBOL" . "")),semantic忽略掉某些特殊的宏
;; M-x semantic-analyze-current-context 检查semantic解析是否正确
;; semantic把解析的内容分为variable,function, include
;; 定义的宏和变量被归为varialble,函数归为fucntion, include归为include
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__wur" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file& "/usr/lib/gcc/i486-linux-gnu/4.4.5/include")
(add-to-list 'semantic-lex-c-preprocessor-symbol-file& "/usr/include/sys/cdefs.h")
(defconst cedet-win32-include-dirs
& (list "D:/TDMMinGW/include"
&&&&&&& "D:/TDMMinGW/lib/gcc/mingw32/4.3.3/include/c++/backward"
&&&&&&& "D:/TDMMinGW/lib/gcc/mingw32/4.3.3/include/c++/mingw32"
&&&&&&& "D:/TDMMinGW/lib/gcc/mingw32/4.3.3/include/c++"
&&&&&&& "D:/TDMMinGW/lib/gcc/mingw32/4.3.3/include"
&&&&&&& "D:/TDMMinGW/lib/gcc/mingw32/4.3.3"
;;&&&&&&& "C:/Program Files/Microsoft Visual Studio/VC98/MFC/Include"
&&&&&&& ))
(require 'semantic-c nil 'noerror)
(let ((include-dirs cedet-user-include-dirs))
& (when (eq system-type 'windows-nt)
&&& (setq include-dirs (append include-dirs cedet-win32-include-dirs)))
& (mapc (lambda (dir)
&&&&&&&&& (semantic-add-system-include dir 'c++-mode)
&&&&&&&&& (semantic-add-system-include dir 'c-mode))
&&&&&&& include-dirs))
(setq ecb-tip-of-the-day nil)
(add-hook 'texinfo-mode-hook (lambda () (require 'sb-texinfo)))
;; Integration with imenu with a list of functions, variables, and other tags.
;; (autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
;; (autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
;; (define-key-after (lookup-key global-map [menu-bar tools])
;;&& [speedbar]
;;&& '("Speedbar" .
;;&&&& speedbar-frame-mode)
;;&& [calendar])
(setq ecb-auto-activate nil
&&&&& ecb-tip-of-the-day nil
&&&&& ecb-tree-indent 4
&&&&& ecb-windows-height 0.5
&&&&& ecb-windows-width 0.13)
(if (eq system-type 'windows-nt)
&&& (progn
&&& '(ecb-gzip-setup (quote ("d:\\cygwin\\bin\\gzip.exe" . windows)))
&&& '(ecb-wget-setup (quote ("d:\\cygwin\\bin\\wget.exe" . windows)))
&&& '(ecb-tar-setup (quote ("d:\\cygwin\\bin\\tar.exe" . windows)))))
;; solve problem "Variable binding depth exceeds max-specpdl-size",
;; default value is 1080
(setq max-specpdl-size 34000)
(setq max-lisp-eval-depth 20000)
;; semantic auto complete
(semantic-load-enable-code-helpers)
(autoload 'senator-try-expand-semantic "senator")
;; (global-set-key (kbd "M-/") 'semantic-ia-complete-symbol-menu)
(global-set-key (kbd "M-/") 'semantic-ia-complete-symbol)
(eval-after-load "semantic-complete"
& '(setq semantic-complete-inline-analyzer-displayor-class
&&&&&&&& semantic-displayor-ghost))
; enable ctags for some languages:
;;& Unix Shell, Perl, Pascal, Tcl, Fortran, Asm
;; (setq semantic-ectag-program "~/bin/ctags.exe")
(semantic-load-enable-primary-exuberent-ctags-support)
(defun cedet-hook ()
& (local-set-key "\C-cs" 'semantic-ia-show-summary)
& (local-set-key "\C-cr" 'semantic-symref-symbol))
(add-hook 'c-mode-common-hook 'cedet-hook)
(add-hook 'lisp-mode-hook 'cedet-hook)
;; (add-hook 'scheme-mode-hook 'cedet-hook)
;; (add-hook 'emacs-lisp-mode-hook 'cedet-hook)
(add-hook 'python-mode-hook 'cedet-hook)
(global-set-key (kbd "C-.") 'semantic-ia-fast-jump)
(global-set-key (kbd "C-,") 'semantic-mrub-switch-tags)
;; (defun my-c-mode-cedet-hook ()
;;& (local-set-key "." 'semantic-complete-self-insert)
;;& (local-set-key ">" 'semantic-complete-self-insert))
;; (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
(global-set-key (kbd "") 'ecb-activate)
(global-set-key (kbd "ESC ") 'ecb-deactivate)
;; (custom-set-variables
;;&& ;;设置系统包含路径
;;& '(semantic-c-dependency-system-include-path (quote ("/usr/include" "/usr/include/gtk-2.0" "/usr/include/glib-2.0"))))
;; (setq qt4-base-dir "/usr/include/qt4")&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;;
;; (semantic-add-system-include qt4-base-dir 'c++-mode)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;;
;; (add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode))&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;;
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig.h"))&&&&&&&& ;;
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig-dist.h")) ;;
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qglobal.h"))&&&&&&&& ;;
;; ede customization
(require 'semantic-lex-spp)
(global-ede-mode 1)
(setq ede-locate-setup-options
&&&&& '(ede-locate-global
&&&&&&& ede-locate-base))
;;2. 全局关闭cedet #if #else 智能分析
(setq semantic-c-obey-conditional-section-parsing-flag nil)
;; (setq test-project
;;&&&&&& (ede-cpp-root-project "test"
;;&&&&&&&&&&&&&&&&&&&&&&&&&&&& :file "~/test/Makefile"
;;&&&&&&&&&&&&&&&&&&&&&&&&&&&& :system-include-path '("/test/include"
;;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "/usr/include/boost-1.42")))
;; ede-cpp-root-project指定了这个项目的其他信息:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;; :file 指向项目主目录下任一一个存在的文件&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;; :include-path 指定头文件的所在目录&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;; :spp-table 给出了预处理时的使用的宏,通常是在Makefile里使用-DXXX定义的宏,例如这里的__XEN__。 ;;
;; 代码折叠用
(require 'semantic-tag-folding nil 'noerror)
(global-semantic-tag-folding-mode 1)
阅读(4972) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
请登录后评论。mac自带的Emacs怎么删除_百度知道
mac自带的Emacs怎么删除
答题抽奖
首次认真答题后
即可获得3次抽奖机会,100%中奖。
  1、苹果笔记本默认使用的是MACOS系统,系统自带国际象棋游戏。当然,现在许多主流游戏都支持MAC系统平台,比如说星际争霸  2、魔兽争霸、暗黑破坏神  3、魔兽世界等。  2、需要说明的是,苹果的Mac系统内有应用商店
为您推荐:
其他类似问题
emacs的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。Free as in Freedom
Emacs入门指南(2)
  前面已经介绍了如何打开、保存文件,这一次我们将先介绍如何在文档中移动光标(光标在Emacs术语中表示为Point)。  你固然可以在Emacs中用习惯的光标移动键来移动光标,但这不符合Emacs“手不离主键盘”的设计理念,所以它设计了令类的光标移动方法。  最简单的移动当然就是上下左右了,对应的键是C-p, C-n, C-b, C-f,为了方便记忆,请记住pnbf是previous line、next line、backward和forward的缩写,请试着多按几次,练习一下,确保熟练。  其次就是翻页了,通常您可以用&PageDown&和&PageUp&,但Emacs的快捷键是C-v和M-v,注意这里又有一个新的表示法了,M-v,它表示按着&META&键不放,再按v键。什么是&META&键?呵呵,对大多数PC机键盘而言&META&键就是&ALT&键。您可以打开一篇长一点的文章试试,可以按C-h t打开Emacs的Tutorial来练习,不用担心不小心把它改乱了,您打开的Turtoial只是一个副本,即使改坏了存了盘,下次打开也是一个全新的没改坏的版本。  C-a和C-e可以分别把光标移动行首和行末,相当于&Home&和&End&。  如果把上面的部分命令的的Ctrl键换成Alt键,它们的功能就会发生变化:M-b,M-f,M-a,M-e分别表示前移一个单词,后移一个单词,移动到当前句子首字符和移动到当前句子最后一个字符。可以这样记忆,Ctrl键用于“物理”移动光标,以行列为单位,Alt移用于“逻辑”移动光标,以词、句子等丰富意义的单位来移动。  如果要一次移动若干个单位,可以给命令加上数值参数,通过C-u命令,如:C-u 8 C-n就表示往下移8行,C-u 10 M-e表示往后移10句。不过C-u的参数对C-v和M-v命令而言有特殊,它不表示上下翻多少页,而是表示上下滚动多少行。注意与C-n的区别,C-u 8 C-n表示光标下移8行,屏幕不一定会滚动,而C-u 8 C-v,表示屏幕滚动8行,如果光标没有滚到屏幕外的话,光标位置不变。  前面讲了用C-g可以中断当前的命令,这次再补充一点,有时候C-g不灵时,可以按三次&Esc&键达到相同的目的。  再介绍两个常用的但不太好操作的命令,M-&和M-&,由于通常&和&符号分别在,和.的上面,所以实际操作时要按Alt+Shift+,和Alt+Shift+.,这两个命令分别用于移动光标到文件开始和结束的位置。  学习了不少东西,轻松一下,可以玩一下Emacs中自带的一些游戏,它们都可以在Tools菜单的Games中找到,如果你知道游戏的名称的话可以直接用命令来调用,先按下M-x,然后就可以输入任何合法的命令,如要玩贪吃蛇就可以输入snake命令。其实,Emacs的所有操作都有对应的命令名称,包括上面和即将介绍的各种快捷键,比如C-x C-s保存文件,对应的命令就是save-buffer,您完全可以键入M-x,然后输入save-buffer来执行与按C-x C-s完全相同的功能,这在忘记了快捷键的情况下十分有用。同样的,如果您记得快捷键却不知道对应的命令名,可以通过按动C-h C-k再按动相应的快捷键来查阅相关的帮助。记住,Emacs的帮助是十分详尽的,我打印了一本Emacs的手册,总共500多页,覆盖了Emacs操作的每一个细节。  下面我们要初步介绍一下如果完成类似于Windows中的撤消、剪切、复制、粘贴操作。  撤消是最简单的,快捷键是C-_,同样,由于_符号在上档位,所以要按Shift键操作,如果你觉得这样不方便,可以用C-x u,功能是一样的。同样你可以在C-_前用C-u加上一个数字参数以便一次撤消多步操作。  要在Emacs中选择一块区域,可以把光标移到区域的开始或结束位置,按下C-&SPC&或C-@(前者在Windows中可能会被切换输入法占用,所以只能用后者,同理不要忘记按Shift键,以后不再提醒),这时Emacs会提示Mark set,然后把光标移到结束位置即可。正常情况下屏幕上不会有任何反映标识说设置了一个区域。但确实这块区域已经选中了。  这时,按动C-w就可以把选中的区域kill掉,相当于我们在Windows中的剪切操作,在Emacs中Delete和Kill这两个词是有不同含义的,前者往往是指删除了,只能通过撤消操作来恢复,而后者则相当于是剪切了,可以通过一定的方法来恢复(Yank)。另外,Emacs中的剪切与传统的Windows不同,比较像新版的Office剪贴板,可以存放多次复制或剪切的东西。  要恢复最后一次Kill的内容,可以按C-y,多次按动它可以多次Yank最后一次Kill的内容,相当于在Windows中多次贴粘了一样。如果要Yank前几次Kill的内容,可以反复按M-y键。  要实现与Windows中复制相同的功能,可以在选定区域后按M-w键,它会把选定的内容放入Kill-Ring以便以后Yank但不会把选定的内容真正Kill掉。  有了以上的内容,您基本上已经可以把Emacs当作跟Windows Notepad差不多的工具来用了,更高级的功能,我们会在后面继续讲述。
没有更多推荐了,}

我要回帖

更多关于 vim和emacs 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信