mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Fix bug for text object for the entire buffer
This commit is contained in:
parent
61d42ed550
commit
e4ef4fa6ea
@ -76,3 +76,11 @@ function! text_obj#MdCodeBlock(type) abort
|
|||||||
call setpos("'>", [buf_num, end_row, 1, 0])
|
call setpos("'>", [buf_num, end_row, 1, 0])
|
||||||
execute 'normal! `<V`>'
|
execute 'normal! `<V`>'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! text_obj#Buffer() abort
|
||||||
|
let buf_num = bufnr()
|
||||||
|
|
||||||
|
call setpos("'<", [buf_num, 1, 1, 0])
|
||||||
|
call setpos("'>", [buf_num, line('$'), 1, 0])
|
||||||
|
execute 'normal! `<V`>'
|
||||||
|
endfunction
|
||||||
|
|||||||
@ -186,6 +186,6 @@ xnoremap <silent> iu :<C-U>call text_obj#URL()<CR>
|
|||||||
onoremap <silent> iu :<C-U>call text_obj#URL()<CR>
|
onoremap <silent> iu :<C-U>call text_obj#URL()<CR>
|
||||||
|
|
||||||
" Text objects for entire buffer
|
" Text objects for entire buffer
|
||||||
xnoremap <silent> iB 0ggoG
|
xnoremap <silent> iB :<C-U>call text_obj#Buffer()<CR>
|
||||||
onoremap <silent> iB :normal viB<CR>
|
onoremap <silent> iB :<C-U>call text_obj#Buffer()<CR>
|
||||||
"}
|
"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user