What are programmable shortcuts in emacs?

I would like to know what all the shortcuts useful to the programmer that exist in emacs.
I come from the netbeans background and I try to make myself comfortable using the emacs -text environment. Therefore, I am looking for shortcuts for "refactoring" code, "autocompletion", "go to definition", etc.

How can all this be achieved in emacs? What are other shortcuts useful to a programmer?

I will use emacs mainly for LAMP, javascript, C, C ++.

ps - you can safely assume that I know how to open a file, save a file, move around and everything that is in the emacs tutorial.

+7
source share
4 answers

For completion, use etags with Mx tags-search or Mx etags-select-find-tag . I often use macros to perform repetitive tasks. Cx ( <string of useful tasks> Cx ) . Also, Mx align-regexp to decorate the code and make it more readable.

You should find most of the most commonly used features by Emacs users. This question is answered here at Stackoverflow.

+5
source

Mark this site

Some important keywords that are not in the tutorial are as follows:

Previous matching parenthesis: CMb (if it doesn't work, try ESC and then Cb)

Next matching bracket: CMf (or ESC Cf)

Go to the beginning of the block: CMu

Go to end of block: CMd

Start Function: CMa

End of function: CMe

Contour mode: Cu 1 Cx $ (Cx $ to return)

Newspaper mode: Cx 3 Mx postoperative (especially useful today for widescreen monitors!)

Vertical copy

Sometimes you need to copy a vertical data patch, for example. one column in the table. First press C, where you want to start copying. Then go to the end of the column and press Cx r k. To insert a column, press Cx r y. (If you do not want to delete the original column, just press C-_ there once to restore it, and then press Cx ry on the target.)

+3
source

To get started, here is one of them:

  • Meta - / β†’ Does the code complete
+2
source

Mx diff-buffer-with-file

Mx revert-buffer

When working with versions (I use git), Mx diff-buffer-with-file is really useful. When you open a file in a buffer in emacs, you do a git check or some other action regarding that file, emacs will complain about you when you try to edit the buffer. Mx diff-buffer-with-file is useful to find out if you can break something by storing something in the buffer. If something has changed and you want to grab the file from disk and put it in the buffer, do Mx revert-buffer .

+1
source

All Articles