How to enable syntax highlighting on vim before 7.3? - vim

For some reason (experiment on the research work in a 2006 paper) I need to use Ubuntu 8.04, which only has vim 7.1.x in its default package source. syntax on and filetype on are not supported in this version of vim. Manuals regarding syntax I can search are for vim 7.3. Are there alternative ways to enable syntax highlighting on older versions of VIM? Was syntax highlighting feature introduced that late?

Related

Prolog support for Vim users

I am starting with Prolog programming using XSB.
What syntax highlighting script or plugin for vim editor would you suggest for (XSB) Prolog ?
Vim (7.3) comes with filetype-specific settings and syntax highlighting for Prolog. Just make sure that your file is detected as such (i.e. :setlocal filetype? prints prolog), and you have the usual :filetype plugin on and :syntax on in your ~/.vimrc.
Vim auto-detects *.pdb and *.pl (depending on contents, can also be Perl); but you can configure additional patterns, see :help new-filetype.
The Vim support for Logtalk is an alternative for syntax coloring of Prolog files. Given that Logtalk extends Prolog, you will get nice syntax coloring for official and de facto standard Prolog features. The latest version is available here:
https://github.com/LogtalkDotOrg/logtalk3/tree/master/coding/vim
You will need to configure Vim, however, to use the Logtalk syntax highlighter support for the Prolog files (basically to recognize the file extensions that you're using for Prolog; e.g. XSB, by default, prefers .P). Also do try different Vim themes. Some of them are more pleasant than others.
There are two big plugins "set" for working with Prolog in Vim:
adimit/prolog.vim - widely known but abandoned
soli/prolog-vim - lesser known, but more updated and advanced
You can check files of the second - they are extending standard prolog.vim which comes with Vim, but including it. Moreover they support different flavours of Prolog - SWI Prolog, GNU Prolog, etc. You can use them as an examble and create your own.

Is anyone aware of a VIM colorscheme for BASIC (language)

B.A.S.I.C.
I encountered a few thousand lines of code from the 80's I need to edit, and would like to save a couple hours it may take me to roll my own VIM syntax defs file.
Vim 7.3 ships with the syntax file referenced by nneonneo, and automatically detects *.bas files as filetype=basic. You may simply have to upgrade to the latest Vim version (or tweak the filetype detection).
VIM ships with basic.vim now. This has been updated in 2011.
https://github.com/vim/vim/blob/d07969093a9b3051511c478d71c36de6fc33c0d6/runtime/syntax/basic.vim

Vim plugin for coloring macros

Is there any way to highlight defined variables or macros in Vim? Is there any plugin which does that. For example:
#define MONITORING_OFF 0
change_monitoring(MONITORING_OFF);
In the above example, is there any way to highlight MONITORING_ON?
(I am using Vim on windows with ctags enabled.)
Thanks
It is worth to mention Easytags plugin that, in addition to automatic
tags file update, supports dynamic syntax highlighting of tags occurrences.

Can you tell me the relationships and differences between Vi and Vim

I often see Vim in my lab, but I also know Vi, but I never have a chance to use it, I search for it by using google, but I can't get a website to download Vi. Can you show me the relationships and differences between Vi and Vim, if possible, give me a url to download the Vi. Thanks!
Despite what others have said, Vim is not an enhanced version of Vi, nor is it an extension. It might seem that way because Vim was designed to be, by default, as compatible with Vi as possible (even more so in Vi-compatible mode). Obtaining Vi source code used to required a Unix source code license, and since additional features were desired, Vim was developed independently of Vi. It is more properly called a clone, which has additional features.
Vim is the standard editor on many *nix systems. The "program" vi is often just a symlink to vim. Historical interests aside, I can't think of a compelling argument for using Vi. Vim is much more modern, and any features you don't want can be disabled, or support for them not compiled in.
You can download the source for vi here: http://ex-vi.sourceforge.net/
Vim is an enhanced version of Vi with extra features. If you know how to use Vi, you won't have trouble using Vim, since you know the basics. Sometimes people used to Vim have trouble with Vi as it doesn't have all the extra features as Vim.
Vim has an option called compatible that makes vim behave nearly exactly like vi. See :help 'compatible for more information.
VIM is Vi iMproved. VIM is basically an extension of Vi. I would learn VIM not Vi as it just gets too hard for many things. The advantage is if you can use Vim you can use Vi, just the extra snazzy stuff like syntax highlighting etc will be missing.
See wikipedia for more details on the history of the two: http://en.wikipedia.org/wiki/Vi & http://en.wikipedia.org/wiki/Vim_(text_editor)
Here is a good guide to Vi including how to install for your distro: http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html

How do I get python 3 syntax highlighting in vim?

All the highlighting right now uses python2.6 and that makes me very sad face.
you can use python.vim plugin
http://www.vim.org/scripts/script.php?script_id=790
make sure you download the 3.0 version plugin

Resources