diff options
| -rw-r--r-- | autoload/text_obj.vim | 8 | ||||
| -rw-r--r-- | core/mappings.vim | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/autoload/text_obj.vim b/autoload/text_obj.vim index 58ba710..4f6a1ff 100644 --- a/autoload/text_obj.vim +++ b/autoload/text_obj.vim @@ -76,3 +76,11 @@ function! text_obj#MdCodeBlock(type) abort call setpos("'>", [buf_num, end_row, 1, 0]) execute 'normal! `<V`>' 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 diff --git a/core/mappings.vim b/core/mappings.vim index a7c76c9..eba7106 100644 --- a/core/mappings.vim +++ b/core/mappings.vim @@ -186,6 +186,6 @@ xnoremap <silent> iu :<C-U>call text_obj#URL()<CR> onoremap <silent> iu :<C-U>call text_obj#URL()<CR> " Text objects for entire buffer -xnoremap <silent> iB 0ggoG -onoremap <silent> iB :normal viB<CR> +xnoremap <silent> iB :<C-U>call text_obj#Buffer()<CR> +onoremap <silent> iB :<C-U>call text_obj#Buffer()<CR> "} |
