Skip to content

How to spin up the quickfix buffer with swoop #33

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

Closed
vpshastry opened this issue Apr 14, 2017 · 8 comments
Closed

How to spin up the quickfix buffer with swoop #33

vpshastry opened this issue Apr 14, 2017 · 8 comments

Comments

@vpshastry
Copy link

Nowhere in the document it says how to start up the quickfix buffer to search. When I use Swoop command it just goes to the first line and deletes it.

@pelodelfuego
Copy link
Owner

Hi,

Sorry for late answer,

Maybe I did not understood properly what is your problem,
Vim-swoop does not use the quickfix buffer, the swoop-buffer is 'regular' buffer with overriden writeBuf command.

Could you detail more where you want to use the quickfix buffer ?

Cheers.

@vpshastry
Copy link
Author

I'm in Normal mode vim. Now I want to search something and that should be listed in a separate buffer like the vim-swoop does. And then I may or may not want to replace that word with something else.

now from the vim normal mode (or in insert mode) how to search in vim-swoop mode so that it lists all the search results in a separate buffer?

@pelodelfuego
Copy link
Owner

Here is what I understand:

You would like to be able to switch the focus (and change window) of the cursor while using vim-swoop ?

If so, this functionality is not implemented yet:
To keep the visualisation buffer centered on the current swoop match we need to ensure the focus to stay on the swoop buffer.

Under the hood moving the cursor on the swoop buffer trigger an event which does the following actions:
1/ switch to visu window
2/ recenter to the current match
3/ switch back to the swoop buffer at cursor's old location.

Does it answer your question ?

@vpshastry
Copy link
Author

No, this is very simple basic question.

In vim normal mode or insert mode how to start vim-swoop?

@pelodelfuego
Copy link
Owner

pelodelfuego commented May 11, 2017

In default binding, you cannot start it from insert mode.

In normal mode (or visual mode), you have 3 options:

  • keymap
  • function
  • command

The most handy might be by keymap:

'l => Swoop()
'ml => SwoopMulti()

default leader is ',' on vim.

You can also define your own bindings.

Another possibility of source of your issue is the swoofBuf file to already exists and being open.
When you start vim-swoop, do you still have one window or does the screen split in 2 and you get 2 buffers ?

@vpshastry
Copy link
Author

"Another possibility of source of your issue is the swoofBuf file to already exists and being open."

Thanks, this was the problem I was facing. That actually brings to my new question, how do I use it as a simple quickfix buffer and each time I open swoop it should search in the buffer I opened from?

Note: My question arises from my main use case to most of the time I use it for searching rather than search-replace. Listing my searches gives me context on the results.

@pelodelfuego
Copy link
Owner

Great !
I'm glad we found the issue =)
actually as improvement I should add a check and delete the swoopBuf is already exists.

For your use case, I think Unite.vim is a better answer (line plugin).
Check at one of the first issue opened here, It was mentioned.

The advantage of vim-swoop relies on several buffer query and replace functionality.

Please, let me know if it answer your question.

Cheers.

@vpshastry
Copy link
Author

Cool, thanks!!

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