Facebook Twitter Instagram
    WiredRevolution.com
    • Home
    • About
    • Contact Us
    • Essential Linux Commands
    • Sitemap
    Facebook Twitter Instagram
    WiredRevolution.com
    ubuntu

    Enable syntax highlighting in vim with Ubuntu

    RyanBy RyanJanuary 14, 20091 Comment1 Min Read
    Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email

    Many distributions have syntax highlighting in vim enabled with their default installation. In Ubuntu as well as other Debian based distributions, this is not the case. By default Ubuntu installs the vim-tiny package which does not support syntax highlighting or many other advanced features.

    You can see by following the chain of symlinks that in the default installation vim calls vim.tiny.

    $ which vim
    
    /usr/bin/vim
    

    /usr/bin/vim -> /etc/alternatives/vim -> /usr/bin/vim.tiny

    If you want additional features including syntax highlighting you need to install the vim package.

    $ sudo apt-get install vim
    

    Now vim uses vim.basic which is what we want. This version supports all the advanced features.
    /usr/bin/vim -> /etc/alternatives/vim -> /usr/bin/vim.basic

    The last step is to actually enable syntax highlighting.

    To enable it for a single session go into command mode and enter this command:

    :syn on
    

    Make these changes permanent for every vim session by opening or creating the .vimrc configuration file in your home directory.
    /home/username/.vimrc

    Insert the following lines.

    if has ("syntax")
            syntax on
    endif
    
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
    Previous ArticleFix for missing title bar and GNOME panel with Firefox
    Next Article Skip network filesystems when searching with find

    Related Posts

    Fix insync Gnome Shell extension error on Ubuntu

    Netflix now working on Ubuntu Linux

    Fix OpenGL: ChoosePixelFormat SketchUp error in WINE

    Most Commented
    March 12, 2009

    Fix blue tinted video in Ubuntu

    September 10, 2010

    Setup SSH access between VirtualBox Host and Guest VMs

    March 8, 2011

    Install GNOME Shell in Ubuntu 10.10 Maverick

    April 4, 2009

    Setup the PS3 Bluetooth Controller on Ubuntu

    October 22, 2008

    How to correctly use LD_LIBRARY_PATH

    Recent Comments
    • Execute command on linux virtual machine (or server) from windows commandline on Setup SSH access between VirtualBox Host and Guest VMs
    • Solved: How to SSH to a VirtualBox guest externally through a host? - Daily Developer Blog on Setup SSH access between VirtualBox Host and Guest VMs
    • How to SSH to a VirtualBox guest externally through a host? [closed] – Code D3 on Setup SSH access between VirtualBox Host and Guest VMs
    • How to copy and paste from VirtualBox? [duplicate] on Setup SSH access between VirtualBox Host and Guest VMs
    • Jackie Laguna on Fix OpenGL: ChoosePixelFormat SketchUp error in WINE
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.