How To Install vim-snipmate on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 533 words
Introduction
In this tutorial we learn how to install vim-snipmate
on Ubuntu.
What is vim-snipmate
vim-snipmate is:
SnipMate.vim aims to be an unobtrusive, concise vim script that implements some of TextMate’s snippets features in Vim. A snippet is a piece of often-typed text that you can insert into your document using a trigger word followed by a
.
For instance, in a C file using the default installation of snipMate.vim, if
you type “for
for (i = 0; i < count; i++) {
}
To go to the next item in the loop, simply
snipMate.vim has the following features among others:
- The syntax of snippets is very similar to TextMate’s, allowing easy conversion.
- The position of the snippet is kept transparently (i.e., it does not use marks/placeholders inserted into the buffer), allowing you to escape out of an incomplete snippet, something particularly useful in Vim.
- Variables in snippets are updated as-you-type.
- Snippets can have multiple matches.
- Snippets can be out of order. For instance, in a do…while loop, the condition can be added before the code.
There are three methods to install vim-snipmate
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install vim-snipmate Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install vim-snipmate
using apt-get
by running the following command:
sudo apt-get -y install vim-snipmate
Install vim-snipmate Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install vim-snipmate
using apt
by running the following command:
sudo apt -y install vim-snipmate
Install vim-snipmate Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install vim-snipmate
using aptitude
by running the following command:
sudo aptitude -y install vim-snipmate
How To Uninstall vim-snipmate on Ubuntu
To uninstall only the vim-snipmate
package we can use the following command:
sudo apt-get remove vim-snipmate
Uninstall vim-snipmate And Its Dependencies
To uninstall vim-snipmate
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove vim-snipmate
Remove vim-snipmate Configurations and Data
To remove vim-snipmate
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge vim-snipmate
Remove vim-snipmate configuration, data, and all of its dependencies
We can use the following command to remove vim-snipmate
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge vim-snipmate
Dependencies
vim-snipmate have the following dependencies:
References
Summary
In this tutorial we learn how to install vim-snipmate
package on Ubuntu using different package management tools: apt, apt-get and aptitude.