mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Open search results vertically goes to left most instead of right. #241

Closed yujinyuz closed 6 years ago

yujinyuz commented 6 years ago

I have enabled

set splitright

on my ~/.vimrc

But every time I do a search and press v to open the file vertically, it goes to the left most pane and not opening a new pane to the right.

Can anyone help me with this?

IlyaUmanets commented 5 years ago

@yujinyuz, hey, how did you manage it?

Integralist commented 3 years ago

Looks like s:ack_mappings will extend the data structure using g:ack_mappings if set...

" 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"}