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

Re: bash-like in vim command-line mode

Expand Messages
  • Anton Sharonov
    Many thanks to Andy and Tony. Now I think I really understand, how Andy s long example (cdouble.vim) works. It s long because it configurable. Last short
    Message 1 of 9 , Sep 29, 2008
    • 0 Attachment
      Many thanks to Andy and Tony. Now I think I really understand,
      how Andy's long example (cdouble.vim) works. It's long because it
      configurable. Last short version is also working fine for me.
      Interesting pattern: '\%(\k\+\|\%(\k\@!\S\)\+\)\s*$' "((one or
      more keyword chars)|(one or more not spaces and not the keyword
      chars)) followed by any number of spaces till the end of line". I
      think I will stay with the last version from Andy.

      So my initial request isn't just solved - it is solved several
      times in the different ways, fulfilling any kind of taste ;)

      Anton.


      2008/9/29, Andy Wokula <anwoku@...>:
      >
      > Andy Wokula schrieb:
      >> cnoremap <script> <C-W> <SID>CopyToB<C-W>
      >> cnoremap <silent> <SID>CopyToB <C-R>=<sid>CopyWordToB()<CR>
      >> cnoremap <C-Y> <C-R>b
      >>
      >> " copy to register b what c_CTRL-W would delete
      >> func! <sid>CopyWordToB()
      >> let cmdlpart = getcmdline()[0 : getcmdpos()-2]
      >
      > " fix:
      > let cmdlpart = strpart(getcmdline(), 0, getcmdpos()-1)
      >
      >> let @b = matchstr(cmdlpart, '\%(\k\+\|\%(\k\@!\S\)\+\)\s*$')
      >> return ""
      >> endfunc
      >
      > --
      > Andy
      >
      >
      > >
      >

      --~--~---------~--~----~------------~-------~--~----~
      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.