Textsnippets - A GTK Snippets Application

Textsnippets is a text expansion program that lets you type an abbreviation for a frequently used piece of text, and have the full text typed out.

post_images/textsnippets3.png

Basic Usage

Press the shortcut key. The default is Super+Space (Super is the windows key on most PC keyboards) to bring up the textsnippets window:

post_images/textsnippets1.png

Type in your abbreviation. When you have typed in your abbreviation, a small description is printed to remind you what the abbreviation is for:

post_images/textsnippets2.png

Press enter, and the expanded text is typed out:

post_images/textsnippets4.png

Download

Textsnippets is available on github:

git clone git://github.com/mivok/textsnippets.git

Installation

Textsnippets runs on X windows, requires python and the following python packages:

In ubuntu, you can do the following:

sudo aptitude install python-xlib python-gtk2 python-cairo

Once you have the dependencies installed, you can either run tsnippets directly from the source directory, or run the following command to install it:

$ python setup.py install
$ tsnippets

Configuration

The textsnippets configuration file is ~/.textsnippetsrc, an .ini style file with two sections. A sample textsnippetsrc file is available in the source download. The quickest way to get started is to copy the textsnippetsrc.example file to your home directory and edit it:

$ cp /path/to/textsnippetsrc.example ~/.textsnippetsrc

General

General settings for the program. The ones you will most likely want to change are:

  • hotkey - The hotkey you wish to use. Default: space
  • modifiers - Any modifier keys for the hotkey. Default: super

Snippets

The snippet definitions themselves. Each snippet has two entries, the snippet itself, and a description. The first entry is the name of the abbreviation, whereas the second entry is the same, but with 'desc' added to the end. For example, if you wanted to add a snippet mysnippet that expanded to Hello world!, you would do the following:

[snippets]
mysnippet=Hello World!
mysnippetdesc=Types Hello World

Predefined Snippets

The following commands are pre-defined:

  • quit - quit the program
  • reload - reload the config file