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

75476Re: [patch] Option to show indent level with 'expandtab' and 'list' option

Expand Messages
  • Amadeus Demarzi
    Mar 3, 2014
      hari.g:

      Overall, this patch is pretty good. A couple things I have noticed:

      1) Seems I must do `set incsearch` AFTER the `set showindent` declaration or else incsearch never gets set?


      2) It would be nice to also highlight the first column on indentations, to match functionality with tabs

      This patch seems far more performant than any plugins attempting to do the same, and I think it would be a valuable addition to vim.

      On Sunday, December 1, 2013 12:07:22 AM UTC-8, hari.g wrote:
      > On Thursday, November 28, 2013 5:50:23 PM UTC+5:30, Bram Moolenaar wrote:
      > ...
      > > > The attached patch adds a 'listchars' option 'lsp' which marks leading
      > >
      > > > space at 'shiftwidth' with the defined characer so that you can follow
      > >
      > > > the indent level in a bit too much nested code when you also have
      > >
      > > > 'expandtab' option set and use spaces for indentation (e.g. Python
      > >
      > > > code in many repos enforce a 'spaces only indenting' policy).
      > >
      > >
      > >
      > > I can't help but reading "lsp" as Lisp...
      > >
      > >
      > >
      > > Can you attach a screenshot, so that we can see what the effect is
      > >
      > > without rebuilding Vim?
      > >
      > >
      > >
      > > The change to Make_mvc.mak seems unrelated.
      > >
      > >
      > >
      > > I guess that most users would prefer highlighting the character, rather
      > >
      > > than replacing it with a printable character.
      > >
      > > I'm not sure this can already done with a :match. Might be tricky.
      > >
      > > It does seem very useful to highlight the indent every 'sw', especially
      > >
      > > for Python. It would clearly show code blocks.
      > >
      >
      > After giving this more thought, I feel that overloading 'list' and 'listchars' to show indentation levels is not right. Also, the other patch mentioned above [1] provides functionality to show space characters when list is set, which is the expected behaviour.
      >
      > Since the need here is to indicate indentation levels, it is better handled by a different option. I've redone the patch in that direction. The attached patch adds two options -- 'showindent' and 'indentmarker'. 'indentmarker' is a character (or a code point) and 'showindent' is a boolean. When 'showindent' is true, the displayed character after each 'shiftwidth' (or 'tabstop' if 'sw' is 0) is changed to 'indentmarker'. This is done for indentation using tabs and space characters. As requested earlier, a sample screenshot is also attached to illustrate the effect.
      >
      > [1] https://groups.google.com/d/msg/vim_dev/dIQHjW1g92s/FPUU_-9N3wYJ
      >
      > --
      > hari.g

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 14 messages in this topic