When writing Greek, sigmas at the ends of words should have a different form. Can I do something automatically to replace: μῖσοσ by μῖσος, and so in all such cases?
Since a final sigma is quickly followed with a space even if a punctuation marks immediately followf it (except for the end-of-line case), you could do this: define the folowwing function (in your
~/.vimrc file) and remap the space key in insert mode to this function.
" The function checks whether a final greek sigma to be fixed can be found " on the same line at the left of the cursor; the function should be accessed " through a mapping of the space key in insert mode (since even punctuation " marks are flollowed with a space. function! FixPreviousSigma() let l:l = line(".") let l:c = col(".") let l:s = search('σ\>', 'bcW', l:l) if l:s == l:l silent execute "normal rς" endif call cursor(l:l, l:c) endfunction
Then use the tricky mapping whenever you need to use this feature:
:inoremap <Space> <ESC>:call FixPreviousSigma()<CR>a<C-v><Space>
If you also want to take into account the end-of-line case, maybe you could also try:
:inoremap <Enter> <ESC>:callFixPreviousSigma()<CR>o