Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigating effectively through source code in Linux [closed]

Tags:

linux

projects

I was wondering how people usually navigate through large projects with several source files in Linux environment. I primarily work with C and python and sometimes with C++, C# and Java.

I wanted to know specific editors, plugins etc. I used to program on windows so editors like vi and emacs are not really in my league, but if you think if it could be really helpful for me to learn one of these editors please suggest so and any specific plug-ins you use to make your life simpler with managing large projects with these programs.

Here are a couple of scenarios: Let's say I am working on a particular function A in file F, and all of a sudden I realize that this function needs to call function B in file G. I quickly need to navigate to that function to determine things like function parameters, take a quick look at the function etc. Another scenario would be working on two different locations at one time in a file and switching quickly between these two locations.

I am using eclipse to manage my project and do development (eclipse's auto completion is painfully slow) and geany to edit files individually, but seems like I can't really get to that level of efficiency.

Please share your code management and navigation techniques.

Thanks,

edit: languages

like image 793
verma Avatar asked Aug 03 '09 02:08

verma


People also ask

How do I navigate source code?

To navigate forward, press Ctrl+Alt+Right . To navigate to the last edited location, press Ctrl+Shift+Backspace . To find the current caret location in the editor, press Ctrl+M . This action might be helpful if you do not want to scroll through a large file.

Which command is used to navigate in the file system in Linux?

pwd Print Working Directory. The shell command pwd displays the file path from the root directory to the current working directory. The command line is a text interface for your computer. It's a program that takes in commands and passes them on to the computer's operating system to run.

Which Linux commands are used to copy and move data?

On Linux and Unix operating systems, the cp command is used for copying files and directories. If the destination file exists, it will be overwritten.


4 Answers

Emacs with etags -- see eg EmacsWiki on Tags -- as Emacs' default modes work for all languages I care about: R, C++, C, shell, Perl, Python, SQL, ... and probably also the ones you are after. The Exuberant Ctags generalise this to more languages and editors, including the vi family.

like image 99
Dirk Eddelbuettel Avatar answered Oct 22 '22 17:10

Dirk Eddelbuettel


For vim lovers (like me): vim + ctags does great job. Also grep is your best friend.

like image 37
Artyom Avatar answered Oct 22 '22 17:10

Artyom


Well, what kinda code are you talking about? C++/java/php/ruby/python I highly recommend netbeans, specially the latest dev builds, also KDevelop for kde 4.2 (from svn) is really nice, the php/C# support is very experimental but if you don't mind the random crash its really good. Netbeans is by far the most stable IDE for php/java/c++ on linux if you don't mind installing java to run it.

like image 45
OneOfOne Avatar answered Oct 22 '22 17:10

OneOfOne


For grepping in files, ack is better than actual grep.

For navigating between files, bash alias that runs kwrite on background together with bash completion for file names is enough for me.

like image 40
che Avatar answered Oct 22 '22 17:10

che