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

Re: unmapping?

Expand Messages
  • Douglas L . Potts
    ... Actually, after reading Adrian s follow-up message, I think it is mapleader that is part of the learning curve here. As part of the Align plugin, it uses
    Message 1 of 6 , Aug 1, 2002
    • 0 Attachment
      On Wed, Jul 31, 2002 at 05:52:28PM -0400 Benji Fisher wrote:
      > On Wednesday, July 31, 2002, at 02:44 PM, Nagle, Adrian wrote:
      >
      > > I recently noticed that it takes a while to move wordwise ('W').  I
      > > just checked the mappings and I do have two mappings defined (WE and
      > > WS).  I don't know where these mappings come from.  Until I find it, I
      > > was going to just ':unm WE'.  But I get an error saying the mapping
      > > doesn't exist.
      > >
      > > What am I doing wrong?  Can't I unmap the WE WS mappings?
      >
      > Something like this happened to me, and it was because the mapping
      > was local. Look at
      >
      > :map WE
      >
      > closely: is there an @ symbol, showing that it is a buffer-local
      > mapping. (If so, that gives a hint as to where it is defined.) To get
      > rid of a local mapping, you need
      >
      > :unmap <buffer> WE

      Actually, after reading Adrian's follow-up message, I think it is
      mapleader that is part of the learning curve here. As part of the Align
      plugin, it uses mapleader in it's mappings (of which <mapleader>WS and
      <mapleader>WE are two). So in answer to this question, I think doing an:
      unmap *mapleader_char*WS
      unmap *mapleader_char*WE

      will do the trick (where mapleader_char is the character set as the
      mapleader, default the backslash).

      Of course, most of this is written for Adrian's sake, as I'm sure that
      Benji (being the Vim guru that you are) is familiar with the
      aforementioned functionality...

      (And Dr. Chip will probably be weighing in, about this time :))

      HTH,
      -Doug

      --
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
      Douglas L. Potts
      "Your company is doomed if your primary product is overhead
      transparencies." -(Scott Adams - The Dilbert principle)
      GPG Fingerprint: 768A EEF8 197A 4C9A 5EF7 DA5B 464C 97DF DCD5 68C2
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    • Nagle, Adrian
      Thanks for the tip. I ve had that suggested several times. Some of my plugins in fact do use . Would this explain why my mappings (which
      Message 2 of 6 , Aug 1, 2002
      • 0 Attachment
        RE: unmapping?

        Thanks for the <Leader> tip.  I've had that suggested several times.  Some of my plugins in fact do use <Leader>.  Would this explain why my mappings (which include search syntax) filter out the backslash?

        However, I still can't manually unman \WE.  :map lists the map as 'WE'.

        I've tried:
        :unm \WE
        :unm WE
        :unm <Leader>WE
        :unm <mapleader>

        In each case, I receive the "E31: no such mapping" error.

        Also, I think Dr. C's e-mail is rejecting me for sending HTML formatted e-mail.  Is it HTML format?  I'm trying to get this resolved with my IT folks (I hate Outlook!).  Sorry for the clutter.

        I'm using VIM 6.1 on NT4.0.

        Adrian
        --
        Adrian Nagle                                 anagle@...
        Thermal Engineer                           TEL: 303-939-6518
        Ball Aerospace & Technologies Corp.        FAX: 303-939-5166
        Boulder, CO                     http://www.ballaerospace.com

          -----Original Message-----
          From:   Douglas L . Potts [SMTP:pottsdl@...]
          Actually, after reading Adrian's follow-up message, I think it is
          mapleader that is part of the learning curve here.  As part of the Align
          plugin, it uses mapleader in it's mappings (of which <mapleader>WS and
          <mapleader>WE are two).  So in answer to this question, I think doing an:
          unmap *mapleader_char*WS
          unmap *mapleader_char*WE

          will do the trick (where mapleader_char is the character set as the
          mapleader, default the backslash).

      • Charles E. Campbell
        ... Hello! The maps in all use (:he mapleader) *except* for WS and WE (which use hardcoded backslashes). I m therefore not sure
        Message 3 of 6 , Aug 1, 2002
        • 0 Attachment
          On Thu, Aug 01, 2002 at 07:47:06AM -0400, Douglas L . Potts wrote:
          > On Wed, Jul 31, 2002 at 05:52:28PM -0400 Benji Fisher wrote:
          > > On Wednesday, July 31, 2002, at 02:44 PM, Nagle, Adrian wrote:
          > >
          > > > I recently noticed that it takes a while to move wordwise ('W').  I
          > > > just checked the mappings and I do have two mappings defined (WE and
          > > > WS).  I don't know where these mappings come from.  Until I find it, I
          > > > was going to just ':unm WE'.  But I get an error saying the mapping
          > > > doesn't exist.
          > > >
          > > > What am I doing wrong?  Can't I unmap the WE WS mappings?

          > (And Dr. Chip will probably be weighing in, about this time :))
          ---------------------------------------------------------------------

          Hello!

          The maps in <AlignMaps.vim> all use <Leader> (:he mapleader) *except*
          for \WS and \WE (which use hardcoded backslashes). I'm therefore not
          sure that Adrian's problem with WS and WE is due to mapleader; perhaps
          the backslash itself has a map??? Try :map \ to see.

          \WS and \WE ideally would be executable from inside the script only,
          but the <buffer> modifier affects the right-hand-side of a map, not its
          visibility.

          So, why not use script-local function calls? Those *can* be made
          effectively visible only with a script and would avoid polluting
          the map namespace. Here's WS() and WE() functions:

          " ---------------------------------------------------------------------

          " WS: wrapper start (internal) Produces a blank line above and
          fu! <SID>WS()
          set lz
          let b:curline=line(".")
          let b:curcol =col(".")
          put =''
          norm! mz'a
          put! =''
          let b:ch= &ch
          set ch=2
          let b:keepsearch=@/
          norm! my'zk
          endfunction

          " ---------------------------------------------------------------------

          " WE: wrapper end (internal) below, marks with 'y and 'z, also lz/unlz mode
          fu! <SID>WE()
          'y,'zs/\s\+$//e
          norm! 'yjmakdd'zdd
          exe "set ch=".b:ch
          unlet b:ch
          exe 'norm! '.b:curline.'G'.b:curcol."\<bar>"
          let @/= b:keepsearch
          set nolz
          endfunction

          " ---------------------------------------------------------------------

          and typical call pattern: :call <SID>WS()<CR>...:call <SID>WE()<CR>

          The problem is that suddenly the maps all become noisy:
          Example: \a, applied to a small test file I have:

          :s/,/;^Mint /g
          :s/,/;^Mint /g
          6 substitutions on 3 lines
          Hit ENTER or type command to continue

          I tried putting <silent> modifiers with the maps, I tried using
          "silent!":

          :silent! call <SID>WS()<CR>...:silent! call <SID>WE()<CR>
          map <silent> <Leader>a, ...etc...

          and the maps are still noisy -- it looks like nearly every ex command
          within them needs to be :silent! 'ed, whereas with the \WS and \WE
          maps (which nominally do the same thing as the functions) that wasn't
          necessary.

          Regards,
          Chip Campbell

          --
          Charles E Campbell, Jr, PhD _ __ __
          Goddard Space Flight Center / /_/\_\_/ /
          cec@... /_/ \/_//_/
          PGP public key: http://www.erols.com/astronaut/pgp.html
        • Nagle, Adrian
          ... I ... and ... it, I ... mapping ... That s what I m confused about. I don t think it has anything to do with any of my plugins (including AlignMaps.vim)
          Message 4 of 6 , Aug 1, 2002
          • 0 Attachment
            RE: [vim] unmapping?

            > On Thu, Aug 01, 2002 at 07:47:06AM -0400, Douglas L . Potts wrote:
            > > On Wed, Jul 31, 2002 at 05:52:28PM -0400 Benji Fisher wrote:
            > > > On Wednesday, July 31, 2002, at 02:44  PM, Nagle, Adrian wrote:
            > > >
            > > > > I recently noticed that it takes a while to move wordwise ('W').  I
            > > > > just checked the mappings and I do have two mappings defined (WE and
            > > > > WS).  I don't know where these mappings come from.  Until I find it, I
            > > > > was going to just ':unm WE'.  But I get an error saying the mapping
            > > > > doesn't exist.
            > > > >
            > > > > What am I doing wrong?  Can't I unmap the WE WS mappings?
            >
            > > (And Dr. Chip will probably be weighing in, about this time :))
            >  ---------------------------------------------------------------------
            >
            > Hello!
            >
            > The maps in <AlignMaps.vim> all use <Leader> (:he mapleader) *except*
            > for \WS and \WE (which use hardcoded backslashes).  I'm therefore not
            > sure that Adrian's problem with WS and WE is due to mapleader; perhaps
            > the backslash itself has a map???  Try  :map \  to see.

            That's what I'm confused about.  I don't think it has anything to do with any
            of my plugins (including AlignMaps.vim) as I've had those for a while.
            Something did however change with the backslash ('\').  I noticed (I was
            messing with menus at the time) that all of a sudden maps with a search
            pattern would "filter" out the backslash.  So a search of "/\(text\) test /\1
            other" would show up as "/(text) test/1 other".  The backslashes disappeared.
            If I escape them with another \, the search map would work.

            I feel this is the same time when I noticed something had to be mapped to 'W'
            since it would stutter when doing wordwise movements.  I figured out that 'WE'
            was a map, so I tried to delete it.  Now I'm stuck with another problem of
            trying to delete what appears to be a map of 'WE' but is defined as '\WE' in a
            plugin.

            Is there some sort of option or something that would all of a sudden require
            backslashes to be escaped?

            In AlignMaps.vim, I changed '\WE' map to '\\WE' and check with :map.  The map
            turns out to be '\WE'.  But I still can't delete it.  I don't think I can
            unmap anything that has a backslash.  I can delete other maps that do not have
            a backslash.

            I appreciate the help.

            Adrian

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