How do I do this in Emacs?
In the video the guy was able to insert functions and classes by pressing some buttons开发者_JS百科. How do I set up my Emacs to do that? Did he just use auto insert mode or something?
You can try yasnippet, skeletons or several other template mechanisms for Emacs.
As suvayu indicated, the guy in that video is mostly using various template mechanisms in Emacs (this is actually not that impressive). If you want your mind to really be blown, have a look at Marco Barringer's SLIME video. In it, he demos how to use the Common Lisp SLIME mode in Emacs. Along the way, he shows how an expert Emacs user effectively utilizes Emacs to write code. First, just watch the movie. Then, if you want to know more details about what he's doing, read Peter Christensen's transcript of the movie (I wrote a blog entry just after the movie came out with comments from a number of good lisp programmers who had seen the movie). Once you've seen the movie and can understand what is happening in it, attempt to adopt some of the techniques demonstrated in that video using your preferred programming language.
You can also look onto SRecode module in CEDET package - it allows to implement context-sensitive templates (for example, some are available only inside class, etc.), and there are some for elisp, c++, java, etc.
精彩评论