Additional properties in .editorconfig

Tue 22 January 2019

For some inexplicable reasons vim-editorconfig stopped working with my latest build of neovim. I am not sure why and I haven’t have enough time to debug it properly. As a workaround I have temporarily (?) switched to editorconfig-vim. The former plugin is all written in VimL, so it was not problem to extend properties it supports by two more ones spell_enabled and spell_language corresponding to spell and spelllang vim options respectively. The later plugin is in Python and it is a bit more complicated, but fortunately it has an explicit hook for custom plugins. So, I could write this into special plugin/ file (no into ~/.vimrc, because commands from plugins in ~/.vim/pack are not available then yet):

function! FiletypeHook(config)
     if has_key(a:config, 'spell_enabled')
         let spell_enabled = a:config['spell_enabled']
         echom printf("EditorConfig: spell_enabled = %s",
            \ spell_enabled)
         if spell_enabled == "true"
             let &spell = 1
             let &spell = 0

     if has_key(a:config, 'spell_language')
        let s:languages = map(filter(globpath(&runtimepath,
          \ 'spell/*', 1, 1),
          \ '!isdirectory(v:val)'), 'fnamemodify(v:val, '':t'')')
        echom printf("EditorConfig: s:languages = %s",
          \ s:languages)

         let spell_language = a:config['spell_language']

         " set bomb if necessary
         if spell_language[-3:] == "BOM"
             let &bomb = 1
             spell_language = spell_language[:-4]

         echom printf("EditorConfig: spell_language = %s",
           \ spell_language)
        " We need to accept even dialects of languages, e.g., en_gb
         let lang = split(spell_language, '_')[0]
         echom printf("EditorConfig: spell_language = %s",
           \ lang)
         if !empty(filter(copy(s:languages),
           \ 'stridx(v:val, lang) == 0'))
             echom printf("EditorConfig: spell_language = %s",
               \ spell_language)
             let &spelllang = spell_language

     return 0   " Return 0 to show no error happened
call editorconfig#AddNewHook(function('FiletypeHook'))

Seems to work like charm. Comments on the code are, of course, more than welcome.

Category: computer Tagged: vim authoring


Convert RHEL-7 to CentOS

Wed 02 May 2018

I have tried to suggest update of Migration Guide for RHEL7→CentOS7 migration, but apparently after CentOS was bought by Red Hat, there is not enough desire to document such migration, ehm ehm. So, just recording this for posteriority:

cd …

Category: computer Tagged: linux


Read More

Design notes on plan9-for-vimspace

Mon 04 December 2017


The purpose of this paper is to document any possible ideas, which could be salvaged from the Acme text editor of Plan9 fame, and reuse in vim.

(This is still a bit a work in progress, any comments and suggestions are more than welcome).

When I have seen for …

Category: computer Tagged: vim plan9 ACME GUI


Read More

Harry Potter and The Jabber Spam

Fri 13 January 2017

After many many years of happy using XMPP we were finally awarded with the respect of spammers and suddenly some of us (especially those who have their JID in their email signature) are getting a lot of spim.

Fortunately, the world of Jabber is not so defenceless, thanks to XEP-0016 …

Category: computer Tagged: xmpp


Read More

Firefox OS post-mortem

Sat 26 September 2015

So, it happened. My Flame stopped working, it just doesn’t react to anything (power off switch, power cable), and of course being a weird unknown China-only thing, no local repair shop would touch it. I probably could ask somebody at Mozilla for another one, but I already knew I …

Category: computer Tagged: firefoxOS review


Read More

On bibshare

Thu 04 September 2014

(this is originally a comment on the post about “scientific Markdown”)

In my previous life I was using heavily TeX and BibTeX for writing a scholarly articles when working on my PhD in sociology. When doing a large BibTeX database of bibliopgraphy there is a certain moment when one needs …

Category: computer Tagged: TeX BibTeX bibliography metadata


Read More
Page 1 of 4

Next »