473,383 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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


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.

Mar 8 '07 #1
3 2413
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.

--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton

Roel Schroeven
Mar 8 '07 #2
[F-ups set to comp.editors]

Paddy3118 wrote:
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.

:ono = /\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

Mar 8 '07 #3
On Mar 8, 5:02 am, "Paddy3118" <paddy3...@googlemail.comwrote:
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/i...ist_python.gif
python.vim
http://vim.sourceforge.net/scripts/s...p?script_id=30
and Bicycle Repair Man
http://bicyclerepair.sourceforge.net/

- Paddy

Mar 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: John Wellesz | last post by:
If you are coding php using GVIM, you will appreciate this new indent script: Download there: http://www.vim.org/scripts/download_script.php?src_id=3710 or here: ...
9
by: Peter Wu | last post by:
I'm giving vim a try to program Python. The following are the steps I follow to code/test a python program. vi test.py :wq :!python test.py Is there any other way? I don't want to type...
16
by: sb | last post by:
Hello I have a bunch of questions about using python scripting in vim and about editing python with vim. I can install vim with python scripting support, but I can not find docs, examples...
3
by: Kenneth McDonald | last post by:
After looking around at various editors, I've finally decided on (I think :-) ) Vim for my future work. (jed is a great editor, but doesn't do neat things like allow me to write python code to add...
11
by: Alex Martelli | last post by:
Thanks to David Bolen, who did the build, I have been able to make available a win32 packaging for gmpy 1.0 on python 2.4 alpha 2 (should work on any later Python 2.4 as well, but I have no way to...
6
by: Leonard J. Reder | last post by:
Hello, I am looking at configuring vim for Python. Most importantly I need 4 spaces when the tab is hit. I am searching and getting a bit confused. Does anyone know where I can find a set of...
3
by: Christoph Haas | last post by:
Evening, I'm an addicted vim user and don't really use the IDLE for anything more than calculations where I'm too lazy to start KCalc. But one feature is very pretty: the built-in help for...
2
by: stephen | last post by:
I see that the python_fold plugin for vim lets you fold classes/functions, etc. Can someone tell me how to fold/unfold sections? Thanks. Stephen
1
by: John Wellesz | last post by:
For those who use Vim to program in PHP, the version 1.21 of my indent script is available. Changes: - 'try' and 'catch' were not registered as block starters so the '{' after a 'try' or...
3
by: Daniel Folkes | last post by:
I am new to using Vim's scripts. I was wondering if anyone uses Vim-Python and how to use it? This includes things like key bindings and such. Thanks in advance, Daniel Folkes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.