473,385 Members | 1,582 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,385 software developers and data experts.

Folding in vim

My general attitude towards IDEs and editors has been
extremely conservative, but today I decided to see what
this "folding" business was all about.

I see that vim (and gvim, which is what I actually use)
has this feature, and it is fairly nice, but at present it's
very manual --- and frankly it's hard for me to see the
point if I have to manually mark folds every time I start
up.

I tried to load a couple of different scripts to
automatically fold Python code in vim, but none of them
seems to do a good job.

The obvious thing (to me) would be for functions and
classes to be folded at the top level, with each method
folded inside the class folds. But I can't seem to figure
out how to make that happen (other than manually,
I mean). Actually, I usually want to fold the comment
block at the top with the license disclaimer and module
documentation, too, but I can do that manually.

I've tried:
python_fold.vim by Jorrit Wiersma
http://www.vim.org/scripts/script.php?script_id=515
and
AutoFold.vim by Dave Vehrs
http://www.vim.org/scripts/script.php?script_id=925

Does anybody have a better suggestion (or perhaps can
tell me how to make one of these do what I'm wanting)?

I'm assuming that I can set these by using the
Tools -> Folding -> Fold Method -> Syntax
(or Expression for python_fold)

but it doesn't seem to work. python_fold seems to just
collapse methods (but not the whole classes they are in),
and I can't seem to make AutoFold do anything at all, so
I must be using it wrong.

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com

Jul 19 '05 #1
0 1305

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

Similar topics

1
by: Nuff Said | last post by:
Question: Is there a way to unfold a Python class *without* unfolding all its methods etc. so that you can get a quick overview of the class? Details: I normally open a file either with...
0
by: Jorge Godoy | last post by:
Hi! Does anyone here have a recipe or elisp code to fold classes or methods in XEmacs while using python mode? The standard folding mode didn't worked out of the box here... -- Godoy. ...
7
by: Anshul Sawant | last post by:
Have a look at the following code: #include<iostream> using namespace std; int main() { const int a = 1; const int* const aptr1 = &a;
0
by: Steve - DND | last post by:
I tried asking this in the VSNet.General newsgroup, but got no response; so I figured I would ask here. Is there any way that I can fold my HTML code in VS.Net for ASP.Net pages? This is a...
5
by: robert.h.lowe | last post by:
Hi, I'm looking for a computationally fast means of XOR folding the individual bytes of an unsigned 32-bit int, and an unsigned 16-bit int. Can I point a char * at the address of each of the...
14
by: John Salerno | last post by:
Specifically, I'm using UltraEdit and perhaps there's no way perfect way to implement code folding with it, given how it uses its syntax highlighting file to do so (i.e., you have to specify an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.