Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.01 KB

vim_textobj_quote.rst

File metadata and controls

29 lines (23 loc) · 1.01 KB

autoload/plugins/vim_textobj_quote.vim

.. function:: select_quotes() -> None

    Configure quotes for current language.

function! plugins#vim_textobj_quote#select_quotes() abort
    const l:current_lang = split(&spelllang, '_')[0]
    if l:current_lang ==# 'de'
        let g:textobj#quote#doubleDefault = '„“'
        let g:textobj#quote#singleDefault = '‚‘'
    elseif l:current_lang ==# 'en'
        let g:textobj#quote#doubleDefault = '“”'
        let g:textobj#quote#singleDefault = '‘’'
    elseif l:current_lang =~# '^\(es|it\)$'
        let g:textobj#quote#doubleDefault = '«»'
        let g:textobj#quote#singleDefault = '“”'
    elseif l:current_lang ==# 'fr'
        let g:textobj#quote#doubleDefault = '«»'
        let g:textobj#quote#singleDefault = '‹›'
    endif
endfunction