Merge pull request #19 from jremmen/window-location

Allow setting of quickfix window location
This commit is contained in:
John Remmen 2018-03-11 14:35:43 -07:00 committed by GitHub
commit 88ce3691b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View file

@ -7,14 +7,15 @@ Word under cursor will be searched if no argument is passed to `Rg`
## configuration
| Setting | Default | Details
| -----------------|---------------------------|----------
| g:rg_binary | rg | path to rg
| g:rg_format | %f:%l:%c:%m | value of grepformat
| g:rg_command | g:rg_binary --vimgrep | search command
| g:rg_highlight | false | true if you want matches highlighted
| g:rg_derive_root | false | true if you want to find project root from cwd
| g:rg_root_types | ['.git'] | list of files/dir found in project root
| Setting | Default | Details
| ---------------------|---------------------------|----------
| g:rg_binary | rg | path to rg
| g:rg_format | %f:%l:%c:%m | value of grepformat
| g:rg_command | g:rg_binary --vimgrep | search command
| g:rg_highlight | false | true if you want matches highlighted
| g:rg_derive_root | false | true if you want to find project root from cwd
| g:rg_root_types | ['.git'] | list of files/dir found in project root
| g:rg_window_location | botright | quickfix window location
## misc

View file

@ -20,6 +20,10 @@ if !exists('g:rg_root_types')
let g:rg_root_types = ['.git']
endif
if !exists('g:rg_window_location')
let g:rg_window_location = 'botright'
endif
fun! s:Rg(txt)
call s:RgGrepContext(function('s:RgSearch'), s:RgSearchTerm(a:txt))
endfun
@ -35,7 +39,7 @@ endfun
fun! s:RgSearch(txt)
silent! exe 'grep! ' . a:txt
if len(getqflist())
copen
exe g:rg_window_location 'copen'
redraw!
if exists('g:rg_highlight')
call s:RgHighlight(a:txt)