2

Occasionally, I need to type documents in Russian in LaTeX format. To use Russian in vim I follow the guidelines from this Habr post. In short, I have the following settings in my .vimrc file:

set keymap=russian-jcukenmac
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan

With these settings in place I can use Ctrl+^ to switch between English and Russian languages in vim insert mode. For convenient typing of LaTeX commands in vim I use the Vim-LaTeX distribution. The configuration commands relevant to vim-LaTeX in my .vimrc are:

" envoke LaTeX-Suite on TeX file open
filetype plugin on

" load filetype-specific indent files
filetype indent on

" load vim-latex for empty TeX files
let g:tex_flavor='latex'

All is nice and well and I’m satisfied with this setup. However, there is one small problem that makes my life miserable. One of the Russian letters, the small letter «ю», is not typed correctly. When I press the relevant key on the keyboard I get a full stop symbol «.» instead of the small letter «ю». On the other hand, the capital letter «Ю» (when pressing the Shift key) is produced correctly. Would you please be so kind to help me debug the problem? Maybe I have some option clashes with the vim-LaTeX?

3

1. Try to replicate issue with clean vim

  1. vim --clean
  2. :set keymap=russian-jcukenmac

If you are able to enter letter ю, something is wrong with your vimrc

2. Check what is in your keymap file

Open :e $VIMRUNTIME/keymap/russian-jcukenmac.vim and find letter ю. Make sure it is correctly mapped:

.   ю   CYRILLIC SMALL LETTER YU
| improve this answer | |
  • Thank you for your suggestions. It works with vim --clean and :set keymap=russian-jcukenmac. I will investigate my .vimrc file now. – mabalenk Jun 28 at 10:20
  • 1
    Do binary search with the help of :finish command. Just put it in the middle of your vimrc, then in the middle of the first or last half, etc. – Maxim Kim Jun 28 at 10:35
  • 1
    I fixed it! The order of loading the Russian keymap and vim-LaTeX settings was wrong. Now I set Russian keymap first and the vim-LaTeX commands last. – mabalenk Jun 28 at 10:54
  • 1
    @mabalenk Consider posting that last part about the ordering between langmap and the vim-latex settings as an additional answer. It might help others with the same or similar problem in the future. Thanks! – filbranden Jun 28 at 15:54
0

To solve my problem I have modified the ~/.vimrc file in the following manner:

  1. Load Russian language specific keymap first and

  2. Set vim-LaTeX options last, i.e.:

    " Russian language {{{
    " ----------------
    set keymap=russian-jcukenmac
    set iminsert=0
    set imsearch=0
    highlight lCursor guifg=NONE guibg=Cyan
    " }}}
    
    ...
    
    " vim-latex {{{
    " ---------
    " envoke LaTeX-Suite on TeX file open
    filetype plugin on
    
    " load filetype-specific indent files
    filetype indent on
    
    " load vim-latex for empty TeX files
    let g:tex_flavor='latex'
    " }}}
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.