Emacs Tips and Tricks
I’m a Emacs newbie from Vim (I don’t give vim up and I use Evil in Emacs). After using Emacs for about two months, I find it is as powerful as Vim. Below are some tips and tricks I find very useful.
Format source code
C-x h to highlight the whole page and press
C-M-\ to format the whole buffer. Or you can use the
aggressive-indent package to do it automatically. Besides, I use AucTex to write $\LaTeX$. I usually press
C-c C-q C-s to reformat the whole buffer.
C-c C-p C-s to preview a region of your paper.
Jump out of the parentheses
Run or return
C-m is bound to
RET so it’s another way to hit RETURN (In another word, you can replace RET with it).
C-j is just RUN it. Let’s take an example. When you use IDO or Smex, they will automatically complete your input, you can press
C-j to stick into your input and reject the autocompletion. While
RET will run the autocompletion command.