gabesoft / vim-ags

Silver searcher plugin for vim
183 stars 12 forks source link

Open results without creating a new window? #4

Closed af closed 9 years ago

af commented 9 years ago

Hi, Is there a way to open a file from the search results without creating a new window/split? I want the results file to take up the window space I was using before calling :Ags, but it seems to always open the results in a split between search-results.agsv and the old window.

From the docs, it looks like <cr> or ou would do what I want, but it always opens a new window above the search results. Not sure if this is a weird interaction with my .vimrc or something.

Great plugin by the way!

af commented 9 years ago

Commented out most of my .vimrc and <cr> worked as expected. So it looks like there's some conflict here with my configuration. For the record, with my full .vimrc both <cr> and ou are working the same as oa does.

gabesoft commented 9 years ago

ou/enter would work differently if you use 'or' or 'ol' the first time you open a file.

af commented 9 years ago

I reinstalled the plugin to be safe, and it worked correctly at first, but then went back to acting like oa (I never used anything but <cr> to open search results). Any ideas to help debug it, or suggestions on which options/plugins might be conflicting?

gabesoft commented 9 years ago

Oh, I think I would need to add that functionality. Currently, if no file has been opened from the search results <cr>, oa, and ou all open a window above the search results first. Afterwards, <cr> and ou will reuse that same window. But there's no functionality to open in the last used window before the search results opened. So, maybe I'll change <cr> to work that way. Actually, the only time this works that way now is if the file you want to open is already opened.

af commented 9 years ago

@gabesoft Ah ok, that makes sense then. Even if not the default, I would definitely be +1 on having an option to use the last window every time.

gabesoft commented 9 years ago

Fixed 1e3af3c92535acaffe670f068711fcca51dcadda

af commented 9 years ago

Awesome, thanks!