使用Emacs进行大型大项目 [英] Using Emacs for big big projects

查看:141
本文介绍了使用Emacs进行大型大项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这里经常重复的问题,但是我找不到与搜索类似的东西。
关键是我喜欢使用Emacs作为我的个人项目,通常是使用C或者python的很小的应用程序,但是我想知道如何使用它也可以用于我的工作,我们拥有大约10k个文件的项目源代码,veiery大(实际上我正在使用源洞察,这是非常好的工具,但只适用于Windows),问题是:




  • 搜索:在整个项目中搜索字符串最方便的方法是什么?

  • 浏览功能:我的意思是把光标放在一个函数上,定义,var,并且定义

  • 重构



如果您有任何经验,并希望分享你的想法,我会认为它非常有趣。



Br

解决方案

p>我的项目通常生活在git中,所以我把它放在一起,快速搜索:

  ;; vc-git.el中有类似的东西(但是鸽友):vc-git-grep 
;; - 我的意思是不搜索二进制文件
(defcustom git-grep-switches--extended-regexp -I -n-ignore-case
切换到`git grep'
:type'string)

(defun git-grep(command-args)
(interactive
(list(read-shell-commandRun git -grep(如下):
(格式git grep%s -e
git-grep-switches)
'git-grep-history))
let((grep-use-null-device nil))
(grep command-args)))


Maybe is a often repeated question here, but i can't find anything similar with the search. The point is that i like to use Emacs for my personal projects, usually very small applications using C or python, but i was wondering how to use it also for my work, in which we have project with about 10k files of source code, so is veeeery big (actually i am using source insight, that is very nice tool, but only for windows), questions are:

  • Searching: Which is the most convenient way to search a string within the whole project?
  • Navigating throught the function: I mean something like putting the cursor over a function, define, var, and going to the definition
  • Refactoring

Also if you have any experience with this and want to share your thoughts i will consider it highly interesting.

Br

解决方案

My projects typically live in git, so I put this together to quickly search them:

;; There's something similar (but fancier) in vc-git.el: vc-git-grep
;; -I means don't search through binary files
(defcustom git-grep-switches "--extended-regexp -I -n --ignore-case"
  "Switches to pass to `git grep'."
  :type 'string)

(defun git-grep (command-args)
  (interactive
   (list (read-shell-command "Run git-grep (like this): "
                             (format "git grep %s -e "
                                     git-grep-switches)
                             'git-grep-history)))
  (let ((grep-use-null-device nil))
    (grep command-args)))

这篇关于使用Emacs进行大型大项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆