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

29979Re: Feature request: Indent level objects

Expand Messages
  • Bram Moolenaar
    Oct 3, 2002
    • 0 Attachment
      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.

      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("$")
      if indent(lnum) < indent && getline(lnum) =~ '\S'
      exe lnum

      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 ///
    • Show all 4 messages in this topic