Skip to content

Instantly share code, notes, and snippets.

@guygurari
Created July 25, 2012 22:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guygurari/3179114 to your computer and use it in GitHub Desktop.
Save guygurari/3179114 to your computer and use it in GitHub Desktop.
Vim paragraph text-object for latex
"
" Defines a paragraph text-object that stops at \\begin / \\end , as well as at ordinary
" paragraph boundaries.
"
" Example: dap deletes the text paragraph and avoids any adjoining environments.
"
autocmd BufRead,BufNewFile *.tex vnoremap ip ?^\s*$\\|\\end<CR>jO/^\s*$\\|\\begin<CR>k$
autocmd BufRead,BufNewFile *.tex vmap ap ip
autocmd BufRead,BufNewFile *.tex omap ip :normal Vip<CR>
autocmd BufRead,BufNewFile *.tex omap ap :normal Vap<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment