VIM: Python type indented-block command equivalent to % for C?

P

Paddy3118

Not python:
but python type
indented text

Notice the blank line above.
It could have several
spaces or tabs, and still
be a part of the block
beginning 'Not python:':
The block ends at the
first non-blank line
with less indent.

Assuming that only space characters are allowed
for indenting, is their a way to yank a Python
block like y% works for C , or a way to move to
the end of a block defined by indentation?

I have tried help indent but could not find
anything.

Thanks, Paddy.
 
R

Roel Schroeven

Paddy3118 schreef:
Assuming that only space characters are allowed
for indenting, is their a way to yank a Python
block like y% works for C , or a way to move to
the end of a block defined by indentation?

I have tried help indent but could not find
anything.

I don't know either, but if you find anything, please post it to this
list: I'm looking for such functionality too.
 
A

Antony Scriven

[F-ups set to comp.editors]
> Not python:
> but python type
> indented text
>
> Notice the blank line above.
> It could have several
> spaces or tabs, and still
> be a part of the block
> beginning 'Not python:':
> The block ends at the
> first non-blank line
> with less indent.
>
> Assuming that only space characters are allowed
> for indenting, is their a way to yank a Python
> block like y% works for C , or a way to move to
> the end of a block defined by indentation?

I expect there are scripts for Python. Try googling and
www.vim.org. Anyway I'm not sure that I understand your
description 100%, but try something like this.

:eek:no = /\n.*\%<<C-R>=indent('.')<CR>c\S\\|\%$/+0<CR>

Now try d= y= etc. Also note that I've made it work
linewise. And take look at :help /\%v if you want it to
work with tabs. --Antony
 
P

Paddy3118

Not python:
but python type
indented text

Notice the blank line above.
It could have several
spaces or tabs, and still
be a part of the block
beginning 'Not python:':
The block ends at the
first non-blank line
with less indent.

Assuming that only space characters are allowed
for indenting, is their a way to yank a Python
block like y% works for C , or a way to move to
the end of a block defined by indentation?

I have tried help indent but could not find
anything.

Thanks, Paddy.

I have installed the following plugins for my Python work:
taglist
http://vim-taglist.sourceforge.net/images/taglist_python.gif
python.vim
http://vim.sourceforge.net/scripts/script.php?script_id=30
and Bicycle Repair Man
http://bicyclerepair.sourceforge.net/

- Paddy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top