rvimvim-pluginvim-r

Nvim - I don't understand how to change the options of this plugin


https://raw.githubusercontent.com/jalvesaq/Nvim-R/master/doc/Nvim-R.txt

Section 6 of that document, ctrlF + Nvim-R-options

I'm new to vim, not sure what to do with that information. I want to disable |R_assign|, or possibly reverse the way it works so a double underscore produces a <- in insert mode.

Could someone point me in the right direction please?


Solution

  • The usually recommended method to disable is to add this line to your ~/.vimrc file:

    let vimrplugin_assign = 0
    

    But unfortunately it doesn't work (at least for me).

    When you go through the .vim script files installed by the plugin, the answer lies in lines 2844-2847 of common_global.vim file in the source code:

        " Replace 'underline' with '<-'
        if g:R_assign == 1 || g:R_assign == 2
            silent exe 'inoremap <buffer><silent> ' . g:R_assign_map . ' <Esc>:call ReplaceUnderS()<CR>a'
    endif
    

    So the real solution is to add this line to your ~/.vimrc file:

    let R_assign = 0
    

    An easy one-liner to do the job for you (if you use a Unix-like system):

    echo "let R_assign = 0" >> ~/.vimrc
    

    Do not forget to put two directions as ">>" in order to append and not replace.