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

ADVERTISEMENTS

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

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
40 comments… add one
  • Brandon Feb 26, 2008 @ 21:57

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

  • BR Feb 28, 2008 @ 4:19

    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 Mar 27, 2008 @ 14:07

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

  • Aia Mar 29, 2008 @ 1:33

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

  • Ryan Apr 1, 2008 @ 2:36

    Great post, solved my problem, thanks!

  • Michael Apr 2, 2008 @ 13:07

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

  • breno Leitao May 3, 2008 @ 21:09

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

  • nicholas Jun 28, 2008 @ 6:34

    It works. ha ha

  • curran Jul 17, 2008 @ 14:46

    Thank you for this post, it worked fine!

  • dan Aug 29, 2008 @ 6:54

    solved my problem.

    Thank you.

  • patrick Sep 23, 2008 @ 18:47

    Thank you :-)

  • dan Oct 4, 2008 @ 19:46

    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 Oct 29, 2008 @ 20:27

    Works fine. Tk’s

  • argon Nov 21, 2008 @ 22:21

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

  • elinusliga Dec 26, 2008 @ 9:41

    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`
    /usr/bin/vim.basic

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

    Thanks so much Vivek!

  • Dom Jan 7, 2009 @ 9:52

    Ole! Thanks.

  • wooky Jan 19, 2009 @ 16:18

    It works, thanks.

  • Pat Jan 27, 2009 @ 0:26

    Worked for me too. Thanks.

  • Jonatan Castro Mar 6, 2009 @ 1:01

    excellent tutorial!
    Thanks!

  • nat Apr 1, 2009 @ 14:26

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

  • Patrick Aug 20, 2009 @ 6:40

    Thanks for the tip! It solves my problem:)

  • Dhara Sep 22, 2009 @ 5:59

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

  • Anon Oct 14, 2010 @ 9:37

    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 Nov 10, 2010 @ 17:24

    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 Nov 25, 2010 @ 11:06

    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 Apr 5, 2011 @ 9:28

    same problem, thx for help!

  • Phani Apr 15, 2011 @ 17:21

    Thanks for your help. It solved my problem.

  • puck Jun 8, 2011 @ 9:45

    It works on debian 6.0

  • Enes Nov 30, 2011 @ 17:24

    Thanks for the post. It solved my problems…

  • majkel May 17, 2012 @ 5:19

    Thanks:)

  • Rob Oct 3, 2012 @ 11:26

    Sill works, Ubuntu 12.04

  • maru Feb 22, 2013 @ 7:11

    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

    great! Your’are my hero.

  • John Coleman May 20, 2013 @ 17:30

    DOH! DUH! Now my highlighting works. Thanks.

  • Vijay Kanta Sep 30, 2013 @ 14:11

    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 Nov 30, 2013 @ 16:14

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

  • LuisaG Jan 30, 2015 @ 20:29

    Works fine, thanks

  • Tony Jan 31, 2015 @ 4:12

    thanks a lot

  • IS Aug 3, 2015 @ 4:47

    Thanks, it works!

  • adnan Aug 10, 2015 @ 1:19

    apt get solved my problem

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.