Consolidating editors - R, C-family, LaTeX, html

Discussion in 'Mac Programming' started by cricketbird, Jun 18, 2010.

  1. cricketbird macrumors member

    Feb 17, 2008
    I'm a grad student. I do my stats in R. I do my mac programming in Obj-C in XCode. I do LaTeX markup in TeXShop. I occasionally use Smultron to do some HTML work or to look at source code. Someday I'd like to try some iPhone programming, and java and python are on my to-learn list. I'm tired of switching between all the quirks of all the different application-specific editors. I'd like to use ONE editor that can handle all these different program and save some wear and tear on my brain.

    The candidate list seems to be Emacs (prob Aquamacs), TextWrangler, or Smultron. Having never used emacs, it seems like there is a learning curve and it has a reputation of being quirky. I'm kinda tired of quirks and just want something simple and straightforward (and I'm not a big tetris fan). Smultron seems straightforward and I've used it a fair amount, but I guess it is dead these days so I'm hesitant to sink my time into it. I'm downloading TW now to give it a whirl.

    1) Is consolidating even a good idea? Or are there benefits to programming in each language in its own app? Will I be making MORE problems for myself by using a non-built-in editor?

    2) Any other suggestions for an editor that plays nicely in all these environments (R, C family, HTML, LaTeX)? If so, why?

  2. jpyc7 macrumors 6502

    Mar 8, 2009
    Denver, CO
    These are just some general thoughts about editors, which might help clarify what you are seeking.

    Some useful features for reading code are:
    keyword coloring, moving cursor to beginning or end of block, compressing or expanding a code block, moving cursor to a function definition.

    Some useful features for writing code are
    creating end markers for block of code (e.g. HTML closing tag), variable or function name completion.

    Because emacs is an extendable and open editor, the various useful features generally depend on whether someone has implemented a 'mode' for it, which is written in Lisp programming language. Generally, all the 'simpler' features like keyword coloring and syntax awareness are available in the default modes shipped with Emacs. Advanced features may require download and installation.

    I think the quirks are a result of the 'modes' being implemented by different people for different programming languages. So key combinations that do similar things won't necessarily be consistent between them. In theory, you could learn Lisp to customize these modes yourself and make them consistent to your sensibility.

    So basically, I think you will have to live with quirks, if you use Emacs. Of course, the Emacs way of basic editing features will remain the same. Things like copy/paste, search/replace, switching files.

    I'm not a power user of Emacs, so I generally haven't installed additional functionality to do the code completion. I program mostly Python and I don't think that language has code completion for Emacs. Then again, I haven't searched for it either.

    I don't know if you consider Eclipse to be a possible candidate or not. It's an IDE where each type of programming language development uses plug-ins (same idea as emacs modes) except these are implemented in Java. I only use Eclipse for Python development, but I suspect Eclipse has inconsistency among different types of language development just like Emacs. I use the built-in editor of the 'Pydev' project which can do block compression and expansion and name completion.

    If you are looking to use other Unix-like operating systems, then you should probably go with open source software like Emacs or Eclipse.
  3. Mernak macrumors 6502

    Apr 9, 2006
    Kirkland, WA
    I much prefer having seperate applications for different things. Most LaTeX editors have plenty of shortcuts that are useful just for LaTeX, quickfinding symbols, custom defined templates and automatic PDF conversion in a second window.

    Programming text editors tend to be fairly friendly for any popular language thy can be run for the command-line, and depending on which one, supports projects and automatically compiles any required files.

    The only editor I would only really consider to try with everything would be Eclipse, with a bunch of add-ons. I know they have a Python one, and I would think that there would be ones for LaTeX and R, not sure about Obj-C though. Also the UI editor in XCode is more likely more full featured, so writing the UI itself might be easier. Unfortunately, the add-ons aren't exactly the most stable and will randomly break the program. And it is a horrible RAM hog, especially when doing bigger projects.
  4. mrmma macrumors member

    Dec 27, 2006
    I used to use different environments for different tasks, but after taking a new job, where I had to use a Linux OS and my TeXShop/xcode/etc were no longer available, I decided to learn a universal one, emacs.

    It's not _that_ quirky, and I've grown to really love it. Aquamacs is a nice compromise, in fact, letting you do as much point, click cmd x cmd v as you like, but the flexibility and ease of macro generation, code completion, in multiple languages is amazing. It helps me find coding (TeX) errors simply with the text highlighting.

    Plus, and this has saved me on several occasions, if you are working in a terminal remotely, its much much faster to type emacs -nw foo and open the file in the terminal window itself than to open it in whatever your IDE/text editor of choice is (unless your one of those vi types...) say for editing shell profiles/makefiles/etc...

    Anyway, just like LaTeX is worth the effort in the long run, so, too is emacs.

    A final plug: OS X uses some emacs bindings, and can be easily modified to do many more. e.g. you can move forward, backward, up or down with C-f, C-b, C-p, C-n in any text window, C-k will "kill" a line, C-y "yanks" or pastes it back...but even if you decide to not use emacs, just learning C-d does forward delete will save you tons of time in OS X.
  5. TuffLuffJimmy macrumors G3


    Apr 6, 2007
    Portland, OR
    I'm not that advanced, but I do all my HTML, Java, and LaTeX writing in TextMate.
  6. ThaGrapist macrumors newbie

    Feb 13, 2010
    TextMate is the best editor for OS X. It's very powerful, in the vein of UNIX editors, but without all the quirkiness. TextMate is worth the money, but if you're really looking for something free, you might have a look at jEdit.
  7. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    Deja vu?

    But BBEdit is my favourite all purpose text editor, although I still use Xcode for C and Objective-C stuff. The static analysis is too sexy to miss out on.

    I've spent a little while learning the basics of Vim and now I can use it without a problem but I spend so little time SSHing into my website server that I hardly ever get a chance to use as BBEdit trumps it for ease of use and an intuitive interface. Perhaps with practice I'll get to feel the same way about Vim.
  8. simon-says macrumors regular

    May 24, 2005
    Another vote for TextMate here, been using it since 2006. I use it for C/C++, LaTeX, HTML, JavaScript, PHP, Ruby (and Rails), and more. While I was in school for the last year of my bachelors and all my masters I pretty much lived and breathed TextMate. Now that I'm a software consultant I still do. Before TextMate I used Smultron (now Fraise), which I found wonderful for free. I've tried TextWrangler/BBEdit even before touching TextMate, awesome products but I just didn't like them.

    The only thing I do not use TextMate for is Objective-C, I do switch over to Xcode for that. Nice to have the debugger and other tools.

    If you are doing HTML/CSS get the ZenCoding plugin, saves me a TON of time.
  9. qtx43 macrumors 6502a

    Aug 4, 2007
    If you've got emacs on the list of possibles, you might as well put vim (macvim). Vim is a great editor and very versatile but, like emacs, has a very steep learning curve (or shallow, depending on what you're graphing exactly). But I'm not sure I'd recommend either to very many people nowadays, unless you're (a) a full-time programmer/sysadmin and (b) need the power and (c) not using an IDE most of the time. vim is great for me, because I know it so well already, and you can get the basics down pretty quickly, but for it to be 2nd nature and doing lots of complicated stuff takes a while. Is that how you really want to spend your time?

    So this is mostly a negative recommendation, against vim or emacs. There are many things out there that are important to stick in your brain, is this one of them? Pretty GUIs may be slower if you're proficient at the command line, but it's even slower if you're constantly having to look stuff up.
  10. cricketbird thread starter macrumors member

    Feb 17, 2008
    Thanks for all the input! As you guessed, I was avoiding TextMate for the cost, but after your recommendations I played with the free trial and am enjoying it greatly. I also didn't realize Smultron was back as Fraise and am giving that a whirl too, but neither it nor TextWrangler sends commands to R or xcode like TM does, so I'm less enthusiastic about them now. Plus, the code folding features of TM are nice too.

    Someday I'll give AquaMacs a spin, but I'm not a programmer - just a scientist trying to make tools for my own/labmates' use, and the little bit I read up about emacs just seems to scare me off. Just getting up to speed on LaTeX and Obj-C has been a steep (but useful) learning curve and I'm not up for another one just yet. But, I'll keep it in mind should I decide to officially put on a programmer's hat.

    Thanks again,
  11. ianray macrumors 6502

    Jun 22, 2010
    Vim is great, really great, for me -- I have been using it (and Vi) for some twenty years or so.

    But a surprising thing happened recently... Editing is more productive in XCode, simply because of the it's code completion facilities. (This comment was in regard to Mac OSX and iOS development.)

    It would be interesting if there would be a 'vi' mode for XCode's editor -- movement in vi can be so much more efficient than arrow/home/end/page keys with various modifiers ;)

Share This Page