Typing Macros using Snippits

Once upon a time, I had the perfect editor for writing. Unfortunately it was a long time ago, on my Commodore 128. I helped Rod develop QWKRR128, which was an offline mail reading program. One of the things that I absolutely loved about it was that I could use the editor in the program for writing articles, and chose to do so because the editor was fast to use, and thanks to collaboration between Rod and myself, it included customisable keyboard short cuts. I could type a couple of letters of a word, press the spacebar, and whatever I'd defined would appear in the editor. I loved it. It could be used for single words or several paragraphs of text. It's only limitation was that these macros resided in memory so you couldn't have tons of them, but what I had was enough for me and it's one thing I've really missed in all these years. I've tried various editors and other software, but all came up short in comparison to to QWKRR's macros.


While reading an article on Lifehacker AU about what software their editors use, a common item was a text substitution utility - and there appeared to be one for Windows and for the Mac. As I continued reading, a Linux user mentioned Snippits and pointed to an article on their site about how to install it. Naturally I checked it out.


I had no problems following the step-by-step instructions for installing all the bits and pieces to get it going, but ran into a heck of a time sorting out how to put it into place with KDE on my Kubuntu Hardy Heron system, as the System Settings is slightly different in this version from the instructions. So here are my notes on getting it going, as it's well worth having:

Follow the installation instructions given in the article up to the segment on setting up your shortcut key, with the exception of using sudo for the mkdir and gedit commands as sudo isn't required at this stage and would only make the folder and files only available to root. Instead of gedit of course, you would use whatever text editor you normally use.

  • To set up your shortcut key in KDE 3.5 (Hardy Heron), use the System Settings utility and select 'Accessibility', then click on 'Input Actions'.
  • Click on 'New Group' and give it a name. I used 'Gaelyne's stuff'. With your newly added group is highlighted, click on 'New Action'.
  • Under the General tab, I renamed 'New Action' to 'Snippits', and set the Action type as 'Generic'.
  • Click on the 'Triggers' tab and then click on 'New' and choose 'Shortcut Trigger'.
  • A box will appear with the text 'Select Keyboard Shortcut' with a large box with the word 'None' in it. Click on the word 'None'.
  • A new box will appear. You don't need to select anything on this box, just press the key you want to use as your 'trigger' key. In my case, I used the Pause/Break key because it's not one I'm likely to hit by accident.
  • If you want to use more than one key together you can tick on 'Multi-key Mode' before pressing your desired keystroke combination.
  • You'll now see the box that had 'None' in it will show your chosen key or combination of keys'. Press OK. This will close the box.
  • Click on the 'Actions' tab and then click on 'New' and choose 'Command/URL'.
  • A new pop-up box will appear. If you just type in 'ks do' (without the quotes), it won't work because ks isn't in your path so it will assume it's a URL and open up the Konqueror web browser. You need to have the full path to the ks program that was installed. On my system this is what I put in the box: /var/lib/gems/1.8/bin/ks do
  • Click on 'Apply'. Exit the System Settings app.
  • Use your favourite text editor to create a new file in your ~.snippits folder. Name it 'hello'. Inside the file, put the words 'Hello World' and save. In another text editor window or any place where you can type text (Email editor, etc) type in the word 'hello' (without quotes) and press the shortcut key you defined. The word 'hello' will be replaced by 'Hello World'.

There are a few examples in /var/lib/gems/1.8/gems/snippits-0.5.2/examples that you can use to get you started. Two easy ones are having two text files in your ~/.snippits folder named 'name' and 'email'. Within these files, put in your name and Email address. Then whenever you type email plus your shortcut key, your full email address will appear. Ditto with when you type name and shortcut key.

I'm really looking forward to making good use of this little utility!

Powered by Drupal - Design by artinet