pi314 / ime.vim

A Vim input method engine
BSD 2-Clause "Simplified" License
84 stars 3 forks source link

同時開啟多個 ime buffer #50

Closed pi314 closed 6 years ago

pi314 commented 6 years ago
function! s:set_title ()
    for l:idx in [''] + map(range(2, bufnr('$') + 1), '"-". v:val')
        try
            " the ``file`` command expands ``#``, so it has to be escaped
            let t:localtablabel = 'cim' . l:idx
            execute 'file cim' . l:idx
            break
        catch /^Vim\%((\a\+)\)\=:E95/
        endtry
    endfor
endfunction

setlocal buftype=nofile
setlocal noswapfile
call s:set_title()
execute 'set guitablabel='. &guitablabel

inoremap <expr> <buffer> <CR> (pumvisible() ? "<C-Y>" : "") . (getline('.') == '' ? "<C-R>*" : "<ESC>0\"*C")
vnoremap <CR> "*d
pi314 commented 6 years ago

Implemented with d32b1bc