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

This entry is part 3 of 10 in the series VI / VIM Text Editor

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

Series Navigation«Turn on or off color syntax highlighting in vi or vimUNIX / Linux: vi / vim perform search and replace operation»
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 20 comments… read them below or add one }

1 Brandon 02.26.08 at 9:57 pm

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

2 BR 02.28.08 at 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.

3 arachnid 03.27.08 at 2:07 pm

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

4 Aia 03.29.08 at 1:33 am

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

5 Ryan 04.01.08 at 2:36 am

Great post, solved my problem, thanks!

6 Michael 04.02.08 at 1:07 pm

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

7 breno Leitao 05.03.08 at 9:09 pm

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

8 nicholas 06.28.08 at 6:34 am

It works. ha ha

9 curran 07.17.08 at 2:46 pm

Thank you for this post, it worked fine!

10 dan 08.29.08 at 6:54 am

solved my problem.

Thank you.

11 patrick 09.23.08 at 6:47 pm

Thank you :-)

12 dan 10.04.08 at 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.

13 Andre 10.29.08 at 8:27 pm

Works fine. Tk’s

14 argon 11.21.08 at 10:21 pm

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

15 elinusliga 12.26.08 at 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`
/usr/bin/vim.basic

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

Thanks so much Vivek!

16 Dom 01.07.09 at 9:52 am

Ole! Thanks.

17 wooky 01.19.09 at 4:18 pm

It works, thanks.

18 Pat 01.27.09 at 12:26 am

Worked for me too. Thanks.

19 Jonatan Castro 03.06.09 at 1:01 am

excellent tutorial!
Thanks!

20 nat 04.01.09 at 2:26 pm

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

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , ,

Previous post: How to format date for display or to use in a shell script

Next post: How do I unzip multiple / many files under Linux?