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

Respect splitright and splitbelow options #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shanesmith
Copy link

Fixes a bother of mine.

It does make for a more complex mapping, any suggestions to clean this up are welcome.

Numkil referenced this pull request in Numkil/ag.nvim May 8, 2015
From ack.vim pullrequest rking#142
Also clean up mixed usage of <C-w> and <C-W> while I was editing mappings
@shanesmith
Copy link
Author

Bump!

@Numkil
Copy link

Numkil commented Jun 6, 2015

This works as intended, I merged and tested this in ag.nvim where it worked. 👍

@ches
Copy link
Collaborator

ches commented Jun 6, 2015

Thanks, I agree with fixing the general problem. The way ack.vim's mappings are implemented and configured is brittle and clumsy, I've been thinking about overhauling it along the lines of f04a8a9 from #150 that isn't merged yet, taking that a bit further to probably expose some functions through Plug mappings. This is a good reminder to take splitright and splitbelow into account when working on that too.

This is probably harmless to merge in the meantime. Give me a few days to find time to do some work on ack.vim and I'll likely merge it. Thanks for your patience.

@yujinyuz
Copy link

@shanesmith Hi! This kinda solved my problem here at #241

(I only copied the v: part coz it's what I need right now. But the problem is that every time I open a search result, it goes to the right (as expected) but the height of the pane for search results increases. Does it happen to you too?

@shanesmith
Copy link
Author

@yujinyuz there's already an issue opened for it here #150 =)

@yujinyuz
Copy link

yujinyuz commented Mar 26, 2018

@shanesmith thanks! I just thought it was just my config that got messed up.

@Integralist
Copy link

Seems like I was able to just apply this fix manually...

" help Ack mappings to respect my split settings
let g:ack_mappings = {
  \ "h": "<C-W><CR>:exe 'wincmd ' (&splitbelow ? 'J' : 'K')<CR><C-W>p<C-W>J<C-W>p",
  \ "v": "<C-W><CR>:exe 'wincmd ' (&splitright ? 'L' : 'H')<CR><C-W>p<C-W>J<C-W>p"}

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

Successfully merging this pull request may close these issues.

None yet

5 participants