background preloader

Xah Emacs Tutorial

Xah Emacs Tutorial
nothing This emacs tutorial is designed for programers & scientists who wish to learn emacs to get things done quickly, without spending a lot time on Emacs's special terminologies & methods. For programers, knowing emacs benefits you for life. Use the search box at top to find things. Quick Tips Working with Files the church of emacs filling, of chars lispy and binding, buffers insert yank, meta sexp add-hook, Eight M-bites And C. Find & Replace Tab, Indentation, Whitespace Editing Tricks Common Tasks Using shell #! Working with HTML Emacs Keys ⌨ Productivity Editing Convenience Setting Up Emacs Init Customization Settings Build Emacs, New Features Useful Packages Misc Emacs Lisp Tutorial Keybinding, Keyboard, Emacs Pinky Emacs Modernization Emacs Related Essays Emacs Images Thumbnails Index Buy Xah Emacs & Emacs Lisp Tutorial About the author, Acknowledgement

EmacsWiki: 網站地圖 Emacs Less-known Tips nothing Buy Xah Emacs Tutorial. Master emacs benefits for life. This page shows some less known emacs tips. Before continuing, here are 4 commands every serious emacs users have memorized by heart. To find the command name of a keybinding, call command describe-key 【F1 k】.To find the keybinding of a command, call describe-function 【F1 f】. Editing Related Interactive Search How to search the last searched string? Type 【Ctrl+s Ctrl+s】 to search the same word searched last time. How to search the string under cursor without typing it? Type 【Ctrl+s Ctrl+w】 to search the word under the cursor. 〔➤ Emacs: Search & Highlight Words〕 Grep Lines How to sort lines? Select a region first, then call sort-lines. To sort lines by a specific column, use sort-fields or sort-numeric-fields. For example: Type 【Ctrl+u】, then 2, then 【Alt+x sort-numeric-fields】. Other I have a set of different texts i want to paste frequently. 〔➤ Emacs: Using Registers (Multiple Clipboards)〕 Misc Many ways. How to start a second shell?

开源世界旅行手册 开源世界旅行手册 版权 © 2009 Kardinal 目录 授权致谢序言 更新纪录导读如何写作科技文档I. 1. II. 13. III. 30. IV. 45. 范例清单 14.1. urxvt 配置 ~/.Xresources20.1. Emacs Keymap for Launching External Applications and Websites 05 Oct 2014, by Artur Malabarba. The launcher-map wouldn’t be half of what it is if not for the run macro. With it, we can easily turn Emacs into a quick ’n dirty app launcher. (defmacro run (exec) "Return a function that runs the executable EXEC." We could use a lambda instead of the macro, but the macro defines a nicely documented function. While we’re at it, let’s do something similar for websites. (defmacro browse (url) "Return a function that calls `browse-url' on URL."

A guided tour of Emacs A Guided Tour of Emacs The GNU Emacs Manual calls Emacs the extensible, customizable, self-documenting real-time display editor, but this description tells beginners little about what Emacs is capable of. To give you an idea, here is a sampling of the things you can do with Emacs: Beyond just being able to edit plain text files, Emacs includes special features to help you write in many different human languages and programming/markup languages: …as well as tools for compiling, running, and testing programs. Emacs integrates with GDB to provide an IDE (M-x gdb): Emacs can compare two files and highlight their differences (M-x ediff): Emacs is a file manager (M-x dired): Emacs can read news, mail, and RSS feeds (M-x gnus): You can even play tetris in Emacs (M-x tetris): You might see now why some people consider Emacs to be not merely a text editor but almost a complete operating system. Why Emacs? Emacs is also portable. Before we get started… Occasionally I'll say something like this: Mark Region

Clojure and Emacs without Cider I've been hacking Clojure for many years now, and I've been happy to rekindle my love for Emacs. The Clojure/Emacs tool-chain has come a long way during this time, swank-clojure, nREPL, nrepl.el and now Cider. The feature list is ever growing, and every-time you look there are some new awesome shortcut that will 'make your day'. However, the last couple of months have been rough for the Cider project. I've experienced lots of instability, crashes and hanged UIs. Cider has become very complex and is starting to feel bloated. In this post I'll describe a simpler Emacs/Clojure setup that I've been using for the last couple of weeks. It's based on Emacs standard way to talk to Lisp REPLs, inferior-lisp-mode. The setup consists of the following emacs modes (all available on Melpa); init.el Here's some relevant snippets from my init.el, the full file can be found here; A repl session with this setup I typically start with loading the project.clj file of the project I want to work on.

将emacs中高亮化之后的文档存为html格式 方法: 下载htmlize.el 修改.emacs文件,添加 (require 'htmlize) 执行: M-x htmlize-buffer 就可以由当前已语法高亮化的文档生成相应的html格式文档。 经常要贴自己的代码给别人看,自然,就非常希望让别人看到自己在Emacs中精心配置好的颜色、代码风格,以便于阅读、理解代码。不过,这似乎有点难度。现在好了,用上htmlize.el这个扩展,就可以把代码当前的颜色、代码风格,直接转化为html页面。这样,别人看起来会舒服很多,当别人认为你的代码有用的时候,再叫你拿txt文件也不迟。 可以先看看作者的例子,htmlize.el.html就是htmlize.el的彩色显示,这样,可读性是不是比纯文本的htmlize.el强多了? 把htmlize.el扔到你的path里,并在.emacs里加入以下语句即可: ;; set htmlize(require ‘htmlize) 这个扩展可以有如下几种使用方法: 1) M-x htmlize-buffer把当前的buffer转为一个html文件,并保留当前你Emacs的色彩定义。 2) M-x htmlize-file这个命令会在mini-buffer里提示输入你需要转换的文件,自动帮你转换好,并保存为.html。 3) M-x htmlize-many-files这个命令和2)差不多的功能,不过可以让你同时转一批文件。 4) M-x htmlize-many-files-dired这个命令可以把你标记好的目录下的所以文件都转成html。

Global key bindings in Emacs (Shallow Thoughts) Global key bindings in emacs. What's hard about that, right? Just something simple like (global-set-key "\C-m" 'newline-and-indent) and you're all set. Well, no. global-set-key gives you a nice key binding that works ... until the next time you load a mode that wants to redefine that key binding out from under you. For many years I've had a huge collection of mode hooks that run when specific modes load. (defun reset-revert-buffer () (define-key python-mode-map "\C-c\C-r" 'revert-buffer) ) (setq python-mode-hook 'reset-revert-buffer) That worked fine -- but you have to do it for every mode that overrides key bindings and every binding that gets overridden. A web search quickly led me to the StackOverflow discussion Globally override key bindings. It took a lot of help from the kind folks on #emacs, but after an hour or so they finally found the key: emulation-mode-map-alists. Okay, here's what it means. Now define a minor mode that will use that keymap. There's one final step. Whew!

emacs 零碎1_纯灰 Emacs * sudo 打开高权限文件C-x C-f /root@localhost:PATH 或者:C-X C-F(如果在ido模式下再按一次 C-F) /sudo::/etc/samba/smb.conf 就会提示输入密码。 也可以如此:emacs配置文件里加入(defun wl-sudo-find-file (file dir)(find-file (concat "/sudo:localhost:" (expand-file-name file dir)))) 然后在.bashrc里加入function sudoec() { emacsclient -a "" -nc -e "(wl-sudo-find-file \"$1\" \"$PWD\")" ;}function sudoet() { emacsclient -a "" -t -e "(wl-sudo-find-file \"$1\" \"$PWD\")" ;} 执行source ~/.bashrc后就可以直接使用sudoec或者sudoet打开高权限文件了。 * 增大字体缩小字体shift + 左键* 字体直接在菜单里选即可 win 下 consolas+雅黑 (setq default-frame-alist(append'((font . ! Emacs.Fontset-1:-adobe-courier-medium-r-*-*-10-*-*-*-*-*-fontset-kai,\chinese-gb2312:-*-simkai-medium-r-*--16-*-*-*-*-*-gbk-0,\mule-unicode-0100-24ff:-misc-fixed-medium-r-normal--16-*-*-*-*-*-iso10646-1 Emacs.Fontset-2:-adobe-courier-medium-r-*-*-10-*-*-*-*-*-fontset-hei,\chinese-gb2312:-*-simhei-medium-r-*--16-*-*-*-*-*-gbk-0,\mule-unicode-0100-24ff:-misc-fixed-medium-r-normal--16-*-*-*-*-*-iso10646-1 问题解决了,这个feature叫做block agenda: 方法1. 5.

Related: