zoukankan      html  css  js  c++  java
  • Emacs for All, All for Emacs

    Emacs for All, All for Emacs

    Emacs for All, All for Emacs

    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:
    https://images0.cnblogs.com/blog/598435/201410/181109070444289.jpg

    And the corresbonding key strokes:
    https://images0.cnblogs.com/blog/598435/201410/181109078739402.jpg

    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:wujing@172.20.161.27:~/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

  • 相关阅读:
    event loop笔记
    webpack不同devtools打包对比
    windows 7系统搭建本地SVN服务器的过程
    Eclipse安装SVN插件
    总结eclipse中安装maven插件
    myeclipse building workspace如何禁止及提高myeclipse速度
    基于SAML的单点登录介绍
    使用 CAS 在 Tomcat 中实现单点登录
    SSO之CAS备忘
    Maven环境变量配置
  • 原文地址:https://www.cnblogs.com/wujingcqu/p/4032740.html
Copyright © 2011-2022 走看看