Friday 28 November 2008

Useful Emacs Info

Useful Emacs Links:
  • Vi and Emacs

    NOT "Vi vs. Emacs" -- Despite twenty or thirty years of abuse thrown at each other by adherents of the Church of Vi vs the Church of Emacs, I feel the two editors are complementary, rather than antagonistic. They have a very different "look and feel", but that's not a real reason for choosing one over the other. They were designed for different jobs, they are better at different things, and I use both of them, depending on the job.

  • Is there any way to run console emacs inside KDE?

    You may not have emacs installed. When I run emacs in the console, I get emacs. I do not have xemacs installed, just emacs.

    You might check and see if you actually have emacs on the machine, To check, try "ls -l /usr/bin/emacs. If you have emacs installed you will find that "/usr/bin/emacs" is a link to "emacs-nox. It could also be that /usr/bin/emacs is linked to xemacs on your machine.

  • CS51 Guide to Emacs

    Emacs also integrates with GDB to allow you to look at your code while stepping through your program. To run GDB in Emacs, type M-X gdb , where is the name of your program. If you have a core file, you can open it with M-X gdb where is the name of your core file.

  • Common requests

  • Emacs Quick Reference

  • Modes R' Us

    Telling Emacs about Modes and Files

    To tell Emacs to go into a major mode based on a file's extension, place this in your "~/.emacs" file:

    (setq auto-mode-alist (cons '("\\.java$" . java-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.cxx$" . c++-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.hxx$" . c++-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.c$" . c-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.pl$" . perl-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.pm$" . perl-mode) auto-mode-alist))
    (setq auto-mode-alist (cons '("\\.txt$" . text-mode) auto-mode-alist))

  • Emacs Commands List
Useful Emacs Commands
  • To open a file:
    control-x, control-f

  • To close a file:
    control-x, k

  • To quit Emacs:
    control-x, control-c

  • To find out what colours Emacs can display:
    M-x list-colors-display

  • To enter the shell:
    M-x shell

  • To save a file:
    control-x, control-s

  • To compile:
    M-x compile

  • To run a program:
How do I quickly switch between files?

Use Control-x b, filename ENTER. You can also use tab completion.

How do I find a string in the current file?

Use Control-s, filename

How do I find a string across files?

No comments:

Post a Comment