4

This doesn't answer your more general question about text objects, but you can achieve the behaviour in your specific indentation-based example with folds: setlocal foldmethod=indent setlocal shiftwidth=2 setlocal foldlevel=99 Setting 'foldmethod' tells Vim that you want to use indentation based folding. Setting 'shiftwidth' tells Vim the size of each ...


3

This is actually a know issue (see issues #2 and #15 in the plugin bug tracker). The author of the plugin suggested a workaround of the following form: call textobj#user#plugin('handyobjects', { \ 'underscores_a': { \ 'select': 'ar', \ '*pattern*': '%[^%]*%' \ }, \ 'underscores_i': { \ 'select': 'ir', \ '*pattern*': '%\zs[^%]\+\ze%' \ ...


3

For the general case, you can try creating new operators, gs and ge: function! GoStart(type) abort normal! `[ endfunction function! GoEnd(type) abort normal! `] endfunction nnoremap <silent> gs :set opfunc=GoStart<CR>g@ nnoremap <silent> ge :set opfunc=GoEnd<CR>g@ When Vim invokes the operator functions after you type your ...


1

Plugin vim-ninja-feet by tommcdo Currently, this plugin provides following square bracket mappings (do not overlook the square in the definition): {operator}[{text object} Perform {operator} from the cursor to the beginning of the text object defined by {text object}. {operator}]{text object} ...


Only top voted, non community-wiki answers of a minimum length are eligible