dbmrq / vim-bucky

:leaves: Ventilated prose
8 stars 1 forks source link

backspace can not work when try to deleter an eol #6

Closed Freed-Wu closed 4 years ago

Freed-Wu commented 4 years ago

When the cursor in the first column and try to deleter an eol, the backspace can not work beacuse vim-bucky always insert an eol . I have to use the following function to solve this error:

augroup backspaceMap "{{{
    autocmd!
    autocmd Filetype markdown,tex inoremap <buffer> <BS> <C-o>:call BS()<CR>
                \| inoremap <buffer> <C-h> <C-o>:call BS()<CR>
augroup END "}}}
function! BS() "{{{
    if col('.') == 1
        execute('normal! 2dh')
    else
        execute('normal! dh')
    endif
endfunction "}}}
Freed-Wu commented 4 years ago

I hope it exists a better method. Thank you!