Using Emacs as an IDE

后端 未结 18 1835
清酒与你
清酒与你 2020-11-29 14:29

Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into

18条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 15:15

    For version control, there are several things that you can use, depending on what version control system you use. But some of the functionality is common to all of them.

    vc.el is the built-in way to handle version control at a file level. It has backends for most version control systems. For instance, the Subversion backend comes with Emacs, and there are git backends and others available from other sources.

    The most useful command is C-x v v (vc-next-action) that does the appropriate next action for the file you are visiting. This might mean updating from the repository or commiting your changes, vc.el also rebinds C-x C-q to check in and out files if you are using a system that needs it (like RCS).

    Other very useful commands are C-x v l and C-x v = that show you the log and current diff for the file you are using.

    But for real productivity, you should avoid using the single-file vc.el commands other than for simple things. There are several packages that can give you an overview of the status of your whole tree, and give you more power, and not to mention the ability to create coherent commits spanning several files.

    Most of these are heavily influenced or based on the original pcl-cvs/pcvs for CVS. There are even two of them that comes with subversion, psvn.el and dsvn.el. There are packages for git etc.

提交回复
热议问题