Emacs for All, All for Emacs

*/-->

Emacs for All, All for Emacs

Table of Contents

  • 1. How to enable Chinese input in emacs?
  • 2. Is it possible to use version control tools like svn, git, cvs…?
  • 3. How do I make emacs recognize the version-controlled files?
  • 4. How to use latex in emacs?
  • 5. where can I get the configuration files of emacs?
  • 6. The most common command used in Linux eshell
  • 7. How to make fast switch between dual monitors?
  • 8. How to install another font to Ubuntu and Fedora?
  • 9. How to use tramp to make local emacs capable of editing remote files?
  • 10. Use multi-term mode in emacs for full-functioning terminal emulation.

It has been a long time since I began working with emacs, one of the greatest
editors in Linux systems. It is really hard for a beginner to learn how to use
it, especially for those who are addicted to the GUI, using emacs means that all
the work done by clicking the mouse before is replaced by the various key
strikes. I can still remember I had a difficult time adjusting to emacs, but It
turns out that the more I learn about emacs, the more I feel I need to learn.
Nearly all the work can be done under it (with the help of numerous plug-ins),
So, in this article, I will record my emacs configuration and the useful tools
I find during the past two years of using emacs. I do this because I want to
have an easy time next time when I re-install the OS, or I can easily set up
the familiar environment when I work with others somewhere not on my own
computer.

As always, I will take the Q&A form of writing styles, to make it clean and
simple, most of all, make it useful to not only myself but the vast majority
who are using emacs.

1 How to enable Chinese input in emacs?

2 Is it possible to use version control tools like svn, git, cvs…?

As long as you can think, there are always some ".el" files waiting for you
on the Internet, you can easily find them, and the good news is emacs enable
you use svn, cvs directly, it will automatically recognize the version-ed
files and you can use simple commands(key strikes) to update, commit and add
files to your repository.
The most often used commands of svn:

And the corresbonding key strokes:

3 How do I make emacs recognize the version-controlled files?

The only thing to do is to open these files with emacs:
For example:

svn co https:172.31.8.31:4430/svn/project

will checkout the files from a svn server, and emacs will recognize them automatically.

4 How to use latex in emacs?

5 where can I get the configuration files of emacs?

svn checkout http://emcs-bk.googlecode.com/svn/trunk/ emcs-bk-read-only

The above link is available, and can be checked out with svn.

6 The most common command used in Linux eshell

uncompress *.tar.bz2 file: tar -jxvf *.tar.bz2

7 How to make fast switch between dual monitors?

It is necessary to start a new frame in emacs so that the emacs will keep a
single input stream for all the frames.
The command to use is C-x 5 2, or File->New Frame.
After creating a new frame, bind the short key for switching the frame.

(global-set-key (kbd "M-RET") ‘other-frame)

8 How to install another font to Ubuntu and Fedora?

Recently, I learned about a programming-friendly font named M+, and I want
to use it in emacs, the following steps should be done to do this:

sudo apt-get install fonts-mplus (or yum install)

In .emacs file, add/modify the following line:

(set-default-font "M+ 2c 13")))

9 How to use tramp to make local emacs capable of editing remote files?

Open file in remote machine:

c-x c-f /ssh:[email protected]:~/work/somefile

When the files changed in remote directory, it is likely that emacs tramp will
not be able to stay synchronized with the latest change, that means, the
command c-x c-f will not find the newly added files or directories. In this
case, the ido auto-complete should be refreshed, using the following command:

"M-x ido-reread-directory"

10 Use multi-term mode in emacs for full-functioning terminal emulation.

The eshell tries to provide the simple operations of a standard shell like
bash, but it lacks some basic functions like input redirection, so I changed
the eshell to multi-term in my configure file.

  ;;目的是开一个shell的小buffer,用于更方便地测试程序(也就是运行程序了),我经常会用到。
;;f8就是另开一个buffer然后打开shell,C-f8则是在当前的buffer打开shell,shift+f8清空eshell
(defun open-eshell-other-buffer ()
  "Open eshell in other buffer"
  (interactive)
  (split-window-vertically)
  (eshell))
;;I changed the eshell to multi-term, because multi-term is much more functional than eshell
(defun open-term-other-buffer ()
  "Open eshell in other buffer"
  (interactive)
  (split-window-vertically)
  (multi-term))

Author: wujing

Created: 2014-10-18 六 11:09

Emacs 24.3.1 (Org mode 8.2.6)

Validate

时间: 2024-10-08 10:29:12

Emacs for All, All for Emacs的相关文章

emacs window版环境配置(设置默认的.emacs文件,指向自定义.emacs达到自定义home的目的)

1.下载解压包 下载地址  ,下载之后我是直接解压到E:\emacs中的,E:\emacs中就有bin,libexec…等文件; 2.点击bin中的addpm.exe文件进行安装emacs; 3.就会发现配置文件在C:\Users\电脑名\AppData\Roaming\.emacs,(可以打开emacs点击options  ,修改一些配置,然后点击save options)在最下面的会出现   “Wrote 文件路径” 这个路径就是emacs默认配置文件的目录); 4.在C:\Users\电脑

emacs使用本地emacs server模式打开远程文件

使用emacs的用户都知道,一般要打开远程机器上的文件要使用TrampMode模式,调用方式例如以下: C-x C-f /remotehost:filename RET (or /method:[email protected]:filename) 但,这样打开有点麻烦,你必要输入username和机器ip等 emacs提供了一种client/server的模式,当我们在本地打开一个emacs,能够将它作为server执行 然后,在本地机器的其它都方要用emacs的时候,如在terminal中要

Emacs下编译C++/C程序<转>

1.启动Emacs,在终端输入“emacs&”命令后回车(你也可以输入“emacs”命令,不过当你在使用Emacs的时候,当前终端 就不为你工作了:并且如果你熟练使用Emacs的话也可以输入“emacs -nw”命令以启动非X视窗下的Emacs),至于后面为什么要加一个“&”符,这是Linux里面的基本知识,加上“&”符1.启动Emacs,在终端输入“emacs&”命令后回车(你也可以输入“emacs”命令,不过当你在使用Emacs的时候,当前终端 就不为你工作了:并且如果

CentOS6.x之emacs安装配置编译

刚开始学习linux,干学没什么意思,想在linux下写写程序,了解到linux下使用较多的是emacs和vim,在youtobe上分别看了看这两个工具进行开发的视频,个人感觉emacs比较酷一点,所以选择了emacs. 闲话少说,下面写一下自己安装.配置.编译c++程序并运行的过程. 1.安装emacs 刚开始我选择了下载代码安装,make的时候总是出错,找不到解决方案. 后来直接yum -y -install emacs安装了.(安装之前要把emacs用到的一些依赖库安装好,建议使用root

在mac os x 下升级emacs

大概是09年的时候接触到emacs这个编辑器,当时我们c语言老师用的,他自信满满,而那时我是个vimer,所以每次看他按那么多组合键我就替他感觉手指头累啊. 再后来我用了几年vim写代码,再后来用了许多脚本语言,还有遇到一些问题vim无法解决的. 后来我在12年的时候开始尝试着用emacs. 刚开始确实很不好用,但是后来越来越喜欢emacs. 当然vim我还是在用.现在重新拾起他们两个.我的最爱.哈哈哈哈. 回到正题,emacs在mac os x 下版本太低了.<blockquote>liwe

Emacs教程(一)

http://www.cnblogs.com/robertzml/archive/2009/09/10/1564108.html前言的前言:本人也是初学Emacs,之前对Vim也只接触了一点,所以也谈不上对哪个更喜欢,也分不出哪个更好.写这个教程的目的一是方便自己更好的学习Emacs,二是没事找事.如果有专家路过还望多指点. 前言:大名鼎鼎的Emacs,传说中程序员的终极武器,已经跨越了文本编辑器,IDE的境界,可以替代操作系统GUI的东东.怀着一种膜拜的心情我决定开始学习Emacs,期望有一天

Linux中的.emacs文件

刚开始的时候在Windows下使用emacs,那个时候配置 .emacs文件直接去C盘里\Users\(username)\AppData\Roaming 路径下查找就可以了(最开始的时候可以打开emacs,然后在Options下随便选择个选项,再Save Options,就会自动创建 .emacs.d目录以及 .emacs文件!) 换到linux平台下(使用的是Ubuntu),安装好emacs后发现还是没有 .emacs文件,那怎么办呢?其实可以自己创建一个 .emacs文件就ok了(在-目录

在当前shell下运行emacs 出现 fontset &#39;tty&#39; does not exist.

在终端下执行以下命令进入,shell模式的 emacs,出现如下错误 $ emacs -nw error: Fontset `tty' does not exist 解决办法: 修改.emacs 中关于字体的设置. (defun s-font() (interactive) ;; font config for org table showing. (set-default-font "monospace-11") (dolist (charset '(kana han symbol

用Emacs写cnblogs-从此写blog变的很easy!

*/--> 用Emacs写cnblogs-从此写blog变的很easy! Table of Contents 1 需求说明 2 解决问题 3 结语 1 需求说明 在进入正题前还是先扯些废话吧!这Emacs还是大二的时候自己玩linux的时候,我的小学同学给我介绍的,第一次就教我安装,还把他的配置文件分享给我了,[虽然都是很简单的配置,俺这同学不太喜欢弄这些虚无的东西,可我就比较喜欢].Orgmode是大四的时候,自己找老师问关于Emacs的东西的时候,我的好好东老师给我推荐的,这才进入了orgm