473,671 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2428
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...@goog lemail.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
4136
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: http://www.2072productions.com/vim/indent/php.vim
9
3390
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 'python test.py' every time
16
3868
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 or tutorials about scripting vim using python anywhere with google.
3
5174
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 to the editor functionality. Emacs is just too bloated these days. jEdit is one of the best GUI editors I've seen, but I've still not seen a GUI editor with the power of those with a non-GUI ancestry. etc. etc.) However, I can't quite figure...
11
1756
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 check it at all). I can't reach sourceforge at the moment, so I have meanwhile put the exe file up at: http://www.aleax.it/Python/gmpy-1.0.win32-py2.4.exe Users of both gmpy and python 2.4 on windows are invited to dowload and install this,...
6
2305
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 ready made .vimrc and ~/.vim/syntax/python.vim. If could find c.vim and cpp.vim these would be useful also. Thanks for any pointer. Len
3
1734
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 function calls while you type. Like you enter... var1,var2=mystring.split( ....and the IDLE shows me a popup saying... "S.split(]) -> list of strings
2
1774
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
1597
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 'catch' could be wrongly indented... (thanks to Gert Muller for finding this issue) You can view its capabilities and download it there:
3
1887
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 danfolkes@gmail.com
0
8926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8824
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8603
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.