Syntax Highlighting vi editor [duplicate]

How to enable syntax highlighting features in vi editor ? I am currently using ubuntu 16.10.

Here is the output of vi --version.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 22:32:42)
Included patches: 1-1829
Extra patches: 8.0.0056
Modified by [email protected]
Compiled by [email protected]
Small version without GUI.  Features included (+) or not (-):
+acl             -farsi           -mouse_sgr       -tag_any_white
-arabic          -file_in_path    -mouse_sysmouse  -tcl
-autocmd         -find_in_path    -mouse_urxvt     -termguicolors
-balloon_eval    -float           -mouse_xterm     +terminfo
-browse          -folding         +multi_byte      -termresponse
+builtin_terms   -footer          -multi_lang      -textobjects
-byte_offset     +fork()          -mzscheme        -timers
-channel         -gettext         -netbeans_intg   -title
-cindent         -hangul_input    +packages        -toolbar
-clientserver    +iconv           -path_extra      -user_commands
-clipboard       -insert_expand   -perl            +vertsplit
-cmdline_compl   -job             -persistent_undo -virtualedit
+cmdline_hist    +jumplist        -printer         +visual
-cmdline_info    -keymap          -profile         -visualextra
-comments        -langmap         -python          -viminfo
-conceal         -libcall         -python3         -vreplace
-cryptv          -linebreak       -quickfix        +wildignore
-cscope          -lispindent      -reltime         -wildmenu
-cursorbind      -listcmds        -rightleft       +windows
-cursorshape     -localmap        -ruby            +writebackup
-dialog          -lua             -scrollbind      -X11
-diff            -menu            -signs           +xfontset
-digraphs        -mksession       -smartindent     -xim
-dnd             -modify_fname    -startuptime     -xsmp
-ebcdic          -mouse           -statusline      -xterm_clipboard
-emacs_tags      -mouse_dec       -sun_workshop    -xterm_save
-eval            -mouse_gpm       -syntax          -xpm
+ex_extra        -mouse_jsbterm   -tag_binary      
-extra_search    -mouse_netterm   -tag_old_static  
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-vY1bx1/vim-7.4.1829=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -DTINY_VIMRC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lselinux -lacl -lattr -ldl 

I have tried :syntax on. Below is the error message of :syntax on

E319: Sorry, the command is not available in this version

Solution 1:

As muru points out, it looks like you're using the vim-tiny package. A more featureful Vim without a GUI can be found in either:

  • the vim package, with which you can't script Vim itself with external scripting languages
  • the vim-nox package, with which you can script Vim itself with external scripting languages

To install one, use either:

sudo apt install vim

Or:

sudo apt install vim-nox