Vim's Ruby option is not enabled - ruby

I just started learning Ruby and I ran this command:
vim --version
The output looks like this (look at the yellow circle):
Which means that my Vim does not include the 'ruby' function.
But it seems my Vim supports Ruby fairly well:
q1: Is there any problem with my Ruby programming with the -ruby?
q2: How can I enable Ruby function in Vim?

The functionality on the second screenshot is given by installing the vim-ruby plugin.
The internal Ruby support is to allow people to write plugins and scripts for Vim using Ruby and it's not strictly necessary for what you seem to want to accomplish.
If you REALLY want to add Ruby support, you can always build Vim from source (or get a package with it already built). I suggest you to look into Vim's homepage for more info on this matter.

The difference you are missing is between using Vim to program in a language such as Ruby, and using a given language to program Vim.
Writing Ruby code using Vim is enabled by Vim's native syntax files, as well as various third-party plugins available for Vim. This is the case for many, many languages, not only those mentioned in the :version screen (Perl, Python, and Ruby). You can use Vim to write code in C, Scala, PHP, Javascript, and many other languages, with support for syntax highlighting, smart indenting, and so on.
Writing Vim functions and plugins can only be done in a small set of languages. Natively, Vim code is always written in its own language, Vimscript. However, Vimscript is notoriously difficult to deal with, and most people will not already know it. So Vim also has the ability to use plugins written in other languages, such as Python or Ruby. This enables people to use a more familiar language for plugin development.
However, using those languages requires binding to an interpreter for the language, and this must be decided at the time Vim is compiled. The :version screen is telling you that for your installation of Vim, the Ruby support was not enabled, so you can not write plugins using Ruby, nor can you use any available plugins which were written in Ruby.
Notice that +python is present, so you can use Python plugins (but -python3 is there too, meaning that you do not have Python 3.x support built in).

Related

Tcl tclsh Set Up

I am just starting out in Tcl and am trying to properly configure an editor and interpreter for use. On Tcl's download page it is recommended to use ActiveState's ActiveTcl, but I am learning Tcl for possible production use and want to avoid paying for it.
I tried setting up Eclipse's DLTK to use for learning, but from what I found I need to direct it to the tclsh executable to use it as the interpreter. In Tcl version 8.6.6, I can't find anything that will work. The supposed formats (I'm on Windows) should follow what's seen here, as I've seen this a few examples/tutorials.
As a last resort, I tried following the Windows instructions here to use my MS Visual Studio 2015 work with this, but there is no such vcvars file (what's asked for when reading makefile.vc after downloading Tcl).
I would really like to use Eclipse for this, so I guess my question is as follows: How do you use tclsh as a Tcl interpreter in Tcl 8.6.6?
ActiveTcl isn't a pay-for product. (ActiveState have some of those, but their language distribution isn't one of them as long as you're not after a support plan.)
To configure Eclipse to use the right installed version of Tcl, go to the Tcl → Interpreters page in the main Preferences panel. That lets you Add… an interpreter, which essentially just requires you to find where the tclsh you want to use is on your filesystem, and to give it a name. I use names like “Tcl 8.6” in my installation, so it isn't exactly rocket science. The DLTK system can find out pretty much everything else once it knows where the interpreter implementation is, but if you have several set up (e.g., I have both 8.5 and 8.6) then you'll need to say which one is default using the checkboxes in the list in the Interpreters pane.
(I've verified the above against Eclipse Neon running on OSX, but I don't think it will vary very much with other versions or platforms.)

Where can I compile my ruby code?

I started programming on ruby at codecademy but where can I compile my codes on doing a website?
When I was making some lessons on C I used codeblocks to run codes. I know any text editor can run a HTML code. So what about ruby?
Thank you.
I'll take a stab at answering the question that I think you're asking, but I'm not 100% sure here.
Ruby is an interpreted language (what does that mean? Not a whole lot nowadays. If you'd like a more in depth discussion on the distinction or lack thereof between interpreting vs compiling, read Jorg's comments below). To execute ruby code, you'll need to install ruby. Fortunately for you, this is freely available on any major platform. If you're on something unix-y (eg, linux or mac), I'd strongly recommend installing ruby via something like rvm or rbenv. If you're on windows, you can either go the cygwin route and pretend it's a unix-y environment, or there are prebuilt installers out there. Googling 'install ruby' should have some sites that can help you at or near the top of the search results.

REPL with features of modern shell

I am creating a script (in Lisp, though this can apply to any language with a REPL) which users interface with using the language's REPL. But this does not include even basic interactive features like remembering history. I am wondering if it is possible to tell a terminal emulator to interpret commands using an arbitrary language, instead of the built-in language.
Thanks!
OK, follwoing the advice of user2864740, I looked at GNU Readline, which is the library the provides much of the functionality that I'm looking for. I'm going to switch to Guile Scheme instead of Common Lisp since Guile supports Readline out of the box. However, it looks like it can work in Common Lisp as well: http://www.cliki.net/sb-readline
Yet another approach might be to start the editor emacs, run
M-x shell
and in this shell run your Lisp REPL. You get a lot of feature for free, like command history.

how do I install ruby-mode for emacs

I have just installed emacs for fedora.I want to use emacs to write ruby. What are the tools,extensions needed that provide me code hinting,code completion type features for ruby ?
ruby-mode is already included from Emacs 23 onwards. It's also available via ELPA though. Some other things you might be interested in are integrating RVM, feature-mode (Cucumber), rspec-mode, ruby-electric, inf-ruby, rinari (for Rails) etc. Here's my current Emacs configuration for Ruby development:
https://github.com/citizen428/emacs.d/blob/master/config/ruby-conf.el
I also wrote a blog post on this topic once, it's a bit outdated and my config has changed since then, but it's better documented and maybe helps you in getting started:
http://www.citizen428.net/blog/2010/07/06/emacs-for-rubyists
If you use yasnippet you can find Ruby completions here: https://github.com/bmaland/yasnippet-ruby-mode
If you are completely new to Emacs, you might want to start out with Emacs Prelude or the Starter Kit:
Emacs Prelude
emacs-starter-kit

Create a Fully Featured Environment For Tcl/Tk Development Under Windows

I'm now learning Tcl/Tk, but as I'm running Windows, I want to create a fully featured(professional) development environment for this language, but I need to know:
Which tools I need to install(first of all)?
What are the IDEs that support Tcl/Tk development?
What is the best text editor to develop in?
Where I can find some librarys for it(if exists)?
It's possible to do some web applications with it?
It uses CGI?
Start off by installing ActiveTCL. It is free and includes TCL and TK bindings. If you have a favorite text editor you can use that. Make sure you have syntax highlighting. If you want something more advanced, I'd recommend Komodo. It is by active state and has a free version. It semantically understands TCL, so it is more intelligent than a standard text editor. For example it highlights syntax errors while you code.
Now write some code and spread the TCL love!
For an interactive Tcl shell, use TkCon
For an editor, I use Komodo or Vim
For web apps, there are FrameWorks, servers: TclHTTP, Aol Server, Apache modules, and of course CGI
For a text editor I would recommend trying jEdit; it has TCL syntax highlighting. When installed I would also recommend installing the following plugins (which can be done via the built-in plugin manager):
Project Viewer: Allows you to organise your files into projects, which gives it more of an IDE feel.
Editor Scheme: Gives you a set of pre-defined syntax highlighting colour schemes to choose from. My preference is for "zenburn".
As Byron mentioned, ActiveTCL is the place to start when using TCL on Windows. As for a text editor, I personally like SciTE, but any text editor that will do syntax highlighting will do (code folding helps as well).
The TCL wiki has the following page regarding IDEs: http://wiki.tcl.tk/998
If you are in need of a library providing specific functionality, I would first check the TCl wiki. There is no central repository of TCL extensions, but the wiki seems to be the central repository of TCL knowledge.
Yes, you can use TCL for web-based projects. You can find a bit of info here regarding CGI and TCL. Some webservers (AOLServer for instance) have a built-in TCL interpreter.
Others have already mentioned TkCon but most people don't utilise the full power of TkCon. It is much more than a REPL loop (for that you could have just used tclsh or wish). My favourite feature is TkCon's edit command.
Basically:
edit some_file.txt
lets you view and edit files.
set my_variable "some value"
edit my_variable
lets you view and edit the content of a variable, even arrays
proc my_function {} {}
edit my_function
lets you view and edit the body of a proc. In fact, this is how I usually write non-trivial procs in TkCon.
If you're going to write code that needs Windows-specific functionality, you will definitely want to get TWAPI the Tcl Windows API library.
With regards to the mentions of ActiveTcl - ActiveState (the creators of ActiveTcl) have been developing an extension repository. Certainly there are extensions which do not (yet) appear there, but there are over 3000 entities in their repository at this time, so many extensions are present there. ActiveTcl comes with a program called "teacup" which provides a command line interface to the repository, allowing you to install specific extensions (or, if you are like me, allowing you to install all the extensions relevant to your platform).
The Tcler's wiki has a number of references to additional tools and extensions. However, your favorite web search engines are likely to turn up utilities, tools, extensions, and applications not yet documented on the wiki or added to the ActiveState repository.
MyTcl is a fairly nice IDE with a Tcl environment included, autocomplete, syntax highlighting, debugging, etc. It has a similar look and feel to Visual Studio. The homepage is in Korean, but it's not too hard to find the download.

Resources