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

How to use map to exchange g and G keys?

Expand Messages
  • Steven Starr
    I have been using vim since version 4, and never had this problem before. I have always (in VI before vim and thereafter) used the following to exchange the
    Message 1 of 11 , Jun 2 8:26 AM
      I have been using vim since version 4, and never had this problem before.

      I have always (in VI before vim and thereafter) used the following to
      exchange the use of the g and G keys in my .vimrc file.

      :noremap g G
      :noremap G g

      Now that I've updated to 7.0, this no longer works. It is hard to retrain
      my fingers after 20 years. Help!

      Steve

      --
      Steven Starr
      Mail To: sstarr@...
      Tel: (973) 428-5832
    • Gerald Lai
      ... How does it no longer work? Please provide more info; perhaps an example. -- Gerald
      Message 2 of 11 , Jun 2 2:18 PM
        On Fri, 2 Jun 2006, Steven Starr wrote:

        > I have been using vim since version 4, and never had this problem before.
        >
        > I have always (in VI before vim and thereafter) used the following to
        > exchange the use of the g and G keys in my .vimrc file.
        >
        > :noremap g G
        > :noremap G g
        >
        > Now that I've updated to 7.0, this no longer works. It is hard to retrain
        > my fingers after 20 years. Help!

        How does it no longer work? Please provide more info; perhaps an
        example.
        --
        Gerald
      • Gerald Lai
        ... Now I remember. There was a discussion some time ago on vim@vim.org about this. Read all about it at: Vim 7 mapping change
        Message 3 of 11 , Jun 2 5:02 PM
          On Fri, 2 Jun 2006, Steven Starr wrote:

          >> On Fri, 2 Jun 2006, Steven Starr wrote:
          >>
          >>> I have been using vim since version 4, and never had this problem before.
          >>>
          >>> I have always (in VI before vim and thereafter) used the following to
          >>> exchange the use of the g and G keys in my .vimrc file.
          >>>
          >>> :noremap g G
          >>> :noremap G g
          >>>
          >>> Now that I've updated to 7.0, this no longer works. It is hard to retrain
          >>> my fingers after 20 years. Help!
          >>
          >> How does it no longer work? Please provide more info; perhaps an
          >> example.
          >> --
          >> Gerald
          >
          > Gerald:
          >
          > Previously, if I wanted to move to line 26, I would just type
          >
          > 26 g
          >
          > Now I have to type
          >
          > 26 gg
          >
          > Previously, to get to the last line, I would only have to type
          >
          > g
          >
          > Now I have to type
          >
          > gg
          >
          > And G seems to have no function at all.

          Now I remember. There was a discussion some time ago on vim@...
          about this. Read all about it at:

          Vim 7 mapping change
          http://groups.yahoo.com/group/vim/message/68788

          HTH :)
          --
          Gerald
        • A.J.Mechelynck
          ... IOW, the problem seems to be caused by a gx mapping somewhere in the netrw plugin set. You might try downloading the latest version, probably from Dr.
          Message 4 of 11 , Jun 2 5:32 PM
            Gerald Lai wrote:
            > On Fri, 2 Jun 2006, Steven Starr wrote:
            >
            >>> On Fri, 2 Jun 2006, Steven Starr wrote:
            >>>
            >>>> I have been using vim since version 4, and never had this problem
            >>>> before.
            >>>>
            >>>> I have always (in VI before vim and thereafter) used the following to
            >>>> exchange the use of the g and G keys in my .vimrc file.
            >>>>
            >>>> :noremap g G
            >>>> :noremap G g
            >>>>
            >>>> Now that I've updated to 7.0, this no longer works. It is hard to
            >>>> retrain
            >>>> my fingers after 20 years. Help!
            >>>
            >>> How does it no longer work? Please provide more info; perhaps an
            >>> example.
            >>> --
            >>> Gerald
            >>
            >> Gerald:
            >>
            >> Previously, if I wanted to move to line 26, I would just type
            >>
            >> 26 g
            >>
            >> Now I have to type
            >>
            >> 26 gg
            >>
            >> Previously, to get to the last line, I would only have to type
            >>
            >> g
            >>
            >> Now I have to type
            >>
            >> gg
            >>
            >> And G seems to have no function at all.
            >
            > Now I remember. There was a discussion some time ago on vim@...
            > about this. Read all about it at:
            >
            > Vim 7 mapping change
            > http://groups.yahoo.com/group/vim/message/68788
            >
            > HTH :)
            > --
            > Gerald
            >
            >
            IOW, the problem seems to be caused by a gx mapping somewhere in the
            netrw plugin set. You might try downloading the latest version, probably
            from Dr. Charles "Chip" Campbell's site (astronaut or somesuch). Dr.
            Chip, are you there?


            Best regards,
            Tony.
          • A.J.Mechelynck
            ... P.S. Dr. Chip s site is http://mysite.verizon.net/astronaut/index.html and he uploaded a new version a few days ago to the vim-online site as (IIUC)
            Message 5 of 11 , Jun 2 5:48 PM
              A.J.Mechelynck wrote:
              > Gerald Lai wrote:
              >> On Fri, 2 Jun 2006, Steven Starr wrote:
              >>
              >>>> On Fri, 2 Jun 2006, Steven Starr wrote:
              >>>>
              >>>>> I have been using vim since version 4, and never had this problem
              >>>>> before.
              >>>>>
              >>>>> I have always (in VI before vim and thereafter) used the following to
              >>>>> exchange the use of the g and G keys in my .vimrc file.
              >>>>>
              >>>>> :noremap g G
              >>>>> :noremap G g
              >>>>>
              >>>>> Now that I've updated to 7.0, this no longer works. It is hard to
              >>>>> retrain
              >>>>> my fingers after 20 years. Help!
              >>>>
              >>>> How does it no longer work? Please provide more info; perhaps an
              >>>> example.
              >>>> --
              >>>> Gerald
              >>>
              >>> Gerald:
              >>>
              >>> Previously, if I wanted to move to line 26, I would just type
              >>>
              >>> 26 g
              >>>
              >>> Now I have to type
              >>>
              >>> 26 gg
              >>>
              >>> Previously, to get to the last line, I would only have to type
              >>>
              >>> g
              >>>
              >>> Now I have to type
              >>>
              >>> gg
              >>>
              >>> And G seems to have no function at all.
              >>
              >> Now I remember. There was a discussion some time ago on vim@...
              >> about this. Read all about it at:
              >>
              >> Vim 7 mapping change
              >> http://groups.yahoo.com/group/vim/message/68788
              >>
              >> HTH :)
              >> --
              >> Gerald
              >>
              >>
              > IOW, the problem seems to be caused by a gx mapping somewhere in the
              > netrw plugin set. You might try downloading the latest version,
              > probably from Dr. Charles "Chip" Campbell's site (astronaut or
              > somesuch). Dr. Chip, are you there?
              >
              >
              > Best regards,
              > Tony.
              >
              >
              P.S. Dr. Chip's site is http://mysite.verizon.net/astronaut/index.html
              and he uploaded a new version a few days ago to the vim-online site as
              (IIUC) http://vim.sourceforge.net/scripts/script.php?script_id=1075

              Best regards,
              Tony.
            • Gerald Lai
              ... [snip] ... Or you could simply unmap gx in your vimrc ... as Tony mentioned. You re welcome :) -- Gerald
              Message 6 of 11 , Jun 3 11:15 AM
                On Fri, 2 Jun 2006, Steven Starr wrote:

                >>>> On Fri, 2 Jun 2006, Steven Starr wrote:
                >>>>
                >>>>> I have been using vim since version 4, and never had this problem before.
                >>>>>
                >>>>> I have always (in VI before vim and thereafter) used the following to
                >>>>> exchange the use of the g and G keys in my .vimrc file.
                >>>>>
                >>>>> :noremap g G
                >>>>> :noremap G g
                >>>>>
                >>>>> Now that I've updated to 7.0, this no longer works. It is hard to retrain
                >>>>> my fingers after 20 years. Help!
                [snip]
                >>
                >> Now I remember. There was a discussion some time ago on vim@...
                >> about this. Read all about it at:
                >>
                >> Vim 7 mapping change
                >> http://groups.yahoo.com/group/vim/message/68788
                >>
                >> HTH :)
                >> --
                >> Gerald
                >
                > You are my hero!
                >
                > I checked the netrw plugin, and figured out that all I had to do was introduce a
                > bogus map to prevent it from mapping gx.
                >
                > :map xxxxx <Plug>NetrwBrowseX
                >
                > This works great! Thank you so much. I'm back in business.
                >
                > Steve
                >

                Or you could simply unmap gx in your vimrc

                :unmap gx

                as Tony mentioned.

                You're welcome :)
                --
                Gerald
              • Georg Dahn
                Hi! ... I have done this now and installed it as described in the message, which came on opening the vba file (that is, I did :so %). Now I have two versions
                Message 7 of 11 , Jun 3 11:26 PM
                  Hi!

                  > IOW, the problem seems to be caused by a gx mapping somewhere in the
                  > netrw plugin set. You might try downloading the latest version, probably
                  > from Dr. Charles "Chip" Campbell's site (astronaut or somesuch).

                  I have done this now and installed it as described in the message, which
                  came on opening the vba file (that is, I did :so %). Now I have two
                  versions of netrw: one in vim70/plugin and one in vimfiles/plugin.
                  Which one is used when I use netrw now?

                  Best wishes,
                  Georg









                  ___________________________________________________________
                  All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
                  http://uk.docs.yahoo.com/nowyoucan.html
                • A.J.Mechelynck
                  ... The first one in runtimepath , i.e., the one in $VIM/vimfiles/plugin and $VIM/vimfiles/autorun . There are a few lines at the top of both files which
                  Message 8 of 11 , Jun 4 12:22 AM
                    Georg Dahn wrote:
                    > Hi!
                    >
                    >> IOW, the problem seems to be caused by a gx mapping somewhere in the
                    >> netrw plugin set. You might try downloading the latest version,
                    >> probably from Dr. Charles "Chip" Campbell's site (astronaut or
                    >> somesuch).
                    >
                    > I have done this now and installed it as described in the message, which
                    > came on opening the vba file (that is, I did :so %). Now I have two
                    > versions of netrw: one in vim70/plugin and one in vimfiles/plugin.
                    > Which one is used when I use netrw now?
                    >
                    > Best wishes,
                    > Georg
                    >
                    The first one in 'runtimepath', i.e., the one in $VIM/vimfiles/plugin
                    and $VIM/vimfiles/autorun . There are a few lines at the top of both
                    files which prevents the second one from actually running even if
                    sourced. Thus you may find them both in the output from ":scriptnames"
                    but only the first one is actually executed.

                    See
                    :help :runtime
                    :help 'runtimepath'
                    :set runtimepath?
                    :help :scriptnames
                    :scriptnames
                    :view $VIM/vimfiles/plugin/netrwPlugin.vim
                    :view $VIMRUNTIME/plugin/netrwPlugin.vim


                    You may have to open (with zo ) the fold titled "Load Once" in the scripts.


                    Best regards,
                    Tony.
                  • Yakov Lerner
                    ... I believe that command :scriptnames will show you which one is actually used. Yakov
                    Message 9 of 11 , Jun 4 2:39 AM
                      On 6/4/06, Georg Dahn <gorgyd@...> wrote:
                      > Hi!
                      >
                      > > IOW, the problem seems to be caused by a gx mapping somewhere in the
                      > > netrw plugin set. You might try downloading the latest version, probably
                      > > from Dr. Charles "Chip" Campbell's site (astronaut or somesuch).
                      >
                      > I have done this now and installed it as described in the message, which
                      > came on opening the vba file (that is, I did :so %). Now I have two
                      > versions of netrw: one in vim70/plugin and one in vimfiles/plugin.
                      > Which one is used when I use netrw now?

                      I believe that command :scriptnames will show you which one
                      is actually used.

                      Yakov
                    • Charles E Campbell Jr
                      ... When you run netrw as a browser, the current version is shown in the upper right hand corner. I ve uploaded netrw v100o to my website
                      Message 10 of 11 , Jun 5 7:19 AM
                        Yakov Lerner wrote:

                        > On 6/4/06, Georg Dahn <gorgyd@...> wrote:
                        >
                        >> Hi!
                        >>
                        >> > IOW, the problem seems to be caused by a gx mapping somewhere in the
                        >> > netrw plugin set. You might try downloading the latest version,
                        >> probably
                        >> > from Dr. Charles "Chip" Campbell's site (astronaut or somesuch).
                        >>
                        >> I have done this now and installed it as described in the message, which
                        >> came on opening the vba file (that is, I did :so %). Now I have two
                        >> versions of netrw: one in vim70/plugin and one in vimfiles/plugin.
                        >> Which one is used when I use netrw now?
                        >
                        >
                        > I believe that command :scriptnames will show you which one
                        > is actually used.

                        When you run netrw as a browser, the current version is shown in the
                        upper right
                        hand corner.

                        I've uploaded netrw v100o to my website
                        (http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
                        - see "Network Oriented Reading, Writing, and Browsing). If a mapping
                        exists for g, then the gx mapping
                        will not be made (nor will it be made if the variable g:netrw_nogx
                        exists). However, to get it to work, you'll
                        need to remove vim70/plugin/netrwPlugin.vim.

                        Regards,
                        Chip Campbell
                      • Suresh Govindachar
                        ... Will Bram s updates to the runtime have the latest version? --Suresh
                        Message 11 of 11 , Jun 5 7:34 AM
                          Dr. Chip wrote:

                          > I've uploaded netrw v100o to my website
                          > (http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
                          > - see "Network Oriented Reading, Writing, and Browsing).

                          Will Bram's updates to the runtime have the latest version?

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