Loading ...
Sorry, an error occurred while loading the content.

29982Re: Feature request: Indent level objects

Expand Messages
  • Yegappan Lakshmanan
    Oct 3, 2002
    • 0 Attachment
      --- Bram Moolenaar <Bram@...> wrote:
      >
      > Yegappan Lakshmanan wrote:
      >
      > > I saw a feature request on the comp.editors newsgroup for adding
      > > indent level objects to Vim. I think this will be useful.
      > >
      > > I have the attached a Vim plugin (somebody posted this plugin to
      > > the vim mailing list sometime back) that allows you to jump
      > > between different indents. I think this feature should be part
      > > of Vim. This can be used across different language source files
      > > and other files.
      >
      > I have been trying out a number of similar commands for Python. I'll
      > include them below. Also, Benji Fisher wrote something for this. It's
      > mostly for using "%", but also other things. I don't know where he made
      > it available.
      >
      > When comments are given I can decide what should end up in the Python
      > filetype plugin.

      If this support is available only in the python filetype plugin, then
      this cannot be used while editing other files. For example, when you
      are editing a C file, you can use this feature to jump from one case
      statement to the start of next case statement.

      - Yegappan

      >
      >
      > nnoremap <silent> <buffer> ]} :call <SID>Python_find(1)<cr>
      > nnoremap <silent> <buffer> [{ :call <SID>Python_find(-1)<cr>
      >
      > fun! <SID>Python_find(add)
      > let lnum = line(".")
      > let indent = indent(lnum)
      > while 1
      > let lnum = lnum + a:add
      > if lnum < 1 || lnum > line("$")
      > return
      > endif
      > if indent(lnum) < indent && getline(lnum) =~ '\S'
      > break
      > endif
      > endwhile
      > exe lnum
      > endfun
      >
      > --
      > hundred-and-one symptoms of being an internet addict:
      > 116. You are living with your boyfriend who networks your respective
      > computers so you can sit in separate rooms and email each other
      >
      > /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      > /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
      > \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      > \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///


      __________________________________________________
      Do you Yahoo!?
      New DSL Internet Access from SBC & Yahoo!
      http://sbc.yahoo.com
    • Show all 4 messages in this topic