Ubuntu Linux Vim Sorry, the command is not available in this version: syntax on

Posted on in Categories , , , , , last updated May 12, 2008

Q. I am using vim under Ubuntu Linux and whenever I type following command:
syntax on

I’m getting an error which read as follows:
E319: Sorry, the command is not available in this version: syntax on

How do I fix this problem?

A. Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.

There are a lot of enhancements above Vi: multi level undo, multi windows and buffers, syntax highlighting, command line editing, filename completion, on-line help, visual selection, etc

Ubuntu Linux comes with tiny version of vim.

All you need to do is installed full vim version by typing following command:
$ sudo apt-get install vim

You can add syntax on command to ~/.vimrc file

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

40 comment

  1. Actually answers the question.

    Ubuntu natively comes with tiny vim. This does not support syntax and other fancy stuff. So if you’ve just installed Ubuntu and run vim, you will get the error reported.

    In order to get syntax highlighting and other features, you must install the complete vim via apt-get.

  2. My Ubuntu 8.10 natively comes with vim-tiny. By installing full vim, now the syntax highlighting works.
    The vi command no longer points to /usr/bin/vim.tiny. Instead it now points to /usr/bin/vim.basic

    $ readlink -f `which vi`

    $dpkg -S /usr/bin/vim.basic
    vim: /usr/bin/vim.basic

    Thanks so much Vivek!

  3. This is long-winded answer which is why a few people didn’t understand it.

    The answer is the default version doesn’t have syntax highlight, so install the full version using:

    sudo apt-get install vim

Leave a Comment