Install Vim Color Scheme Linux Tutorial

  1. Install Vim Color Scheme
  2. Color Scheme Vim
  3. How To Set Vim Color Scheme
  4. Install Vim Color Scheme Linux Tutorial For Beginners

How to control/configure vim colors. By Alvin Alexander. Last updated: January 13 2019. Or figuring out which colorschemes are available on your system, please visit my vi/vim color scheme (colorscheme) tutorial. Either file will be located in your home directory on a Unix or Linux system. I have a lovely Vim colorscheme (xoria256) and it looks brilliant in GVim, but when I use normal vim in Terminal, the colorscheme is only partially supported -- for example, the default semi-transp. Is there a way to get a list of all installed color schemes in Vim? On the linux servers I use via ssh. If you are willing to install a plugin.


This article is part of the ongoing Vi / Vim Tips and Tricks Series. As a programmer, you may do lot of repetitive tasks while coding such as:

If you're on Ubuntu, Linux Mint, etc. Then you can grab the proper Vim package with sudo apt-get install vim. Changing Vim Colors. Before we go trying to edit color schemes, let's just try some of Vim's default schemes. You may not know this, but you can rotate through a bunch of default schemes using the:color command.

  • Adding file header
  • Adding function/frame comment
  • Including default code snippet
  • Performing syntax check
  • Reading documentation about a function
  • Converting a code block to comment, and vice versa


The C-Support Vim Plugin offers easiest way to do all of the above, saving lot of time and keystrokes for C and C++ programmers.

The plugin was written by Fritz Mehner, who explains the purpose of the plugin as: “Write and run programs. Insert statements, idioms, comments”.

He also highlights following features:

  • Statement oriented editing of C / C++ programs
  • Speed up writing new code considerably.
  • Write code and comments with a professional appearance from the beginning.
  • Use code snippets


This article explains how to install the plugin in 3 easy steps and 7 powerful features of the plugin.

3 Steps to Install the C.Vim Plugin

Step 1: Download C Vim Plugin

Download the plugin from vim.org website.

Step 2: Install the C Vim Plugin

Step 3: Enable the plugin in the ~/.vimrc

Add the following line to the ~/.vimrc to enable the plugin for Vim editor.

8 Powerful Features of C.Vim Plugin

Feature 1: Add Automatic Header to *.c file

When you open a file with the extension .c it opens the file with header as shown below. This will also place the cursor in the Description field in Insert mode.


To change the default value of the AUTHOR and COMPANY, modify the default value in ~/.vim/c-support/templates/Templates


Now, when you create a new c file, it will show the modified values for AUTHOR and COMPANY as shown below.


Note: To add custom fields to the header, modify the ~/.vim/c-support/templates/file-description.template file and add your own custom field.

Feature 2: Adding C function using if

For writing a subroutine, type if in normal mode, which will prompt for the function name (as shown in Fig1 below) and inserts the subroutine with default function content (as shown in Fig2 below).

Fig1:Insert C Function Automatically

Fig 2:Insert C Function Automatically

Feature 3: Insert main Function Header using im

For inserting main function, type im in normal mode, which will add the main function as shown below.

Feature 4: Insert a Function Header using cfu

For inserting a function header, type cfu in normal mode, which will ask the function name as shown in Fig 4, and adds the comment as shown in Fig 5.

Fig 4: Insert C Function Header Automatically

Fig 5: Insert C Function Header Automatically

Feature 5: Add a Frame comment using cfr

To add a frame comment, type cfr in normal mode, which will give the following formatted comment.

Feature 6: To include header file, use p<

Type p< in the normal mode, which will include the text “#include <>”, and places the cursor in the < symbol in Insert mode where you can type the header file name.

Feature 7: Save the file, compile it and execute it immediately.

To save and compile the file use rc.

To run use rr.

Feature 8: Insert pre-defined code-snippet to the C code using nr

The plugin comes with few pre-defined code snippets that you can insert into your code. Following are the default code snippets that comes with the plugin.

For example, if you want to create a function that will Allocate a dynamic int-matrix of size rows*columns; return a pointer, you can re-use it from the existing code snippets. Following is the content of the calloc_int_matrix.c pre-defined code snippets.

Install Vim Color Scheme


To insert this into your working c program, type nr from the normal mode inside vim, which will prompt “read snippet /home/ramesh/.vim/c-support/codesnippets/”, type calloc_int_matrix.c at the end and press enter, which will insert the content of the ~/.vim/c-support/codesnippets/ calloc_int_matrix.c to your working file automatically.

Note: You can define your own code snippets and place it under ~/.vim/c-support/codesnippets/. You can also build your own code snippets from the existing code – select the part of code need to be made as code snippet, press nw, and give a file-name to it. From next time, type nr and the file-name to get your custom code snippet.

There are lot of powerful features in the C-Support Vim Plugin. Read the documentation for more information. The documentation is located in the following location on your system.

  • README : ~/.vim/README.csupport
  • PDF : ~/.vim/c-support/doc/c-hotkeys.pdf
  • This plugin comes with a help file (csupport.txt) which can be viewed by :h csupport
  • Additional Screenshots of this plug-in.

Recommended Reading

Vim 101 Hacks, by Ramesh Natarajan. I’m a command-line junkie. So, naturally I’m a huge fan of Vi and Vim editors. Several years back, when I wrote lot of C code on Linux, I used to read all available Vim editor tips and tricks. Based on my Vim editor experience, I’ve written Vim 101 Hacks eBook that contains 101 practical examples on various advanced Vim features that will make you fast and productive in the Vim editor. Even if you’ve been using Vi and Vim Editors for several years and have not read this book, please do yourself a favor and read this book. You’ll be amazed with the capabilities of Vim editor.

Awesome Vim Editor Articles

Following are few awesome Vi / Vim editor tutorials that you might find helpful.

Note: Please subscribe to The Geek Stuff and don’t miss any future Vi and Vim editor tips and tricks.

> Add your comment

If you enjoyed this article, you might also like.



Active4 years, 6 months ago

After some research, I've discovered that in order to properly install you need to create a .vim directory inside of the path represented by the $VIMRUNTIME variable from this StackOverflow post. When I go into that directory to create said directory, I get denied permission to do so. When I try chmod the directory, nothing happens still. What is the proper way to do this?

Color Scheme Vim

Community
T145T145

3 Answers

Unfortunately you're misinterpreting the post you linked to. You would create a .vim directory in your home directory, which is what the ~ (tilde) means.

PHYSICAL MATERIALS Create great looking materials that look exactly like the real thing. Sketchup pro 2014 license key free printable. Vray for Sketchup 2018 Serial Key: 7T6FV-D5C4S-X3ZA3-WSXE4-DC5RF FV6TG-BY7V6-TF5DC-SXZQA-W3SXE Vray for Sketchup 2018 License Key: RFV6T-DC5RE-4SXW3-ZAQ23-W4SXE C5DRF-V6TB7-YTFV6-DC5RE-32QZ3E System Requirements: • For Mac, it is most extreme with 1+ GHz Intel™ processor. How to install or activate Vray for Sketchup 2018 Crack? • For windows, it is most extreme for SketchUp 2013, 2014, 2015, 2016, Windows Vista, Windows 7, Windows 8 with a processor that is 1GHz 1 GB RAM. • The framework should have 16 GB circle that is space that’s hard 300 MB plate space that is free.

Then within that directory you should create a colors directory, and put your colorscheme files there.

At that point, a :colorscheme command should find the file automatically.

HeptiteHeptite
15.6k5 gold badges45 silver badges61 bronze badges

TL;DR: use $HOME/.vim to store your vim related files.

Long version: read http://vimdoc.sourceforge.net/htmldoc/usr_05.html

akiraakira
51k15 gold badges115 silver badges153 bronze badges

You would typically only put the syntax files under $VIMRUNTIME if you are an administrator and want them available to all users.

How To Set Vim Color Scheme

For your own use, put it/them under .vim/colors from your home directory.

Install Vim Color Scheme Linux Tutorial For Beginners

Ian PettsIan Petts

Not the answer you're looking for? Browse other questions tagged linuxmacosvimcolors or ask your own question.