Emacs shortcut to go to a specific line in a file

M-g g or M-g M-g are the default bindings for goto-line. And, the easiest way to find this is either M-x where-is RET goto-line RET which will list the bindings for the command goto-line, or you can type C-h b which lists all the bindings for the current buffer (and then you can peruse the bindings to see if goto-line is there, or to discover other … Read more

How to copy/select a whole file or buffer in Emacs?

C-x h will select the entire buffer. You can search for help within Emacs using the built-in help system. C-h f will look for help for specific functions. In this case, you could have searched for whole-buffer to find mark-whole-buffer. Other help commands of interest would be: C-h m to show available commands for the current modes C-h v for help related … Read more

How do I make Emacs auto-indent my C code?

Have a look at emacswiki – autoindent As suggested there, put following code in your .emacs You can customize the variable C Default Styl. In your emacs go to Options->Customize Emacs->Specific Option, then type c-default-style and set to your choice. By doing this, you don’t need to hit TAB. Type from start of the line … Read more