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

Re: vim70g -- ':set keymap=' doesn't erase 'b:keymap_name'

Expand Messages
  • Bram Moolenaar
    ... I ll delete the b:keymap_name variable when keymap is made empty. ... The statusline is redrawn when keymap is changed. In other (unlikely) situations
    Message 1 of 5 , May 2, 2006
    • 0 Attachment
      Milan Berta wrote:

      > I'm using vim70g at the time.
      >
      > - After loading a keymap (and setting the b:keymap_name variable to
      > anything), unloading it: 'set keymap=', the last command doesn't erase
      > the b:keymap_name variable. I think vim6 doesn't behave this way, but
      > I'm not sure, and I can't reproduce the problem with it. Logical would
      > be if the b:keymap_name variable would be erased with 'set keymap=',
      > wouldn't be.

      I'll delete the b:keymap_name variable when 'keymap' is made empty.

      > - Having '%k' as for the <keymap> in the 'statusline' and executing
      > 'unlet b:keymap_name', the statusline still shows the last
      > b:keymap_name value, and it doesn't disappear.

      The statusline is redrawn when 'keymap' is changed. In other (unlikely)
      situations you need to cause a redraw yourself.

      --
      You can test a person's importance in the organization by asking how much RAM
      his computer has. Anybody who knows the answer to that question is not a
      decision-maker.
      (Scott Adams - The Dilbert principle)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Milan Berta
      ... That helps to change the ( or whatever) to in the statusline. ... Yes, that s happen automatically in my case -- the redrawing. But
      Message 2 of 5 , May 2, 2006
      • 0 Attachment
        On Tue May 02, 2006 at 09:04:06PM +0200, Bram Moolenaar wrote:
        >
        > Milan Berta wrote:
        >
        > > I'm using vim70g at the time.
        > >
        > > - After loading a keymap (and setting the b:keymap_name variable to
        > > anything), unloading it: 'set keymap=', the last command doesn't erase
        > > the b:keymap_name variable. I think vim6 doesn't behave this way, but
        > > I'm not sure, and I can't reproduce the problem with it. Logical would
        > > be if the b:keymap_name variable would be erased with 'set keymap=',
        > > wouldn't be.
        >
        > I'll delete the b:keymap_name variable when 'keymap' is made empty.

        That helps to change the <czech> (<polish> or whatever) to <lang> in the
        statusline.

        > > - Having '%k' as for the <keymap> in the 'statusline' and executing
        > > 'unlet b:keymap_name', the statusline still shows the last
        > > b:keymap_name value, and it doesn't disappear.
        >
        > The statusline is redrawn when 'keymap' is changed. In other (unlikely)
        > situations you need to cause a redraw yourself.

        Yes, that's happen automatically in my case -- the redrawing. But after
        ':set keymap=' and 'unlet b:keymap_name' there is still an annoying
        '<lang>' note in the statusline at the place of '%k' (e.g. for

        set statusline=%f\ %(%k%)

        ). It's cosmetical for me -- I'm just reporting.

        Best regards,
        Milan
      • Milan Berta
        ... After a little searching I find a solution for needless : function KeymapExists() if exists( b:keymap_name ) return else
        Message 3 of 5 , May 2, 2006
        • 0 Attachment
          On Tue May 02, 2006 at 09:04:06PM +0200, Bram Moolenaar wrote:
          >
          > Milan Berta wrote:
          >
          > > I'm using vim70g at the time.
          > >
          > > - After loading a keymap (and setting the b:keymap_name variable to
          > > anything), unloading it: 'set keymap=', the last command doesn't erase
          > > the b:keymap_name variable. I think vim6 doesn't behave this way, but
          > > I'm not sure, and I can't reproduce the problem with it. Logical would
          > > be if the b:keymap_name variable would be erased with 'set keymap=',
          > > wouldn't be.
          >
          > I'll delete the b:keymap_name variable when 'keymap' is made empty.
          >
          > > - Having '%k' as for the <keymap> in the 'statusline' and executing
          > > 'unlet b:keymap_name', the statusline still shows the last
          > > b:keymap_name value, and it doesn't disappear.
          >
          > The statusline is redrawn when 'keymap' is changed. In other (unlikely)
          > situations you need to cause a redraw yourself.

          After a little searching I find a solution for needless '<lang>':

          function KeymapExists()
          if exists('b:keymap_name')
          return '<'.b:keymap_name.'>'
          else
          return ''
          endif
          endfunction
          set statusline=%f\ %{KeymapExists()}


          Thanks for the great editor!

          Best regards,
          Milan
        • Bram Moolenaar
          ... The is displayed because language mappings are effective. Set iminsert to zero if you want to get rid of it. -- Every engineer dreams about
          Message 4 of 5 , May 3, 2006
          • 0 Attachment
            Milan Berta wrote:

            > > > I'm using vim70g at the time.
            > > >
            > > > - After loading a keymap (and setting the b:keymap_name variable to
            > > > anything), unloading it: 'set keymap=', the last command doesn't erase
            > > > the b:keymap_name variable. I think vim6 doesn't behave this way, but
            > > > I'm not sure, and I can't reproduce the problem with it. Logical would
            > > > be if the b:keymap_name variable would be erased with 'set keymap=',
            > > > wouldn't be.
            > >
            > > I'll delete the b:keymap_name variable when 'keymap' is made empty.
            >
            > That helps to change the <czech> (<polish> or whatever) to <lang> in the
            > statusline.
            >
            > > > - Having '%k' as for the <keymap> in the 'statusline' and executing
            > > > 'unlet b:keymap_name', the statusline still shows the last
            > > > b:keymap_name value, and it doesn't disappear.
            > >
            > > The statusline is redrawn when 'keymap' is changed. In other (unlikely)
            > > situations you need to cause a redraw yourself.
            >
            > Yes, that's happen automatically in my case -- the redrawing. But after
            > ':set keymap=' and 'unlet b:keymap_name' there is still an annoying
            > '<lang>' note in the statusline at the place of '%k' (e.g. for
            >
            > set statusline=%f\ %(%k%)
            >
            > ). It's cosmetical for me -- I'm just reporting.

            The <lang> is displayed because language mappings are effective. Set
            'iminsert' to zero if you want to get rid of it.

            --
            Every engineer dreams about saving the universe and having sex with aliens.
            This is much more glamorous than the real life of an engineer, which consists
            of hiding from the universe and having sex without the participation of other
            life forms. (Scott Adams - The Dilbert principle)

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ download, build and distribute -- http://www.A-A-P.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
          Your message has been successfully submitted and would be delivered to recipients shortly.