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

Re: vim insert mode injection

Expand Messages
  • ping
    ... oh yes this one system.vim of yours looks the culprit ... so looks I have to disable it in my usage case? 28 Benefits: you get completion for system
    Message 1 of 7 , Dec 10, 2012
    • 0 Attachment
      On 12/10/2012 7:21 PM, Marcin Szamotulski wrote:
      > It seems you are using my plugin:). If you update vim to at least 7.3.686
      > (this is documented in the plugin).

      oh yes this one "system.vim" of yours looks the culprit ...
      so looks I have to disable it in my usage case?

      28 " Benefits: you get completion for system commanads and system files.
      29 " Copyright: © Marcin Szamotulski, 2012
      30
      31 " I learned how to do that reading the emacscommandline plugin.
      32 "
      33 " Other plugins with shell like functionality:
      34 " vim-addon-async by Marc Weber:
      https://github.com/MarcWeber/vim-addon-async
      35 " Conque Shell plugin: http://code.google.com/p/conque
      36 " vimproc plugin:
      http://github.com/Shougo/vimproc/tree/master/doc/vimproc.txt
      37 "
      38 " Happy viming,
      39 " Marcin Szamotulski
      40
      41 if !exists("g:system_expand")
      42 let g:system_expand = 1
      43 " If 1 expand % as in the command line.
      44 endif
      45 if !exists("g:system_echocmd")
      46 let g:system_echocmd = 1
      47 endif
      48
      49 fun! <SID>WrapCmdLine() <-----------
      50 let cmdline = getcmdline()
      51 " Add cmdline to history
      52 if cmdline[0:1] == "! "
      53 let cmd = cmdline[2:]
      54 call histadd(":", cmdline)
      55 if g:system_expand
      56 let cmd_split = split(cmd, '\ze\\\@<!%')
      57 let cmd = ""
      58 for hunk in cmd_split
      59 if hunk[0] == '%'
      60 let m = matchstr(hunk,
      '^%\%(:[p8~.htre]\|:g\=s?[^?]*?[^?]*?\)*')
      61 let exp = expand(m)
      62 let cmd .=exp.hunk[len(m):]
      63 else
      64 let cmd .=hunk
      65 endif
      66 endfor
      67 endif
      68 let cmd = escape(cmd, "\"")
      69 let his = "|call histdel(':', -1)"
      70 if g:system_echocmd
      71 return "echo \"".cmd."\n\".system(\"".cmd."\")".his
      72 else
      73 return "echo system(\"".cmd."\")".his
      74 endif
      75 endif
      76 return cmdline
      77 endfun
      78 cnoremap <silent> <CR> <C-\>e<SID>WrapCmdLine()<CR><CR>
      .vim/plugin/system.vim [utf-8] [vim] [78/78,1] [100%]


      --
      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
    • Christian Brabandt
      ... I have noticed this too, when playing with your plugin and using ... the lastest Vim version) regards, Christian -- You received this message from the
      Message 2 of 7 , Dec 10, 2012
      • 0 Attachment
        On Tue, December 11, 2012 01:21, Marcin Szamotulski wrote:
        > On 16:23 Mon 10 Dec , ping wrote:
        >> I'm looking at a handy way to insert curr timestamp when writing, right
        >> in
        >> insert mode , e.g. in following texts I want it injected right after
        >> "today", and continue my writing
        >> [writing in insert mode]
        >> ...the task was finally done today
        >>
        >> so I think this should work:
        >> * C-R
        >> * =
        >> * strftime('%c')
        >> * enter
        >> * p
        >>
        >> but right after I hit enter , I end up with:
        >>
        >> =strftime('%c')
        >> E15: Invalid expression: strftime('%c')^\e<SNR>113_WrapCmdLine()
        >> Press ENTER or type command to continue
        >>
        >> it looks like sth wrong with one of the function defined in some script.
        >>
        >> I tried this to locate the function:
        >> :verbose function <SNR>113_WrapCmdLine()
        >>
        >> it hanging there without a return , so I have to C-c to interupt the
        >> search.
        >>
        >> anyone can help ?
        >>
        >> thanks!

        I have noticed this too, when playing with your plugin and using
        :debug (I had to kill vim to get out of that loop even when using
        the lastest Vim version)

        regards,
        Christian

        --
        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
        ... Indeed. So when I debug scripts I use :cunmap . Best, Marcin -- You received this message from the vim_use maillist. Do not top-post! Type your
        Message 3 of 7 , Dec 11, 2012
        • 0 Attachment
          On 08:07 Tue 11 Dec , Christian Brabandt wrote:
          > On Tue, December 11, 2012 01:21, Marcin Szamotulski wrote:
          > > On 16:23 Mon 10 Dec , ping wrote:
          > >> I'm looking at a handy way to insert curr timestamp when writing, right
          > >> in
          > >> insert mode , e.g. in following texts I want it injected right after
          > >> "today", and continue my writing
          > >> [writing in insert mode]
          > >> ...the task was finally done today
          > >>
          > >> so I think this should work:
          > >> * C-R
          > >> * =
          > >> * strftime('%c')
          > >> * enter
          > >> * p
          > >>
          > >> but right after I hit enter , I end up with:
          > >>
          > >> =strftime('%c')
          > >> E15: Invalid expression: strftime('%c')^\e<SNR>113_WrapCmdLine()
          > >> Press ENTER or type command to continue
          > >>
          > >> it looks like sth wrong with one of the function defined in some script.
          > >>
          > >> I tried this to locate the function:
          > >> :verbose function <SNR>113_WrapCmdLine()
          > >>
          > >> it hanging there without a return , so I have to C-c to interupt the
          > >> search.
          > >>
          > >> anyone can help ?
          > >>
          > >> thanks!
          >
          > I have noticed this too, when playing with your plugin and using
          > :debug (I had to kill vim to get out of that loop even when using
          > the lastest Vim version)
          >
          > regards,
          > Christian
          >
          > --
          > 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

          Indeed. So when I debug scripts I use ":cunmap <CR>".

          Best,
          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
        Your message has been successfully submitted and would be delivered to recipients shortly.