Snippy: auto-completion on Linux

cool_penguin_smallAuto-completion is available for different applications but through different mechanisms. Snippy is a text-expander tool that delivers system-wide auto-completion using unified text snippets. It works uniformly for the browser of editor or the console.

Features

  • Easy to install (automatically checks for xdotool xsel and dmenu)
  • Usable in console AND windows like browsers
  • Interactive snippets using bashdown: parse bash inside templates
  • Resolves symlinks (easy to cross-reference editor- email- which already exist)
  • Execute plain bash to paste into browser

Installation

Run the following commands to install Snippy:

$ curl -L "http://tinyurl.com/o9d6ch5" > snippy.sh 
$ chmod 755 snippy.sh
$ sudo mv snippy.sh /usr/bin/

Usage

Snippy uses bash to expand and execute. You need to create a keyboard shortcut to run Snippy. An example expander key is <Super-Tab>.

Create the ~/.snippy directory with snippets, empty files or symlinks to snippets. The files can be empty (‘tech@somelong.email.com’) just for auto-completion or they could automate certain laborious reports or stats, since it parses bash from the snippets.

Let’s check an example file:

$ cat ~/.snippy/tomorrow
$(date --date='tomorrow' +'%Y-%m-%d' | tr '[:upper:]' '[:lower:]' )

This would turn ‘see you tomorrow’ into ‘see you xxxx-xx-xx’ (tomorrow’s date). Another one:

$ cat ~/.snippy/report-manager
curl -v -X GET "http://company.foo.com/api/v1.0/revenue?fmt=pretty-json" | grep "total_lasagna" | sed 's/^[a-zA-Z0-9 ]/g'

Webpage: Snippy (website down)

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s