{"id":280,"date":"2020-09-05T22:22:26","date_gmt":"2020-09-06T06:22:26","guid":{"rendered":"https:\/\/www.thetembo.com\/tech\/?p=280"},"modified":"2020-09-05T22:25:00","modified_gmt":"2020-09-06T06:25:00","slug":"more-to-vim-than-meets-the-eye","status":"publish","type":"post","link":"https:\/\/www.thetembo.com\/tech\/more-to-vim-than-meets-the-eye\/","title":{"rendered":"More to VIM than Meets the Eye"},"content":{"rendered":"\n<p>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&#8217;m following their tutorial on how to write a FreeDict dictionary.<\/p>\n\n\n\n<p>The first section refers to requirements.<\/p>\n\n\n\n<p>Requirement 1. Licensing and copyrighting. This isn&#8217;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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Requirement 3. The FreeDict requires Unicode, preferably with a UTF-8 character set.<\/p>\n\n\n\n<p>The road to a dictionary has many forks. For the moment, I&#8217;m going to jump ahead to step 8, editing TEI XML at <a href=\"https:\/\/github.com\/freedict\/fd-dictionaries\/wiki\/FreeDict-HOWTO-%E2%80%93-Editing-TEI-XML\">https:\/\/github.com\/freedict\/fd-dictionaries\/wiki\/FreeDict-HOWTO-%E2%80%93-Editing-TEI-XML<\/a>.<\/p>\n\n\n\n<p>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<a href=\"https:\/\/github.com\/garbas\/vim-snipmate\"> https:\/\/github.com\/garbas\/vim-snipmate<\/a>. Shipmate is a GitHub site with software that enables language-specific editing. But before you install that, they send you off to Pathogen.<\/p>\n\n\n\n<p>Fork 2. Pathogen is a VIM installation aid found at <a href=\"https:\/\/github.com\/tpope\/vim-pathogen\">https:\/\/github.com\/tpope\/vim-pathogen<\/a> that helps you &#8220;manage your &#8216;runtimepath&#8217; with ease. In practical terms, pathogen.vim makes it super easy to install plugins and runtime files in their own private directories.&#8221; The directions there have you install pathogen.vim to ~\/.vim\/autoload\/pathogen.vim. This worked for me:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\tmkdir -p ~\/.vim\/autoload ~\/.vim\/bundle &amp;&amp; \\\n\tcurl -LSso ~\/.vim\/autoload\/pathogen.vim https:\/\/tpo.pe\/pathogen.vim\n<\/pre>\n\n\n\n<p>Then you add &#8220;execute pathogen#infect()&#8221; to your vimrc. Since I didn&#8217;t have .vimrc in my home directory, the instructions suggest:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\texecute pathogen#infect()\n\tsyntax on\n\tfiletype plugin indent on\n<\/pre>\n\n\n\n<p>Once this is done, &#8220;any plugins you wish to install can be extracted to a subdirectory under ~\/.vim\/bundle, and they will be added to the &#8216;runtimepath&#8217;.<\/p>\n\n\n\n<p>Merge back to 1. Now with pathogen installed, you can install all the plugins from the Snipmate project. All of this worked for me:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  % cd ~\/.vim\/bundle\n  % git clone https:\/\/github.com\/tomtom\/tlib_vim.git\n  % git clone https:\/\/github.com\/MarcWeber\/vim-addon-mw-utils.git\n  % git clone https:\/\/github.com\/garbas\/vim-snipmate.git\n  # Optional:\n  % git clone https:\/\/github.com\/honza\/vim-snippets.git\n<\/pre>\n\n\n\n<p>To prove that everything worked, I created a hello.cpp file, inserted the word &#8220;for&#8221; followed by a tab, and voila, I get:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"981\" height=\"512\" src=\"https:\/\/www.thetembo.com\/tech\/wp-content\/uploads\/2020\/09\/Vim.jpg\" alt=\"\" class=\"wp-image-281\" srcset=\"https:\/\/www.thetembo.com\/tech\/wp-content\/uploads\/2020\/09\/Vim.jpg 981w, https:\/\/www.thetembo.com\/tech\/wp-content\/uploads\/2020\/09\/Vim-300x157.jpg 300w, https:\/\/www.thetembo.com\/tech\/wp-content\/uploads\/2020\/09\/Vim-768x401.jpg 768w\" sizes=\"auto, (max-width: 981px) 100vw, 981px\" \/><\/figure>\n\n\n\n<p>The &#8220;tei-snippet&#8221; doesn&#8217;t exist in the Snipmate download, the next challenge for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;m following their tutorial on how to write a FreeDict dictionary. The first section refers &#8230; <span class=\"more\"><a class=\"more-link\" href=\"https:\/\/www.thetembo.com\/tech\/more-to-vim-than-meets-the-eye\/\">[Read more&#8230;]<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[13,23,22,24,27,26],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-thetembo","4":"post-280","6":"format-standard","7":"category-tech-learning","8":"post_tag-dictionary","9":"post_tag-tei-xml","10":"post_tag-vim","11":"post_tag-freedict","12":"post_tag-snipmate","13":"post_tag-vim-pathogen"},"_links":{"self":[{"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":1,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/posts\/280\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thetembo.com\/tech\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}