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

Re: Remove trailing whitespaces

Expand Messages
  • Bohdan Vlasyuk
    ... No, it doesn t honour indent. e.g.: [set cindent] int main() { int foo;| , you ll have: int main() { int foo; ... char
    Message 1 of 8 , Jul 31, 2001
    • 0 Attachment
      On Tue, Jul 31, 2001 at 01:50:06PM +0200, Jurgen Kramer wrote:

      >>> How about "dw" or maybe "ldw"?
      >> Yep. :-). ldw is the one.
      > or, if you want to stay in insert mode, you might want to try <C-O>J
      > instead of <del> on end-of-line.
      No, it doesn't honour indent. e.g.:
      [set cindent]

      int main() {
      int foo;|<-- [cursor]
      char bar;
      }


      press <CR>, you'll have:

      int main() {
      int foo;
      |<-- [cursor]
      char bar;
      }

      next step: <del>:

      int main() {
      int foo;
      char bar;
      }


      however, <C-O>J would do:


      int main() {
      int foo;
      char bar;
      }


      and the thing I *really* need is:

      int main() {
      int foo;
      char bar;
      }




      --
      There are three kinds of people: men, women, and unix.
    • Jürgen Krämer
      Hi, ... well, it depends. This happens when you press before entering any text. It s the same effect as for after , or after creating a new
      Message 2 of 8 , Jul 31, 2001
      • 0 Attachment
        Hi,

        Bohdan Vlasyuk wrote:
        >
        > No, it doesn't honour indent. e.g.:
        > [set cindent]
        >
        > int main() {
        > int foo;|<-- [cursor]
        > char bar;
        > }
        >
        > press <CR>, you'll have:
        >
        > int main() {
        > int foo;
        > |<-- [cursor]
        > char bar;
        > }
        >
        > next step: <del>:
        >
        > int main() {
        > int foo;
        > char bar;
        > }
        >
        > however, <C-O>J would do:
        >
        > int main() {
        > int foo;
        > char bar;
        > }

        well, it depends. This happens when you press <C-O> before entering
        any text. It's the same effect as for <Esc> after <O>, <o> or after
        creating a new line with <CR> in insert mode. Though autoindent puts
        the cursor under resp. over the first non-whitespace of the previous
        line, immediately pressing <Esc> afterwards results in an empty line.

        So entering <any key><Backspace><C-O>J would have given the desired
        effect:

        > int main() {
        > int foo;
        > char bar;
        > }

        I don't know, whether this is a bug or a feature. I think I don't
        like this behaviour in this case, but I also don't know if this might
        easily be changed. And thinking about a different situation: after
        opening a new line under "int foo" with <o>, should <C-O>/^$ find this
        line or not, if it were the only empty line. Perhaps somebody more
        involved with the development could tell us, what the intended
        behaviour of <C-O> is?

        Regards,
        Jürgen

        --
        Jürgen Krämer Softwareentwicklung/-support
        Habel GmbH mailto:software@...
        Hinteres Öschle 2 Tel: (0 74 61) 93 53 15
        78604 Rietheim-Weilheim Fax: (0 74 61) 93 53 99
      • Bohdan Vlasyuk
        ... That s brilliant, but imagine I have :set ve=insert, and i have functions nested one sw deeper. I ll get: int main() { int foo; ... } -- cursor
        Message 3 of 8 , Jul 31, 2001
        • 0 Attachment
          On Tue, Jul 31, 2001 at 01:51:55PM +0100, Mark Zealey wrote:


          >>> however, <C-O>J would do:
          >>>
          >>> int main() {
          >>> int foo;
          >>> char bar;
          > <C-O>gJ
          That's brilliant, but imagine I have :set ve=insert, and i have
          functions nested one 'sw' deeper. I'll get:

          int main() {
          int foo;
          | char bar;
          } \-- cursor

          still broken

          --
          "An open mind has but one disadvantage: it collects dirt."
          -- a saying at RPI
        • Mark Zealey
          ... gJ -- Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more) mark@itsolve.co.uk UL++++ $ G! (GCM/GCS/GS/GM) dpu? s:-@ a16! C++++ $
          Message 4 of 8 , Jul 31, 2001
          • 0 Attachment
            On Tue, Jul 31, 2001 at 02:38:31PM +0200, Jürgen Krämer wrote:

            > > next step: <del>:
            > >
            > > int main() {
            > > int foo;
            > > char bar;
            > > }
            > >
            > > however, <C-O>J would do:
            > >
            > > int main() {
            > > int foo;
            > > char bar;

            <C-O>gJ

            --

            Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more)
            mark@...

            UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
            !E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
            !R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

            (www.geekcode.com)
          • Mark Zealey
            ... how about: gJ == which will join, and then reindent it. I suppose with this ==, you could remove the g -- Mark Zealey (aka JALH on
            Message 5 of 8 , Jul 31, 2001
            • 0 Attachment
              On Tue, Jul 31, 2001 at 03:50:27PM +0300, Bohdan Vlasyuk wrote:

              > On Tue, Jul 31, 2001 at 01:51:55PM +0100, Mark Zealey wrote:
              >
              >
              > >>> however, <C-O>J would do:
              > >>>
              > >>> int main() {
              > >>> int foo;
              > >>> char bar;
              > > <C-O>gJ
              > That's brilliant, but imagine I have :set ve=insert, and i have
              > functions nested one 'sw' deeper. I'll get:
              >
              > int main() {
              > int foo;
              > | char bar;
              > } \-- cursor

              how about:

              <C-O>gJ<C-O>==

              which will join, and then reindent it. I suppose with this ==, you could remove
              the g


              --

              Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more)
              mark@...

              UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
              !E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
              !R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

              (www.geekcode.com)
            Your message has been successfully submitted and would be delivered to recipients shortly.