Free Linux text editor with syntax highlighting [closed] - ruby-on-rails

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know text editor and IDE questions have pretty much been beat to death, but most of the answers I've found to this question are Windows and Mac specific, and also aren't always free. I've just started rails development and I'm looking for a light-weight text-editor that supports syntax highlighting. I know there is RubyMine, RadRails, and Netbeans. I'll probably always use one of them for big projects, however, sometimes I prefer to stay away from the IDEs (and all the project .xml .config workspace files they create, and the overhead of opening a file that isn't located in a specific "project") and just use a simple text editor. I had been using Scribes in the past for this but it doesn't have highlighting for .rhtml. I've heard people struggle with gedit as well, and I'm nowhere near desperate enough to be running Notepad++ under wine. Sublime seems to be popular but isn't free. Am I being too needy? Is there anything out there that meets the following criteria:
Runs on linux
Has syntax highlighting for rails (.rhtml, .erb, .rake, etc.)
Is lightweight (not only the look and feel but also I don't want it generating all the unnecessary baggage that IDEs do)
Provides the basic features that pretty much all text editors do (I know this sounds vague and stupid but to be more specific all text editors should give you the option to specify the encoding, replace tabs with spaces, specify tab size, specify the default new line characters, etc. etc.)
Free. Open source is a nice to have but not a requirement.

Sublime Text 2 is an amazing text editor. You can use it for free but they show you a little nag-screen every know and then.
// Check out the packet management, too
// Here is Paul Irish demonstrating live linting and Zen Coding in Sublime

Also Gmate is nice. It's Gedit with a number of plugins which make it behave like textmate.
https://github.com/gmate/gmate

Now, in the Ruby community, the most popular editor is Vim which is hard to get started with, but once you get used to it you won't go back. It's light-weight, customizable, extendable, powerful and absolutely awesome.
Another popular one is, as #superlukas said, Sublime Text 2 which is good, but if you want to use it long term, you'll end up having to pay for it (it's distributed as a never-ending trial).

Sublime Text 2 is what you are looking for just put in the command line :
sudo add-apt-repository ppa:webupd8team/sublime-text-2.
sudo apt-get update && sudo apt-get install sublime-text.
Then it will be in usr/lib/sublime-text-2.You can then do your path configurations from there.

In addition to the other options mentioned ( vim/gvim, Sublime Text 2, and Gmate), take a look at Redcar.
It's an editor for Ruby, written in Ruby. It's actually quite nice, although I tend to use Sublime and vim more these days.

Related

Vim or Emacs for Rails development... any advantages? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Getting ready to try out vim or emacs for rails development. Does one of these support rails development any better than the other? This is on windows if that matters.
Edit
I'm not looking for reasons why or why not to use vim or emacs and I don't want opinions on which is a better editor. I mainly just want to know if one or the other has more/better tools or plugins for using rails, or are they about the same?
Emacs is quite good with Rails when you include the rinari minor mode, and ruby-electric-mode (which comes with the Rails source) is also nice -- more here. That said, it is a bit of a struggle to set up and the learning curve is steep.
Recently (few months ago) I've switched from RubyMine (around €90) to VIM (exactly €0) and I'm really happy with that.
It's not easy to describe why it's better but one thing I love about VIM is that I don't need mouse anymore. It probably sounds funny but I feel much happier without a mouse - because it frees me from the table.
In VIM you'll find helluva lot of nice features - just google around. For example one of the best is ci" which will delete all text inside " and you can start writing. But there are many many others.
The full blown IDE's are IMHO useless for Ruby and other dynamic languages. Their best features like: refactoring, code completition, syntax checking, etc. simply doesn't work. Or worst - works on 80% percent. And they will never work as Rails are full of eval(some_text_that_generates_methods)
I can't speak for Emacs as I've never used it.
I'm not sure how is it on Windows platform as I'm on Mac/Linux. But it should be similar.
UPDATE: Ah, I forgot to provide a link to nice VIM setup for Ruby on Rails: http://github.com/akitaonrails/vimfiles
If you follow the README you will have a working environment ready in a minute. There are many useful plugins in this repository (git submodules to be exact) - just take a look inside.
Vim has rails.vim, a great plugin to help in Rails development. I'm not aware of anything comparable for Emacs. To get the feeling just take a look at the rails.vim screencast.
Although EMacs is a very very powerful tool, the learning curve is unbelievable huge (in my experience) and tends to be overkill for most needs. Running in windows, will also be a damper because you'll be switching from the two extremes - all command line and all gui. I think VIM is a great editor, and as pointed out, Yahuda Katz wrote about how he converted to Vim from textmate.
My vote's for Vim (It's what I use for Rails).
Don't be surprised if after a while in your windows programs and editors (e.g. Visual Studio and Notepad) you're trying to use your vim keystrokes.
I personally only use vim for editing configuration files, or when I need to program on a machine that's not mine. Try Eclipse with one of the plugins, like Aptana.
I don't know about Ruby, but emacs has more and better tools allover, autocomplete, syntax highlighting and general options editing is easier and prettier, and easier to writes plugins for, too. On the other hand, what's been said is true: it's a steeeeeeeeep learning curve, and overkill for most tasks.
Also, you should tag this question [holy-war]

Is Sphinx better than LaTex in writing manuals/books? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Only a few people recommended to use Sphinx at the beginning of the year.
Sphinx has developed rather fast recently. I noted today that Sage has made a change from direct editing with LaTex to Sphinx. This is evident in William Stein's answer on 2nd April about Sage's tutorial
The tutorial is not a latex document anymore. It's an entirely
different Sphinx document that can output pdf.
It suggests me that Sphinx may be at a level such that it is suitable for me.
Is Sphinx better than LaTex in writing manuals/books?
We wrote a book with sphinx but we had to tweak the tex file produced with a Python script.
Take a look at this thread, in the book building tool section
Here a some changes we made to the original LaTeX file:
documentclass = 'book'
added frontmatter, mainmatter and backmatter
added a new style to fncychap.sty
two columns index instead of one columns
some changes in the page header
everything is black & white
links
titles
images (using imagemagick to convert the images in greyscale)
tips and notes displayed in a nicer box with icon
better float placement on pages to optimize the space used
We also made minor changes to book.cls and sphinx.sty
With all these tweaks, we are very happy with the result.
Well, there is at least one book printed using sphinx and rst2pdf
Some sample documents generated via sphinx and rst2pdf here:
http://freedrive.com/folder/236385
And here:
http://freedrive.com/folder/236380
Specially check the python library reference and the django book.
This is output from the development branch and has bugs (for example, the TOC is often on the wrong side of the page) which are being fixed.
I prefer Sphinx to Latex for writing manuals for two reasons:
You can build nice HTML, PDF, htmlhelp and qthelp versions of the manual with minimal effort.
reST syntax is faster to write and I find easier to remember (it's more simple)
A book, however, might be a different story. If I wanted to write a book that has only a printed and a pdf version and contains equations and citations I would go with Latex, because I think it is much more mature than reST and I find it easy to customize.
Btw. I have much more experience in using Latex.
It's better for creating reference documentation, not for writing books.
Is Word a better document production tool?
LaTeX (and TeX) have been around for longer than most of us realise that there were programmes to do that sort of thing and that we were interested in them. LaTeX is almost certainly better than Sphinx (or Word).
Is it better for you? Maybe.
Is it better for me? Unlikely.
Is it better for the average person? Define 'average' then go to point 1.

Best Gnome alternative to UltraEdit? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
As I'm switching from Windows to Ubuntu/Gnome, I'm looking for an alternative to UltraEdit.
I tried a few tools, but they often lack some really useful features, such as:
Syntax coloration
FTP editing of files (access files on a FTP without using an external application)
Character set management.
Which one do you use? And what are their major features?
I just use plain old gedit. It has syntax highlighting and handles charsets.
For handling files on FTP shares I just mount them using the Places->"Connect to Server" functionality and then the remote files are easily accessible from gedit (or any other Gnome program for that matter).
Ultraedit is now available for Ubuntu. It's commercial, but fairly cheap and there is a free trial.
http://www.ultraedit.com/company/blog/products/ultraedit-for-linux-released.html
In the spirit of cross-platform editors, I'd like to point to Scintilla and SciTE. Implementations are used in many IDEs and editors, available for Windows and Linux.
SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. It is best used for jobs with simple configurations - I use it for building test and demonstration programs as well as SciTE and Scintilla, themselves.
SciTE is currently available for Intel Win32 and Linux compatible operating systems with GTK+. It has been run on Windows XP and on Fedora 8 and Ubuntu 7.10 with GTK+ 2.12
Scintilla is a free source code editing component. It comes with complete source code and a license that permits use in any free project or commercial product.
As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips. The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts.
Kate supports syntax coloring and lots of charsets. I'm not sure what you mean by "ftp edition of files", but kate also includes a console, so you could use ftp from there.
geany is a lovely editor, but it uses GTK+ and not GNOME, so it doesn't have gnome-vfs/gvfs integration. bluefish has the gnome-vfs/gvfs integration, but is a bit on the buggy side. gvim is a bit harder to use and doesn't support FTP directly, but is very extensible. In the worst case you could use FUSE to mount the FTP directory onto your system.
Do not look for FTP support in applications. This stuff is better handled by the system, using FUSE file systems or Gnome VFS, etc.
If you want to be hardcore, and want to pick up a semi-useful skill, look into learning vim (or a variant such as ultra-hardcore vi, GUI gvim, etc.); vi and its siblings are the most widespread installed editors on *nix boxes- you might find yourself in a situation where the only editor available is vi.
Otherwise, I would suggest using something that supports the language you use- i.e. I'd rather not program Java without Eclipse.
For other stuff, I use joe, which is a very small and nice command-line editor with Wordstar key bindings.
Just tried Jedit on ubuntu 8.1 and it is the closest to ultraedit with some additional powerful features.. quite happy for now..
Antoher wonderful editor is Screem. It's not very mature, but it's full of useful features.

How do I index and make available reusable code? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have many small files containing code fragments, pseudo-code algorithms, classes, templates, SQL-samples, etc., and I obviously cannot put all these into libraries. I need a practical method to index all of them, and to be able to make this index available to others.
What must such an index contain to
make searching easiest?
Are there any such repositories
available on the web? (So I can test
the techniques they use.)
Are there any applications already
written that implement this that I
can have a look at?
Possible duplicate: https://stackoverflow.com/q/90300/15161
If you're working with .NET / Visual Studio, you could look at adding them as code snippets
Code Keep is a pretty good online repo for CodeSnippets and has plugins for VS2008
What we've done at work is created a common account for the dev to use, so everyone submits to codekeep under a common login and then can retrieve everyone elses snippets.
Also it might be worth your while creating a developer wiki on your dev network. Somewhere that the old hands can leave documentation on your regularly used patterns & snippets and new team members can check for help. We use TRAC in house as an all in one WIKI / Issue Management / SVN Integration and it does the job nicely
Another similar result from searching StackOverflow: Best Application For Storing Code Snippets
You might want to try refactormycode.com or set up your own wiki for it. A wiki actually sounds like a good application here.
I find the only way to manage source code is in the source control repository. This includes templates and pseudo code algorithms.
How it's different from the rest of your code ?
I'm familiar with cvs that can be hosted for example here (setting up cvs server is not to complex task either) you can search the repository using cvsearch and browse it using cvs web client.
I'm not saying cvs is a best option just another one that fulfill all your need.
Code snippets is a not a good option, IMHO.
You can do a full-text index of your hard drive using a tool like Copernic, Windows Live Search, or Google Desktop. Then whenever you want a code snippet that does a specific thing, just search for the relevant keywords and there it goes.

What scares you the most about the integrated IDE of most modern Smalltalks? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
As I'm riding the wave of resurgence of Smalltalk (especially because many Ruby-on-Rails people are rediscovering Smalltalk and seeing Seaside as their next upgraded web framework), I get questions like "yeah, but how do I use my favorite editor to edit Smalltalk code?" or "Does Smalltalk still insist on living in a world of its own?".
Now, having first experienced Smalltalk back in 1981, I don't understand these questions very well. It seems rather natural that I'd want the editor and debugger to be savvy of my current code state, and integrate with the change control system that is Smalltalk-aware. Using an external editor or debugger or change control manager would seem very awkward.
So what is it that scares you the most about not being able to edit the five-line methods in Smalltalk with your favorite editor, or use your favorite non-Smalltalk-aware change control system?
Everything's different. Want to go to the end of the line? It's not Ctrl-E. Want to jump a few words over, by word? It's not Meta-F....
Text editing is a fundamental programming activity. Messing with those inputs is messing with something deep in my mind.
Edit: and here is someone asking for emacs key bindings on comp.lang.smalltalk in 1987.
The only Smalltalk I've spent any time with is Squeak, so my views may not apply to other Smalltalk environments.
What concerns me about the image-based approach is that, while you have wonderful things in the Smalltalk environment, it is a walled garden that makes it difficult to interoperate with anything outside that environment. For example, what if I want to use external tools like Yacc and Lex? What if I want to use some C or Python programs to generate Smalltalk code? What if I want to mix Smalltalk in with a bunch of code written in other languages, editing code in all those languages in one editor and keeping it all stored in the same source-code tree?
I'm sure it's possible to deal with all these issues by having your Smalltalk environment invoke system functions to control external tools. But how easy is it to let external tools control your Smalltalk environment? In other words, what if I want Smalltalk to be just another component, rather than the master of everything?
Nothing scares me in particular, but I found working out the API's in VW a bit of a chore, even when I had used other smalltalks. The effect of the browsers is that you tend to see the API's a little bit at a time and quite often it's not immediately obvious where you should look for particular functionality.
Smalltalk also suffers a bit from the paradigm shift to understand how it works. When I was doing my bachelor's degree at university (some time after I had first encountered Smalltalk) I got to enjoy a bit of Schadenfraude watching everyone else in the class getting over the initial paradigm hump as they learned the system (Squeak) for the first time.
I think the combination of the paradigm shift and functionality being somewhat buried in the class libraries makes for a bit of a steep learning curve. ST had a reputation for a fairly steep learning curve to really come up to speed - most of this is due to the large class libraries and the fact that most of the language functionality is buried somewhere in the libraries.
Also (and sadly), Java came along in the mid 1990s and grabbed all of the mindshare. The major Smalltalks have either died completely or been sold off to niche players. It's quite Ironic (in a happy way) that Ruby has served to re-awaken interest in Smalltalk but the lingering perception of 'also-ran' obsolescence doesn't help.
See This post of mine for some pontification about the merits (as I see them) of getting heavily involved in Smalltalk in this day and age.
I would be quite happy to go back into Smalltalk if the opportunity were to arise.
The one big show-stopper for me is that code I write one Smalltalk VM is STILL, after all these years, not compatible with other Smalltalk VMs.
I understand why that is: the core of Smalltalk is an extremely small set of axioms and keywords. This means that after 30 minutes of learning Smalltalk, you're already learning the API library rather than the language itself. I like that approach to language design.
What it all boils down to however, in the Smalltalk world, is that unless a consensus is reached between all VM vendors to have a common base Standard API, my Smalltalk code written for one VM is almost certain not to run on other VMs when I decide to switch.
This also has the corollary of obsoleting part of my knowledge of the space when I switch VMs.
Note that I have barely tried Smalltalk in my life. I'm far from being an expert. This understanding comes from speaking with James Robertson about a month ago.
Another point I'd like to make is that Seaside does in fact run on most popular Smalltalk VMs. I wonder how much of (what should have been) a Standard API they had to build for themselves to achieve that feat.
With all that said, I always have an ear out to hear more about the state of Smalltalk. I do want to try out Smalltalk's very powerful development environment (and its other goodies).
I know it's late but the biggest annoyance for me is that there is not really good editor in none of the smalltalks. It's a thing I can not understand. Working with text is so essential and that less "supported"....
It's always this just staring at one method and then you need to have some method finder or another browser around just to check another method. This is what I really dislike....
While the restricted Smalltalk environment made things like relying on a database driven source control system possible at times where other languages still struggled with having a proper editor, it makes integration very hard in todays times.
With tools like Eclipse or Team Foundation Server you get so used to having all tools integrate with each other. E.g. if a requirement is created, it is automatically linked to the change sets that the programmer commits to implement that requirement. This "boundary breaking" between formerly different tools is nearly impossible in the Smalltalk world, but with bigger projects, bigger teams, higher levels of abstraction and so on you need tools which are more than a fancy editor and help you throughout a full software development life cycle.
No useful support for navigating with the keyboard, or supporting platform UI behavior.
While it's true you don't really need an incredible text editor for (well-written) Smalltalk, being able to move around the environment while keeping your hands on the keyboard is quite useful (and in my case, essential to reducing RSI). I just was trying VisualWorks' inspector and the arrow keys didn't even work properly to move up and down a list. When I hit the space bar, I got a walkback. Sigh.
For the Windows world, there is nothing like Dolphin Smalltalk. The IDE is fantastic. Another quality product if you want to try is Visualworks, it works well, has a very fast VM and the documentation is pretty good.
I've used both in the past, there is nothing to fear.

Resources