Thaks for the pointer, but I was really looking for something that doesn't involve adding any special 'fold mark' comments into the code.
Andrew
Hmm, i was trying to get it folding on def/end lines, but it's not going along with my plan, there must be a simple way to do this, have you tried cedet/ecb? It wouldn't suprise me if there is folding stuff in there, although it might take a bit of lisping to setup for ruby.
Thaks for the pointer, but I was really looking for something that doesn't involve adding any special 'fold mark' comments into the code.
You can tell emacs to hide anything that's indented farther than X characters in any buffer. set-selective-display (C-x $) hides lines with indentation > count, or shows everything if you don't give it a count. See the docs for that function for more information.
Jim
--
Jim Menard, jimm@io.com, http://www.io.com/~jimm
"I have a red sign on my door. It says 'If this sign is blue, you're moving
too fast.'"
-- pyros on slashdot
I spent a few hours feeling like somebody had chopped my arms off,
but now I'm getting to grips with vims modal system.
If it makes you feel any better, it doesn't take too long for the modal
system (and other aspects of Vim) to become second nature. I've been using
it as my editor of choice for about 7 years (wow, I've never really
thought about that.) Of course the crazy thing is if I read through the
help there is still new things I learn. But as usual the 80/20 rule
applies, and there is a relatively small subset of commands I use
regularly (so don't fret about having to learn the probably thousands of
commands/features that Vim has.)
Plus there is a certain power in knowing how to use any vi-like editor.
You will never feel helpless at a Unix shell, like a lot of people do.
Just the other day I had to help a coworker to just exit Vim, hehehe, and
he is an experienced developer in his late 40s
Also as you probably know Vim is ported to just about any modern OS you
would want to use (and many you wouldn't
This is getting a bit off topic, but to conclude I would recommend you
look up the following commands in Vim's help, they are some of my
favorites:
>
> I guess my only (very minor) complaint is that the ruby syntax isn't
> *quite* perfect yet, but it's darn good.
It probably never will be but it might get close assuming some common
coding conventions are followed...
I've also found a couple little problems with the syntax parser. Very minor
though.
You can send them to me, the vim-ruby-devel@rubyforge.org list, or enter
them in the bug tracker at http://rubyforge.org/projects/vim-ruby - I'm
not too fussed.
Have you tried emailing the maintainer? Know if he/she is still
active?
It's rumoured that he is...
Regards,
Doug
···
On Wed, Apr 27, 2005 at 05:11:36AM +0900, Andrew Walrond wrote:
On Tuesday 26 April 2005 20:51, Thomas Kirchner wrote:
Thaks for the pointer, but I was really looking for something that doesn't involve adding any special 'fold mark' comments into the code.
Andrew
Hmm, i was trying to get it folding on def/end lines, but it's not going along with my plan, there must be a simple way to do this, have you tried cedet/ecb? It wouldn't suprise me if there is folding stuff in there, although it might take a bit of lisping to setup for ruby.
I got it going with cedet/ecb, i simply installed them both (to /usr/share/emacs/site-lisp/) and added this: to my .emacs
Then after emacs has started type M-x ecb-activate, you should have a window on the left hand side which shows a list
of classes(and methods), buffers, source files in current tree and a directory view. I can't find folding support but i can't imagine how you'd need it with that list (third button click also takes you to each part)If you're still nonplussed i'll send you a screenshot if you like. Hope this helps.
Hmm, i was trying to get it folding on def/end lines, but it's not
going along with my plan, there must be a simple way to do this, have
you tried cedet/ecb? It wouldn't suprise me if there is folding stuff
in there, although it might take a bit of lisping to setup for ruby.
I personally sometimes use hs-minor-mode in combination with
reveal-mode (I use GNU Emacs 22.0.50).
You can send them to me, the vim-ruby-devel@rubyforge.org list, or enter
them in the bug tracker at http://rubyforge.org/projects/vim-ruby - I'm
not too fussed.
> Have you tried emailing the maintainer? Know if he/she is still
> active?
It's rumoured that he is...
This one I found breaks the syntax and folding mechanism:
variable = if something then value1
elsif something then value2
else value3
end
It's not a nice construct, but xemacs and Kate handle it ok, so I guess it
would be nice if vim did too.
I had to replace it with
if something then variable=value1
elsif something then variable=value2
else variable=value3
end
which is obviously handled.
There was another ... can't remember what it was right now though. It'll come
to me...
Andrew
···
On Wednesday 27 April 2005 10:52, Doug Kearns wrote:
No - I haven't tried that. I'll give it a blast. Thanks!
Andrew
···
On Monday 25 April 2005 22:25, kyu wrote:
>
> Hmm, i was trying to get it folding on def/end lines, but it's not
> going along with my plan, there must be a simple way to do this, have
> you tried cedet/ecb? It wouldn't suprise me if there is folding stuff
> in there, although it might take a bit of lisping to setup for ruby.
How can I generate tags for ruby code? Is it possible?
Apparently Exuberant Ctags (http://ctags.sourceforge.net) supports Ruby,
though I haven't used it yet for Ruby (only for Java, my language for
work.) But there are some flaws in the Ruby support, as described here
(toward the bottom):
Also another Vim command related to tags that I actually use more than
Ctrl-] is g], which lists all tags matching what is under the cursor. In
the Java code I work with there are usually a lot of methods named the
same in various places, so this allows navigating to all those methods. It
isn't exactly Eclipse with full code-completion and navigation support,
but it isn't too bad (and Vim is certainly a smaller memory footprint
Speaking of Eclipse, there is a Ruby development plugin, but I haven't
used it much yet, so I don't know how many of the Java features you get
with Eclipse also work with Ruby.
Finally, another Vim "feature" that I can't live without is the "sort-of"
code completion you get with Ctrl-N and Ctrl-P, which can be turned into
tab completion by adding this to your vimrc:
" Make tab do completion in certain cases
function! InsertTabWrapper(direction)
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
elseif "backward" == a:direction
return "\<c-p>"
else
return "\<c-n>"
endif
endfunction