andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Suggestion: A build and run option per language #187

Open richbowen opened 10 years ago

richbowen commented 10 years ago

A useful addition could be a build and run script for various programming languages. So depending on the extention of the file that is being edited or is in focus of the editor, the build and run script would perform the adequate action.

For example, if a file has a .java extention, when clicking build and run it would perform: javac NameOfFile.java then java NameOfFile respectively.

for a file with the .cpp extention: Build: g++/clang++ -Wall NameOfFIle.cpp -o NameOfFile Run: ./NameOfFile and so on.

This would make building and running applications a bit easier and only require a few clicks.

andreikop commented 10 years ago

I don't believe I can guess how user wan'ts to build something. java and javac might be not in PATH, user might want to add some cmdline parameters. g++/clang++ usually requires libs and include paths.

But, 2 approaches might be effective:

Makefile

Enki ancestor Monkey Studio finds Makefiles in current or parent directories and adds targets to main menu. I.e you would have menu items Makefile/all, Makefile/test. You can set shortcuts for actions. If you set shortcut for Makefile/all in one project, any all in other Makefiles will have the same shortcut

User configurable tools

User creates an action manually, types a command, menu item text, shortcut. Command might include variables, which will be substituted with current file name, current directory.

What do you think about it?

bjones1 commented 10 years ago

Personally, I like the Unix philosophy: create one tool for one purpose, and make it the best tool possible. IMHO, this is my thought for Enki -- make it the best, leanest, meanest text editor ever. In contrast, the Eclipse / NetBeans approach is to create one tool that does EVERYTHING, making it slow, bloated, and difficult to learn.

Therefore, I think all IDE tasks (compile / build / etc.) should be left for a good, solid IDE rather thank glued into Enki. (Personally, I think the REPL code falls under think category as well). An IDE will provide a good, language-specific set of tools best for your task.