Using Emacs as an IDE

后端 未结 18 1795
清酒与你
清酒与你 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:07

    There are corners of emacs that once discovered make you more productive in ways you never thought of. As others have mentioned, using tags is a fantastic and fast way to zoom around your source code and using M-/ (dabbrev-expand) often does exactly what you expect when completing a variable name.

    Using occur is useful to get a buffer with all occurences of a regular expression in a buffer. That's really handy when refactoring code and looking for fragments of code or uses of variables, or if you use TODO markers in your source files and you want to visit them all.

    flush-lines, sort-numeric-fields, replace-regexp and rectangle functions can be really useful for taking a dump from some tool and converting it to useful data such as an elisp program or a comma delimited spreadsheet.

    I wrote a page about IDE like things you can do with emacs

    http://justinsboringpage.blogspot.com/2007/09/11-visual-studio-tricks-in-emacs.html

    Learning elisp is a another great way to answer for yourself what else emacs can do beyond what a typical IDE can do.

    For example I've blogged about writing Perforce helper functions like blame (writing your own means you can make it behave exactly as you want)...

    http://justinsboringpage.blogspot.com/2009/01/who-changed-line-your-working-on-last.html

    I've also written code that dynamically creates comments for a function at point, that matches the coding standards I'm working with.

    None of my elisp code is particularly great, and most of it exists already in libraries, but it's really useful to be able to make emacs do custom stuff that just comes up during a working day.

提交回复
热议问题