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

vim: visual map of '|'

Expand Messages
  • ping
    experts: I spent 2 hours in a sleepless night to troubleshoot this but still no luck... so originally vim has a nice feature that: you block select (with V) a
    Message 1 of 5 , Jan 19, 2013
    • 0 Attachment
      experts:
      I spent 2 hours in a sleepless night to troubleshoot this but still no
      luck...

      so originally vim has a nice feature that:

      you block select (with V) a column
      type I to go insert mode
      type | (capital \) to insert a char "|" to make a table
      esc to go back normal mode
      this will nicely insert a '|' in front of the whole column,

      the even nice thing is that this is repeatable with '.' operation if you
      move you cursor somewhere else.

      but it looks my '|' character was mapped to sth else by some of my
      plugins...

      now if I want to do do the same thing, it becomes:


      you block select (with V) a column
      type I to go insert mode
      type | (capital \) to insert a char "|" to make a table
      <-- right at this point, I see the "|" got inserted in the whole column,
      while I'm still in the insert mode
      esc to go back normal mode

      the problem is, I lost the ability to repeat.

      obviously some plugins/maps changed the default behavior, which, I
      confirmed with "vim -u NONE -U NONE" (that still works fine).

      = here is my troubleshooting effort and result:

      == what happened? imap

      :imap

      ...
      i | * |<Esc>:call <SNR>13_align()<CR>a

      among other things, it gives me this line, looks it got mapped in somewhere.

      also if I clear imap, the problem gone
      :imapclear

      == who did that? align
      from the name above, it looks plugin "align"?

      //this gives me nothing
      grep -nHriE "13_align()" .vim/ | less

      //this prints a lot of messages, among them plugin align brings me attention
      grep -nHriE "align()" .vim/ | less

      == how to fix?

      I tried to mv the plugin files :
      ping@640g-laptop:~$ cd .vim/plugin/
      ping@640g-laptop:~/.vim/plugin$ mv AlignPlugin.vim AlignPlugin.vim.txt
      ping@640g-laptop:~/.vim/plugin$ mv AlignMapsPlugin.vim
      AlignMapsPlugin.vim.txt
      ping@640g-laptop:~/.vim$ cd autoload/
      ping@640g-laptop:~/.vim/autoload$ mv AlignMaps.vim AlignMaps.vim.txt
      ping@640g-laptop:~/.vim/autoload$ mv Align.vim Align.vim.txt

      but not work...


      how to fix the F... issue?


      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Marcin Szamotulski
      ... Hi, ... this will show the file and line number. If it just defined in a plugin directory, you can define an autocommand: au VimEnter * iunmap | which
      Message 2 of 5 , Jan 19, 2013
      • 0 Attachment
        On 04:42 Sat 19 Jan , ping wrote:
        > experts:
        > I spent 2 hours in a sleepless night to troubleshoot this but still no
        > luck...
        >
        > so originally vim has a nice feature that:
        >
        > you block select (with V) a column
        > type I to go insert mode
        > type | (capital \) to insert a char "|" to make a table
        > esc to go back normal mode
        > this will nicely insert a '|' in front of the whole column,
        >
        > the even nice thing is that this is repeatable with '.' operation if you
        > move you cursor somewhere else.
        >
        > but it looks my '|' character was mapped to sth else by some of my
        > plugins...
        >
        > now if I want to do do the same thing, it becomes:
        >
        >
        > you block select (with V) a column
        > type I to go insert mode
        > type | (capital \) to insert a char "|" to make a table
        > <-- right at this point, I see the "|" got inserted in the whole column,
        > while I'm still in the insert mode
        > esc to go back normal mode
        >
        > the problem is, I lost the ability to repeat.
        >
        > obviously some plugins/maps changed the default behavior, which, I
        > confirmed with "vim -u NONE -U NONE" (that still works fine).
        >
        > = here is my troubleshooting effort and result:
        >
        > == what happened? imap
        >
        > :imap
        >
        > ...
        > i | * |<Esc>:call <SNR>13_align()<CR>a
        >
        > among other things, it gives me this line, looks it got mapped in somewhere.
        >
        > also if I clear imap, the problem gone
        > :imapclear
        >
        > == who did that? align
        > from the name above, it looks plugin "align"?
        >
        > //this gives me nothing
        > grep -nHriE "13_align()" .vim/ | less
        >
        > //this prints a lot of messages, among them plugin align brings me attention
        > grep -nHriE "align()" .vim/ | less
        >
        > == how to fix?
        >
        > I tried to mv the plugin files :
        > ping@640g-laptop:~$ cd .vim/plugin/
        > ping@640g-laptop:~/.vim/plugin$ mv AlignPlugin.vim AlignPlugin.vim.txt
        > ping@640g-laptop:~/.vim/plugin$ mv AlignMapsPlugin.vim
        > AlignMapsPlugin.vim.txt
        > ping@640g-laptop:~/.vim$ cd autoload/
        > ping@640g-laptop:~/.vim/autoload$ mv AlignMaps.vim AlignMaps.vim.txt
        > ping@640g-laptop:~/.vim/autoload$ mv Align.vim Align.vim.txt
        >
        > but not work...
        >
        >
        > how to fix the F... issue?
        >
        >
        > --
        > You received this message from the "vim_use" maillist.
        > Do not top-post! Type your reply below the text you are replying to.
        > For more information, visit http://www.vim.org/maillist.php

        Hi,

        To get where the map is actually defined just use this:

        :verbose imap |

        this will show the file and line number. If it just defined in a plugin
        directory, you can define an autocommand:

        au VimEnter * iunmap |

        which will remove this map. You can even define it using maparg()
        function:

        au VimEnter * if maparg('|') != "" | exe "iunmap |" | endif

        I have a bunch of similar unmaps.

        Best regards,
        Marcin

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Benji Fisher
        Also ... will tell you which of your plugins is 13. HTH -- Benji Fisher ... -- You received this message from the vim_use maillist. Do not top-post!
        Message 3 of 5 , Jan 19, 2013
        • 0 Attachment
          Also

          :scriptnames

          will tell you which of your plugins is <SNR>13.

          HTH
          --
          Benji Fisher


          On Sat, Jan 19, 2013 at 7:11 AM, Marcin Szamotulski <mszamot@...> wrote:
          On 04:42 Sat 19 Jan     , ping wrote:
          > experts:
          > I spent 2 hours in a sleepless night to troubleshoot this but still no
          > luck...
          >
          > so originally vim has a nice feature that:
          >
          > you block select (with V) a column
          > type I to go insert mode
          > type | (capital \) to insert a char "|" to make a table
          > esc to go back normal mode
          > this will nicely insert a '|' in front of the whole column,
          >
          > the even nice thing is that this is repeatable with '.' operation if you
          > move you cursor somewhere else.
          >
          > but it looks my '|' character was mapped to sth else by some of my
          > plugins...
          >
          > now if I want to do do the same thing, it becomes:
          >
          >
          > you block select (with V) a column
          > type I to go insert mode
          > type | (capital \) to insert a char "|" to make a table
          > <-- right at this point, I see the "|" got inserted in the whole column,
          > while I'm still in the insert mode
          > esc to go back normal mode
          >
          > the problem is, I lost the ability to repeat.
          >
          > obviously some plugins/maps changed the default behavior, which, I
          > confirmed with "vim -u NONE -U NONE" (that still works fine).
          >
          > = here is my troubleshooting effort and result:
          >
          > == what happened? imap
          >
          > :imap
          >
          > ...
          > i  |           * |<Esc>:call <SNR>13_align()<CR>a
          >
          > among other things, it gives me this line, looks it got mapped in somewhere.
          >
          > also if I clear imap, the problem gone
          > :imapclear
          >
          > == who did that? align
          > from the name above, it looks plugin "align"?
          >
          > //this gives me nothing
          >   grep -nHriE "13_align()" .vim/ | less
          >
          > //this prints a lot of messages, among them plugin align brings me attention
          >   grep -nHriE "align()" .vim/ | less
          >
          > == how to fix?
          >
          > I tried to mv the plugin files :
          > ping@640g-laptop:~$ cd .vim/plugin/
          > ping@640g-laptop:~/.vim/plugin$ mv AlignPlugin.vim AlignPlugin.vim.txt
          > ping@640g-laptop:~/.vim/plugin$ mv AlignMapsPlugin.vim
          > AlignMapsPlugin.vim.txt
          > ping@640g-laptop:~/.vim$ cd autoload/
          > ping@640g-laptop:~/.vim/autoload$ mv AlignMaps.vim AlignMaps.vim.txt
          > ping@640g-laptop:~/.vim/autoload$ mv Align.vim Align.vim.txt
          >
          > but not work...
          >
          >
          > how to fix the F... issue?
          >
          >
          > --
          > You received this message from the "vim_use" maillist.
          > Do not top-post! Type your reply below the text you are replying to.
          > For more information, visit http://www.vim.org/maillist.php

          Hi,

          To get where the map is actually defined just use this:

          :verbose imap |

          this will show the file and line number.  If it just defined in a plugin
          directory, you can define an autocommand:

          au VimEnter * iunmap |

          which will remove this map.  You can even define it using maparg()
          function:

          au VimEnter * if maparg('|') != "" | exe "iunmap |" | endif

          I have a bunch of similar unmaps.

          Best regards,
          Marcin

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • ping
          ... I knew this technique and tried this before sending initial email -- I ... and ... are the same... ... I tried both, none works... -- You received this
          Message 4 of 5 , Jan 19, 2013
          • 0 Attachment
            On 1/19/2013 7:11 AM, Marcin Szamotulski wrote:
            > To get where the map is actually defined just use this:
            >
            > :verbose imap |

            I knew this technique and tried this before sending initial email -- I
            got everything, all the maps... just as if there is no "|" , so :
            :verbose imap |
            and
            :verbose imap
            are the same...

            >
            > this will show the file and line number. If it just defined in a plugin
            > directory, you can define an autocommand:
            >
            > au VimEnter * iunmap |
            >
            > which will remove this map. You can even define it using maparg()
            > function:
            >
            > au VimEnter * if maparg('|') != "" | exe "iunmap |" | endif
            >
            > I have a bunch of similar unmaps.
            I tried both, none works...

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • ping
            ... thanks, I did check a couple of times of that, but didn t really narrow down in my big (over-2K lines) vimrc file to this line: inoremap
            Message 5 of 5 , Jan 19, 2013
            • 0 Attachment
              On 1/19/2013 9:57 AM, Benji Fisher wrote:
              > :scriptnames
              >
              > will tell you which of your plugins is <SNR>13.
              thanks, I did check a couple of times of that, but didn't really narrow
              down in my big (over-2K lines) vimrc file to this line:

              inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a

              which I guess I stole from:
              http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

              I think I missed that because I was trying to search a "|", where really
              a <Bar> should be used.

              same thing goes to the "verbose imap" command, I should have easily
              locate the issue via :
              :verb imap <bar>
              i | * |<Esc>:call <SNR>13_align()<CR>a
              Last set from ~/.vimrc

              now I comment that out and problem got solved.

              thanks for the helps guys!



              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.