Friday, September 8, 2017

how to redefine paragraphs?

I have searched on google using the same words as the subject, but
didn't get too much information. Or didn't understand what I found.
Maybe people in this list can provide for hints on how to google it
more precisely.


So this is what I would like to be able to do.
When editing python code, I would like to be able to define a new type
of paragraph (and this applies only to functions and methods) as:

-- beginning:
the line starting with "def" or " def"

-- end:
the blank line before next "def" or " def"
or
the blank line before next line with content in column 0 (for example,
next class)
or
end of buffer if none of the above are possible.

It would be nice if that works for copying/deleting "paragraphs" -in
order words, for the ip commands-, but also for movements to first and
last line.
Is something like that even possible?
If yes, I only need the correct keywords to investigate it myself.


A second question would be if it is possible w/o messing with current
definition of paragraph.
Just wondering if what I am looking for can be done but things like
ip, or movement like }, keep working as they are.
Maybe with operator-pending mappings to redefine the new boundaries?


Thanks a lot in advance, whether it is possible or not.
Cheers,
Jose

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: