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

Programatically executing a search and storing regular expression

Expand Messages
  • Tim Johnson
    Here is the snippet from from a function that I wrote: function! StdNextFunction() let fileType = &ft if fileType == taglist execute /function execute
    Message 1 of 3 , Aug 1, 2010
    • 0 Attachment
      Here is the snippet from from a function that I wrote:
      function! StdNextFunction()
      let fileType = &ft
      if fileType == 'taglist'
      execute '/function'
      execute ':nohls'
      elseif fileType == 'php'
      execute '/function '
      execute ':nohls'
      ....
      I bind this to gn
      I press
      gn
      and I find the target string.
      Then, I press
      n
      and I might get an error message that says:
      "No previous regular expression"
      OR
      I might find that a search for a previous regular expression has
      been executed.
      Question:
      What do I need to add the the command strings above that
      'stores' the regular expression?

      thanks
      --
      Tim
      tim at johnsons-web.com or akwebsoft.com
      http://www.akwebsoft.com

      --
      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
    • John Beckett
      ... An example is here (you set the @/ register): http://vim.wikia.com/wiki/Search_for_visually_selected_text John -- You received this message from the
      Message 2 of 3 , Aug 1, 2010
      • 0 Attachment
        Tim Johnson wrote:
        > What do I need to add the the command strings above that
        > 'stores' the regular expression?

        An example is here (you set the @/ register):
        http://vim.wikia.com/wiki/Search_for_visually_selected_text

        John

        --
        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
      • Tim Johnson
        ... Thanks John `:h setreg -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- You received this message from the vim_use maillist.
        Message 3 of 3 , Aug 2, 2010
        • 0 Attachment
          * John Beckett <johnb.beckett@...> [100801 20:32]:
          > Tim Johnson wrote:
          > > What do I need to add the the command strings above that
          > > 'stores' the regular expression?
          >
          > An example is here (you set the @/ register):
          > http://vim.wikia.com/wiki/Search_for_visually_selected_text
          Thanks John
          `:h setreg'

          --
          Tim
          tim at johnsons-web.com or akwebsoft.com
          http://www.akwebsoft.com

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