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

Re: & xmledit

Expand Messages
  • Tuo Pe
    ... Guess I need to try again. :-) This time, I will place the `let maplocalleader = command closer to `map commands in the xml.vim file. T --
    Message 1 of 11 , Dec 1, 2009
    View Source
    • 0 Attachment
      > It seems to me that, according to Vim's documentation,
      > setting
      > maplocalleader any time before the mappings of xml.vim were
      > defined should have worked.
      >
      > As an experiment, I created a file with the contents shown
      > here:
      >
      >     map <LocalLeader>X :echo "hello
      > X"<CR>
      >     let maplocalleader = ","
      >     map <LocalLeader>Y :echo "hello
      > Y"<CR>
      >     let maplocalleader = ""
      >     map <LocalLeader>Z :echo "hello
      > Z"<CR>
      >
      > and sourced it.  Both the ":map" command and trying
      > the mappings
      > verified that the left-hand sides of the mappings were as
      > expected:
      >
      >     \X
      >     ,Y
      >     \Z
      >
      > It worked for me; I wonder why it didn't work for Tuo Pe.

      Guess I need to try again. :-) This time, I will place the
      `let maplocalleader = ' command closer to `map <LocalLeader>' commands in the xml.vim file.

      T




      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Tuo Pe
      ... For some reason, it didn t work for me. :-( I have this in my ~/.vim/ftplugin/xml.vim file [...] let maplocalleader = , nnoremap
      Message 2 of 11 , Dec 2, 2009
      View Source
      • 0 Attachment
        --- On Mon, 11/30/09, Gary Johnson <garyjohn@...> wrote:
        >     map <LocalLeader>X :echo "hello X"<CR>
        >     let maplocalleader = ","
        >     map <LocalLeader>Y :echo "hello Y"<CR>
        >     let maplocalleader = ""
        >     map <LocalLeader>Z :echo "hello Z"<CR>
        >
        > and sourced it.  Both the ":map" command and trying
        > the mappings
        > verified that the left-hand sides of the mappings were as
        > expected:
        >
        >     \X
        >     ,Y
        >     \Z
        >
        > It worked for me; I wonder why it didn't work for Tuo Pe.

        For some reason, it didn't work for me. :-(

        I have this in my ~/.vim/ftplugin/xml.vim file

        [...]
        let maplocalleader = ","

        nnoremap <silent> <buffer> <LocalLeader>5 :call <SID>Matches()<Cr>
        vnoremap <silent> <buffer> <LocalLeader>5 <Esc>:call <SID>MatchesVisual()<Cr>
        nnoremap <silent> <buffer> <LocalLeader>% :call <SID>Matches()<Cr>
        vnoremap <silent> <buffer> <LocalLeader>% <Esc>:call <SID>MatchesVisual()<Cr>
        nnoremap <silent> <buffer> <LocalLeader>c :call <SID>Change()<Cr>
        nnoremap <silent> <buffer> <LocalLeader>C :call <SID>ChangeWholeTag()<Cr>
        nnoremap <silent> <buffer> <LocalLeader>d :call <SID>Delete()<Cr>
        [...]

        Now when I am editing an xml-file, `\d' works but `,d' doesn't.

        Is there something special in "nnoremap" as compared to "map"?

        Tuo




        --
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Gary Johnson
        ... I don t think so. I don t know what the problem could be. When I lack any insight into a problem, as now, I start with a minimal configuration and test
        Message 3 of 11 , Dec 2, 2009
        View Source
        • 0 Attachment
          On 2009-12-02, Tuo Pe wrote:
          > --- On Mon, 11/30/09, Gary Johnson <garyjohn@...> wrote:
          > >     map <LocalLeader>X :echo "hello X"<CR>
          > >     let maplocalleader = ","
          > >     map <LocalLeader>Y :echo "hello Y"<CR>
          > >     let maplocalleader = ""
          > >     map <LocalLeader>Z :echo "hello Z"<CR>
          > >
          > > and sourced it.  Both the ":map" command and trying
          > > the mappings
          > > verified that the left-hand sides of the mappings were as
          > > expected:
          > >
          > >     \X
          > >     ,Y
          > >     \Z
          > >
          > > It worked for me; I wonder why it didn't work for Tuo Pe.
          >
          > For some reason, it didn't work for me. :-(
          >
          > I have this in my ~/.vim/ftplugin/xml.vim file
          >
          > [...]
          > let maplocalleader = ","
          >
          > nnoremap <silent> <buffer> <LocalLeader>5 :call <SID>Matches()<Cr>
          > vnoremap <silent> <buffer> <LocalLeader>5 <Esc>:call <SID>MatchesVisual()<Cr>
          > nnoremap <silent> <buffer> <LocalLeader>% :call <SID>Matches()<Cr>
          > vnoremap <silent> <buffer> <LocalLeader>% <Esc>:call <SID>MatchesVisual()<Cr>
          > nnoremap <silent> <buffer> <LocalLeader>c :call <SID>Change()<Cr>
          > nnoremap <silent> <buffer> <LocalLeader>C :call <SID>ChangeWholeTag()<Cr>
          > nnoremap <silent> <buffer> <LocalLeader>d :call <SID>Delete()<Cr>
          > [...]
          >
          > Now when I am editing an xml-file, `\d' works but `,d' doesn't.
          >
          > Is there something special in "nnoremap" as compared to "map"?

          I don't think so.

          I don't know what the problem could be. When I lack any insight
          into a problem, as now, I start with a minimal configuration and
          test case, test it, and work towards the actual configuration that
          exhibits the problem. In this case, I'd start with a simple file,
          test.vim, with something like this in it:

          let maplocalleader = ","
          map <LocalLeader>X :echo "hello X"<CR>

          Then I'd start vim like this:

          vim -N -u NONE

          and execute

          :so test.vim

          followed by typing

          ,X

          to see if that works. If it doesn't, your vim could be old, missing
          a feature, or broken, or you've found a bug. If it does work, start
          vim like this:

          vim

          and try again. If it doesn't work, there's something in your
          configuration that's affecting that mapping and the next step is to
          find out what. If it does work, the next step would be to see if
          the test file works as a filetype plugin. That is,

          cd ~/.vim/ftplugin
          mv xml.vim xml.vim.orig
          mv ~/test.vim xml.vim
          vim foo.xml

          and type

          ,X

          If it doesn't work, we'll cross that bridge when we come to it. If
          it does work, then change "map" to "nnoremap", test again. Then add
          <buffer> and <silent> modifiers, and test again. The idea is to
          change your test xml.vim to your actual xml.vim (now xml.vim.orig)
          in steps and see what the difference is that causes the mapping to
          fail.

          That's not the only approach, but it's what I'd suggest at this
          point.

          HTH,
          Gary


          --
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • Andy Wokula
          ... Maybe this command is wrapped in a function? In that case, you have to use ... -- Andy -- You received this message from the vim_use maillist. For more
          Message 4 of 11 , Dec 2, 2009
          View Source
          • 0 Attachment
            Tuo Pe schrieb:
            > --- On Mon, 11/30/09, Gary Johnson <garyjohn@...> wrote:
            >> map <LocalLeader>X :echo "hello X"<CR>
            >> let maplocalleader = ","
            >> map <LocalLeader>Y :echo "hello Y"<CR>
            >> let maplocalleader = ""
            >> map <LocalLeader>Z :echo "hello Z"<CR>
            >>
            >> and sourced it. Both the ":map" command and trying
            >> the mappings
            >> verified that the left-hand sides of the mappings were as
            >> expected:
            >>
            >> \X
            >> ,Y
            >> \Z
            >>
            >> It worked for me; I wonder why it didn't work for Tuo Pe.
            >
            > For some reason, it didn't work for me. :-(
            >
            > I have this in my ~/.vim/ftplugin/xml.vim file
            >
            > [...]
            > let maplocalleader = ","

            Maybe this command is wrapped in a function?
            In that case, you have to use

            :let g:maplocalleader = ","

            :h g:var

            > nnoremap <silent> <buffer> <LocalLeader>5 :call <SID>Matches()<Cr>
            > vnoremap <silent> <buffer> <LocalLeader>5 <Esc>:call <SID>MatchesVisual()<Cr>
            > nnoremap <silent> <buffer> <LocalLeader>% :call <SID>Matches()<Cr>
            > vnoremap <silent> <buffer> <LocalLeader>% <Esc>:call <SID>MatchesVisual()<Cr>
            > nnoremap <silent> <buffer> <LocalLeader>c :call <SID>Change()<Cr>
            > nnoremap <silent> <buffer> <LocalLeader>C :call <SID>ChangeWholeTag()<Cr>
            > nnoremap <silent> <buffer> <LocalLeader>d :call <SID>Delete()<Cr>
            > [...]
            >
            > Now when I am editing an xml-file, `\d' works but `,d' doesn't.
            >
            > Is there something special in "nnoremap" as compared to "map"?



            --
            Andy

            --
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
          • Tuo Pe
            Andy & Gary, thank you so much for taking your time with this. I managed to solve the problem by putting let maplocalleader = , into my .vimrc file. At least
            Message 5 of 11 , Dec 3, 2009
            View Source
            • 0 Attachment
              Andy & Gary,

              thank you so much for taking your time with this. I managed to solve the problem by putting
              let maplocalleader = "," into my .vimrc file. At least that solved the problem.

              I am not at my home computer at the moment, so I cannot check the xml.vim file. But I will try using
              let g:maplocalleader as Andy suggested.

              At any rate, thanks for helping out. :-)

              Tuo Pe





              --
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.