diff options
author | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
commit | e573b3020c032400eed60b649a2cbf55266e6bb0 (patch) | |
tree | 8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/tlib_vim/autoload/tlib/textobjects.vim | |
parent | b8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff) | |
download | myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2 myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip |
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/tlib_vim/autoload/tlib/textobjects.vim')
-rwxr-xr-x | vim/bundle/tlib_vim/autoload/tlib/textobjects.vim | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim b/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim new file mode 100755 index 0000000..fb4170e --- /dev/null +++ b/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim @@ -0,0 +1,45 @@ +" textobjects.vim +" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) +" @Website: http://www.vim.org/account/profile.php?user_id=4037 +" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) +" @Created: 2010-01-09. +" @Last Change: 2010-01-10. +" @Revision: 0.0.29 + +let s:save_cpo = &cpo +set cpo&vim + + +" :tag: standard-paragraph +" Select a "Standard Paragraph", i.e. a text block followed by blank +" lines. Other than |ap|, the last paragraph in a document is handled +" just the same. +" +" The |text-object| can be accessed as "sp". Example: > +" +" vsp ... select the current standard paragraph +" +" Return 1, if the paragraph is the last one in the document. +function! tlib#textobjects#StandardParagraph() "{{{3 + if line("'}") == line('$') + norm! vip + return 1 + else + norm! vap + return 0 + endif +endf + + +function! tlib#textobjects#Init() "{{{3 + if !exists('s:tlib_done_textobjects') + " sp ... Standard paragraph (for use as |text-objects|). + vnoremap <silent> sp <Esc>:call tlib#textobjects#StandardParagraph()<CR> + onoremap <silent> sp :<C-u>normal Vsp<CR> + let s:tlib_done_textobjects = 1 + endif +endf + + +let &cpo = s:save_cpo +unlet s:save_cpo |