• Config Mgmt
  • Process
  • Site Setup
  • storyboard
  • Technology
  • The Tembo Tech Mission Statement
  • Timeline
  • training

The Tembo Team Site

Tech Articles relevant to The Tembo Press

More to VIM than Meets the Eye

September 5, 2020 by thetembo

The goal is this: create a Guacuno-to-English dictionary that I can install on a Nook application or anything else I choose to publish my book to. I found https://github.com/freedict/fd-dictionaries/wiki/FreeDict-HOWTO the free dictionary website which seems to support this endeavor and I’m following their tutorial on how to write a FreeDict dictionary.

The first section refers to requirements.

Requirement 1. Licensing and copyrighting. This isn’t much of an issue for me. The language is book specific so I doubt it serves much purpose sitting in the FreeDict repository for GPL download. But if it does, I am all in.

Requirement 2. The FreeDict uses TEI XML markup. This is a requirement and a huge challenge if not an outright block. We shall see. Future posts are sure to come.

Requirement 3. The FreeDict requires Unicode, preferably with a UTF-8 character set.

The road to a dictionary has many forks. For the moment, I’m going to jump ahead to step 8, editing TEI XML at https://github.com/freedict/fd-dictionaries/wiki/FreeDict-HOWTO-%E2%80%93-Editing-TEI-XML.

Fork 1. If you are a VIM person, like me, the site recommends installing a vim plugin called tei-snippets.com. In order to install a snippet, they send you off to https://github.com/garbas/vim-snipmate. Shipmate is a GitHub site with software that enables language-specific editing. But before you install that, they send you off to Pathogen.

Fork 2. Pathogen is a VIM installation aid found at https://github.com/tpope/vim-pathogen that helps you “manage your ‘runtimepath’ with ease. In practical terms, pathogen.vim makes it super easy to install plugins and runtime files in their own private directories.” The directions there have you install pathogen.vim to ~/.vim/autoload/pathogen.vim. This worked for me:

	mkdir -p ~/.vim/autoload ~/.vim/bundle && \
	curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Then you add “execute pathogen#infect()” to your vimrc. Since I didn’t have .vimrc in my home directory, the instructions suggest:

	execute pathogen#infect()
	syntax on
	filetype plugin indent on

Once this is done, “any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the ‘runtimepath’.

Merge back to 1. Now with pathogen installed, you can install all the plugins from the Snipmate project. All of this worked for me:

  % cd ~/.vim/bundle
  % git clone https://github.com/tomtom/tlib_vim.git
  % git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
  % git clone https://github.com/garbas/vim-snipmate.git
  # Optional:
  % git clone https://github.com/honza/vim-snippets.git

To prove that everything worked, I created a hello.cpp file, inserted the word “for” followed by a tab, and voila, I get:

The “tei-snippet” doesn’t exist in the Snipmate download, the next challenge for another day.

Posted in: tech learning Tagged: #Dictionary, #TEI-XML, #vim, FreeDict, Snipmate, vim-pathogen

Recent Posts

  • Information as Code – the New IaC
  • More to VIM than Meets the Eye
  • Poly-Glutten
  • Creating a Custom Mobi Dictionary

Categories

  • tech learning (3)
  • Uncategorized (1)
“Writing isn't about making money, getting famous, getting dates, getting laid, or making friends. In the end, it's about enriching the lives of those who will read your work, and enriching your own life, as well."
- Stephen King

"Science fiction is arguably the most important genre of all, for it shapes how people understand things."
-Yuval Noah Harari

Bluffdale

By Michael Angel

Property Of Nature

By Michael Angel

Copyright © 2025 The Tembo Team Site.

Omega WordPress Theme by ThemeHall