Hopefully, there will be an option letting user making decision in
future.
On the window, vim uses findstr even though you type grep command.
Thanks
Frank
On Apr 6, 12:05 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Apr 6, 1:56 pm, "yixiaodaf...@gmail.com" <yixiaodaf...@gmail.com>
> wrote:
>
>
>
>
>
> > Hi,
>
> > I am using the findstr /f:file.txt /n pattern in my script to search
> > the pattern. After the system the search results
> > have the full path of the file name. However, after dump the result to
> > quickfix window, some of the files are only displayed as relative
> > path. Does anyone know how to fix this?
>
> > Here is the command that I am using:
> > let files = 'c:\cscope.files'
> > let scmd = 'findstr /f:'.files . ' /n ' . a:pattern
> > let search_result = system(scmd)
>
> > exe "redir! > " . tmpfile
> > silent echon search_result
> > redir END
> > exe "silent! cgetfile " . tmpfile
>
> I'm wondering if you considered using the :grep command within Vim,
> which on Windows is already set up to do a findstr search by default.
> It may save you some scripting headaches.
>
> > When I debug the code and echo the search_result, it contains the full
> > path of the results. However, in the quickfix, some files are only
> > displayed without the complete path.
>
> I think the quickfix list tries to make every path relative to the
> current working directory. If you don't have autochdir set, and
> you :cd to some directory containing none of your files (or the root
> directory of whatever drive you are on will probably work), then the
> quickfix list should show full paths.
>
> I'm not sure if there are other ways to accomplish this or not.- Hide quoted text -
>
> - Show quoted text -
--
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
To unsubscribe, reply using "remove me" as the subject.
No comments:
Post a Comment