≡ Menu

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

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

{ 40 comments… add one }

  • Brandon February 26, 2008, 9:57 pm

    Did you even read the question? The answer doesn’t address the question at all.

  • BR February 28, 2008, 4:19 am

    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.

  • arachnid March 27, 2008, 2:07 pm

    Installing the full vim via apt-get doesn’t help at all. The problem stays as it is.

  • Aia March 29, 2008, 1:33 am

    Installing vim via apt-get solved the problem. Thank you.

  • Ryan April 1, 2008, 2:36 am

    Great post, solved my problem, thanks!

  • Michael April 2, 2008, 1:07 pm

    Works perfectly – who would have thought – two vim packages.

  • breno Leitao May 3, 2008, 9:09 pm

    you should be using vim-tiny that is the default package in Ubuntu.
    You should install a more bloated version. :-)

  • nicholas June 28, 2008, 6:34 am

    It works. ha ha

  • curran July 17, 2008, 2:46 pm

    Thank you for this post, it worked fine!

  • dan August 29, 2008, 6:54 am

    solved my problem.

    Thank you.

  • patrick September 23, 2008, 6:47 pm

    Thank you :-)

  • dan October 4, 2008, 7:46 pm

    I’m running Debian and I came across the same issue. I originally thought I was using some archaic version of vim! This article did the trick.

  • Andre October 29, 2008, 8:27 pm

    Works fine. Tk’s

  • argon November 21, 2008, 10:21 pm

    Thank you. I have apt-got vim, and my world is colorful now :)

  • elinusliga December 26, 2008, 9:41 am

    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!

  • Dom January 7, 2009, 9:52 am

    Ole! Thanks.

  • wooky January 19, 2009, 4:18 pm

    It works, thanks.

  • Pat January 27, 2009, 12:26 am

    Worked for me too. Thanks.

  • Jonatan Castro March 6, 2009, 1:01 am

    excellent tutorial!

  • nat April 1, 2009, 2:26 pm

    I was getting the same error. Dint know that I was running vim.tiny :D…. Thanx for the post .. Thank you . :)

  • Patrick August 20, 2009, 6:40 am

    Thanks for the tip! It solves my problem:)

  • Dhara September 22, 2009, 5:59 am

    Thanks a lot..it has solved my problem .Top of it other few errors are also solved …

  • Anon October 14, 2010, 9:37 am

    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

  • Akash November 10, 2010, 5:24 pm

    hey this was very useful, before trying your soln i tried
    apt-get update vi ….. but no luck

    what to say vivek,, u r just too good :)

  • Rossey November 25, 2010, 11:06 am

    I had the same problem on Ubuntu 9.10, but this didn’t fix the problem!

    I had to remove vim, vim-tiny
    sudo apt-get remove vim vim-tiny

    And reinstall vim
    sudo apt-get install vim

  • ixjnpns April 5, 2011, 9:28 am

    same problem, thx for help!

  • Phani April 15, 2011, 5:21 pm

    Thanks for your help. It solved my problem.

  • puck June 8, 2011, 9:45 am

    It works on debian 6.0

  • Enes November 30, 2011, 5:24 pm

    Thanks for the post. It solved my problems…

  • majkel May 17, 2012, 5:19 am


  • Rob October 3, 2012, 11:26 am

    Sill works, Ubuntu 12.04

  • maru February 22, 2013, 7:11 am

    You may also need to run the following command, to use the “non-tiny” vi:

    sudo update-alternatives –config vi

  • TY May 4, 2013, 7:50 am

    great! Your’are my hero.

  • John Coleman May 20, 2013, 5:30 pm

    DOH! DUH! Now my highlighting works. Thanks.

  • Vijay Kanta September 30, 2013, 2:11 pm

    The answer is not proper for people who are facing issues when vim is installed from source. Do you have a solution for people facing this problem after installing vim from source?

  • Rajesh November 30, 2013, 4:14 pm

    Thanks!!! installed the full version of vim, resolved the problem

  • LuisaG January 30, 2015, 8:29 pm

    Works fine, thanks

  • Tony January 31, 2015, 4:12 am

    thanks a lot

  • IS August 3, 2015, 4:47 am

    Thanks, it works!

  • adnan August 10, 2015, 1:19 am

    apt get solved my problem

Leave a Comment

   Tagged with: , , , , , , ,