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

Re: vim backspace

Expand Messages
  • Yakov Lerner
    ... 2 ways: 1) Normal-mode J 2) :set bs=indent,eol,start and use backspace in insert mode - :he backspace :he J Yakov
    Message 1 of 10 , Sep 30 12:32 PM
      On 9/30/06, samitj <jain.samit@...> wrote:
      >
      > HI,
      >
      > I need help regarding a couple of issues I am facing in vi. I am a new vi
      > user...
      >
      > 1) vi does not allow delete to be continuted to the previous line (X), in
      > other words it doesnt delete the newline. How else am I supposed to append
      > the current line to the end of previous line. Is there way to customize to
      > be able to have delete continue to the previous line. I have not seen an
      > editor that does not allow this...

      2 ways:
      1) Normal-mode J
      2) ':set bs=indent,eol,start' and use backspace
      in insert mode

      -> :he 'backspace' :he J

      Yakov
    • Yakov Lerner
      ... 1. vim -u NONE -U NONE ~/.vimrc 2. Remove your color customizations from .vimrc 3. Save, quit Yakov
      Message 2 of 10 , Sep 30 12:33 PM
        On 9/30/06, samitj <jain.samit@...> wrote:
        > 2) I modified my .vimrc file with some color settings. However, now I just
        > get a blank screen with my xterm color covering the whole screen - cant see
        > any text. HOw do I fix this?

        1. vim -u NONE -U NONE ~/.vimrc
        2. Remove your "color customizations" from .vimrc
        3. Save, quit

        Yakov
      • cga2000
        On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote: [..] ... I find that rather than making extensive changes to my .vimrc, a useful approach is
        Message 3 of 10 , Oct 1, 2006
          On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote:

          [..]

          > 2) I modified my .vimrc file with some color settings. However, now I just
          > get a blank screen with my xterm color covering the whole screen - cant see
          > any text. HOw do I fix this?

          I find that rather than making extensive changes to my .vimrc, a useful
          approach is experimenting in Command-line mode .. one color change at a
          time ..

          This lets you test your changes interactively before adding them to your
          .vimrc.

          Thanks

          cga
        • A.J.Mechelynck
          ... Rather than adding them to your vimrc, you may want to build a colorscheme (a script concerned only with color settings and living in the colors/
          Message 4 of 10 , Oct 1, 2006
            cga2000 wrote:
            > On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote:
            >
            > [..]
            >
            >> 2) I modified my .vimrc file with some color settings. However, now I just
            >> get a blank screen with my xterm color covering the whole screen - cant see
            >> any text. HOw do I fix this?
            >
            > I find that rather than making extensive changes to my .vimrc, a useful
            > approach is experimenting in Command-line mode .. one color change at a
            > time ..
            >
            > This lets you test your changes interactively before adding them to your
            > .vimrc.
            >
            > Thanks
            >
            > cga
            >
            >

            Rather than adding them to your vimrc, you may want to build a colorscheme (a
            script concerned only with color settings and living in the colors/
            subdirectory of a directory named in 'runtimepath'). Note that $VIMRUNTIME/
            and everything under it are reserved for files distributed with Vim: any
            upgrade can silently overwrite anything there, so you should use other trees
            for your own files: $VIM/vimfiles for system-wide scripts, ~/vimfiles or
            ~/.vim (depending on OS) for user-private scripts.

            There are a number of colorschemes in $VIMRUNTIME/colors/ ; I'm adding my own
            rather simple one (attached) as an additional source of inspiration.

            To invoke a colorscheme, use the ":colorscheme" command with the script name
            (not including the .vim extension).

            After making changes to your current colorscheme, ":syntax on" will reapply it.


            Best regards,
            Tony.
          • cga2000
            ... [..] ... This would reload the original colorscheme .. doing a reset defaults or rather original color scheme, if there is one .. so-to-speak .. right? I
            Message 5 of 10 , Oct 1, 2006
              On Sun, Oct 01, 2006 at 08:34:50AM EDT, A.J.Mechelynck wrote:
              > cga2000 wrote:

              [..]

              > There are a number of colorschemes in $VIMRUNTIME/colors/ ; I'm adding
              > my own rather simple one (attached) as an additional source of
              > inspiration.
              >
              > To invoke a colorscheme, use the ":colorscheme" command with the
              > script name (not including the .vim extension).
              >
              > After making changes to your current colorscheme, ":syntax on" will
              > reapply it.

              This would reload the original colorscheme .. doing a "reset defaults"
              or rather original color scheme, if there is one .. so-to-speak ..
              right?

              I don't suppose there's any way I can save the current interactively-
              modified colorscheme to a file? What I mean is that .. I use a given
              colorscheme and make changes to it in a Vim session .. say, I want the
              cusor to be easier to see :-) .. or I don't like the reverse-vid effect
              that hilights searched/found items .. etc.

              So I play with all this stuff for 10 minutes until I like what I see.
              And when I'm done with my changes, I want to save them somewhere .. Now,
              I still need to copy the original colorscheme under a different name and
              edit it manually to implement my changes one at a time, am I correct?

              The way I do this is to split the screen .. so I have the colorscheme in
              one half and my sample practice file in the other .. So, I use the <UP>
              cursor key to retrieve my ":hi" commands .. gnu/screen to copy/paste
              them in the colorscheme in lieu or the original statements .. and save
              my changes to colorscheme_custom .. eg.

              Rather messy but safe .. As long as I can figure out which among the
              dozens of commands I issued were the "final" ones for a particular :hi
              feature, that is ..

              I wasn't too sure where I could look for this (keywords?) .. but I didn't
              find anything like this either in the tips/scripts or in the help files.

              Thanks

              cga
            • A.J.Mechelynck
              ... [...] ... No, because the variable colors_name remembers the name of your colorscheme, and :syntax on uses that variable to load the correct colorscheme.
              Message 6 of 10 , Oct 1, 2006
                cga2000 wrote:
                > On Sun, Oct 01, 2006 at 08:34:50AM EDT, A.J.Mechelynck wrote:
                [...]
                >> After making changes to your current colorscheme, ":syntax on" will
                >> reapply it.
                >
                > This would reload the original colorscheme .. doing a "reset defaults"
                > or rather original color scheme, if there is one .. so-to-speak ..
                > right?

                No, because the variable colors_name remembers the name of your colorscheme,
                and ":syntax on" uses that variable to load the correct colorscheme.

                >
                > I don't suppose there's any way I can save the current interactively-
                > modified colorscheme to a file? What I mean is that .. I use a given
                > colorscheme and make changes to it in a Vim session .. say, I want the
                > cusor to be easier to see :-) .. or I don't like the reverse-vid effect
                > that hilights searched/found items .. etc.

                You can edit your current colorscheme script, save it, ":syntax on" and
                presto! see your new colors. Dr. Chip (aka Charles E. Campbell Jr., PhD) has
                also written a colorscheme editor which is uploaded at vim-online and/or on
                his site. It's called hicolors.vim and I have it but I don't use it because it
                has nasty habits (such as using :map without <buffer> on {lhs}es like ?
                [interfering with backward search] and <LeftMouse> and <RightMouse>
                [interfering with other mouse actions]).

                >
                > So I play with all this stuff for 10 minutes until I like what I see.
                > And when I'm done with my changes, I want to save them somewhere .. Now,
                > I still need to copy the original colorscheme under a different name and
                > edit it manually to implement my changes one at a time, am I correct?

                You shouldn't edit-in-place something that resides in $VIMRUNTIME somewhere;
                but if the colorscheme is your own, you can edit it at will; and even use u
                (undo) to rollback the edits done before the latest save in the current Vim
                session.

                >
                > The way I do this is to split the screen .. so I have the colorscheme in
                > one half and my sample practice file in the other .. So, I use the <UP>
                > cursor key to retrieve my ":hi" commands .. gnu/screen to copy/paste
                > them in the colorscheme in lieu or the original statements .. and save
                > my changes to colorscheme_custom .. eg.
                >
                > Rather messy but safe .. As long as I can figure out which among the
                > dozens of commands I issued were the "final" ones for a particular :hi
                > feature, that is ..

                :hi SomeGroupName

                will tell you which color settings are currently set for highlight group
                SomeGroupName (and :hi _without_ any arguments gives you the colors for _all_
                groups).

                >
                > I wasn't too sure where I could look for this (keywords?) .. but I didn't
                > find anything like this either in the tips/scripts or in the help files.
                >
                > Thanks
                >
                > cga
                >

                I suppose it's explained under ":help :highlight" and below more than anywhere
                else (sections 12 and 13 of syntax.txt -- it's rather lengthy); but it's
                mainly something you have to "learn by doing".


                Best regards,
                Tony.
              • Yakov Lerner
                ... Did you try all existing colorshemes before trying to come up with your own ? I can recommend two things with regard to this: 1)
                Message 7 of 10 , Oct 1, 2006
                  On 9/30/06, samitj <jain.samit@...> wrote:
                  > 2) I modified my .vimrc file with some color settings. However, now I just
                  > get a blank screen with my xterm color covering the whole screen - cant see
                  > any text. HOw do I fix this?

                  Did you try all existing colorshemes before trying to come up
                  with your own ?

                  I can recommend two things with regard to this:

                  1) http://www.vim.org/scripts/script.php?script_id=625
                  Colors Sampler Pack : All the color schemes on vim.sf.net -- 140
                  colorschemes in one download.
                  2) http://www.vim.org/scripts/script.php?script_id=1488
                  ScrollColors : Colorsheme Scroller, Chooser, and Browser .
                  With ScrollColors you can preview 140 colorschemes in matter of minutes.

                  Yakov
                • cga2000
                  ... [..] ... I think I was unclear. What I m doing is using an existing colorscheme as a template. I proceed to make some changes to it while editing some
                  Message 8 of 10 , Oct 1, 2006
                    On Sun, Oct 01, 2006 at 12:29:24PM EDT, A.J.Mechelynck wrote:
                    > cga2000 wrote:

                    [..]

                    > I suppose it's explained under ":help :highlight" and below more than
                    > anywhere else (sections 12 and 13 of syntax.txt -- it's rather lengthy);
                    > but it's mainly something you have to "learn by doing".

                    I think I was unclear.

                    What I'm doing is using an existing colorscheme as a template.

                    I proceed to make some changes to it while editing some sample file ..
                    Could be C code .. email .. python .. latex .. html whatever. This
                    gives me instant feedback so I can see with my own eyes whether I have a
                    pleasant and "readable" shade of grey .. pink .. blue .. etc.

                    Heck .. I use a 256-color xterm and well I'm working on it but I haven't
                    yet managed to memorize all of them .. color113 .. color178 .. I don't
                    even know if they're reds.. greens .. or blues.

                    I thought that doing it this way would make it a lot more easier than
                    coding a colorscheme from scratch and hoping for the best.

                    But then I went looking for a "save current colorscheme" feature and
                    didn't find one. So I had to go through the hassle of figuring out what
                    I did by retrieving the successive commands that I issued.

                    Just another case of barking the wrong tree .. just editing the color
                    scheme in one half of my display .. saving it and loading the modified
                    version to check the results is just as quick and decidedly better than
                    issuing :hi commands manually since it ..

                    1. saves a good deal of typing .. and ..

                    2. once you're satisfied with the result .. you're done. The last
                    version of the colorscheme that you saved corresponds exactly to what
                    you are looking at.

                    Thanks for helping me figure out a more sensible methodology.

                    cga
                  • Charles E Campbell Jr
                    ... Perhaps http://vim.sourceforge.net/scripts/script.php?script_id=1081 will be helpful for what you want to do. Interactively adjust the colorscheme using
                    Message 9 of 10 , Oct 2, 2006
                      cga2000 wrote:

                      >I don't suppose there's any way I can save the current interactively-
                      >modified colorscheme to a file?
                      >

                      Perhaps http://vim.sourceforge.net/scripts/script.php?script_id=1081
                      will be helpful for what
                      you want to do. Interactively adjust the colorscheme using hicolors'
                      colorscheme editor, then save it.

                      Regards,
                      Chip Campbell
                    • cga2000
                      ... I ll take a look. It may give me ideas on how to improve the methodology outlined in my previous message. Only problem I see is that I don t use a mouse.
                      Message 10 of 10 , Oct 2, 2006
                        On Mon, Oct 02, 2006 at 04:07:10PM EDT, Charles E Campbell Jr wrote:
                        > cga2000 wrote:
                        >
                        > >I don't suppose there's any way I can save the current interactively-
                        > >modified colorscheme to a file?
                        > >
                        >
                        > Perhaps http://vim.sourceforge.net/scripts/script.php?script_id=1081
                        > will be helpful for what
                        > you want to do. Interactively adjust the colorscheme using hicolors'
                        > colorscheme editor, then save it.

                        I'll take a look. It may give me ideas on how to improve the
                        methodology outlined in my previous message.

                        Only problem I see is that I don't use a mouse.

                        Thanks

                        cga
                      Your message has been successfully submitted and would be delivered to recipients shortly.