Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate CtrlSF from traditional quickfix list? #252

Open
jesseleite opened this issue Nov 5, 2018 · 6 comments
Open

Populate CtrlSF from traditional quickfix list? #252

jesseleite opened this issue Nov 5, 2018 · 6 comments

Comments

@jesseleite
Copy link

jesseleite commented Nov 5, 2018

Can CtrlSF results be populated from a traditional quickfix window? I'm using another plugin which populates the quickfix, and it'd be cool if we could call a function to transfer what's in the quickfix to CtrlSF to see more context and use CtrlSF's edit mode on the results of this other plugin 😬

@jesseleite
Copy link
Author

Maybe something like ctrlsf#db#SetResultSetFromQuickfix() 🤔

@dyng
Copy link
Owner

dyng commented Nov 6, 2018

It's almost impossible because the context lines to show must exist at first, but in your case, they do not exist at all in anywhere of Vim.

But what plugin are you using to populate the quickfix? If it does also read result from a grep-like program, maybe CtrlSF could adopt that as a new backend.

@jesseleite
Copy link
Author

jesseleite commented Nov 6, 2018

Not a new grep-like, it's just ag under the hood.

I'm using two plugins actually, fzf.vim and vim-agriculture. Fzf.vim has this awesome realtime filtering post-search that's a big part of my workflow. And agriculture provides an awesome :AgRaw command that lets me pass raw command line arguments directly to ag. If you want to know more, I actually just wrote a post detailing my workflow here.

That said, I absolutely love CtrlSF post-search, with how you display and allow editing of results 🔥 But I'd like to combine that with my own call to ag. Anyway...

It's almost impossible because the context lines to show must exist at first, but in your case, they do not exist at all in anywhere of Vim.

If we can't populate from the quickfix, I actually have access to the both the raw ag output, and the filtered results from fzf.vim. Maybe I can pass my ag output into CtrlSF via a function call somehow?

PS. Not sure if you are open to chatting more on Discord? If so, hit me up at jesseleite#8296!

@dyng
Copy link
Owner

dyng commented Nov 6, 2018

Ok, I have got your point, it seems quite possible now. Suppose you have read the source code, add a new argument (like -external) that makes CtrlSF read resultset/output from a given variable, then CtrlSF will do the rest.

Make sure it does not interfere with the async mode.

@jesseleite
Copy link
Author

jesseleite commented Nov 6, 2018

Like?

:CtrlSF -external 'agriculture#ctrlsf_output'

Or a new command like?

:CtrlSFFromExternal 'agriculture#ctrlsf_output'

@dyng
Copy link
Owner

dyng commented Nov 6, 2018

Looks like the -external can not be combined with other arguments, I think a new command may be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants