mirror of
https://github.com/jremmen/vim-ripgrep.git
synced 2025-12-26 19:45:29 +08:00
Merge pull request #19 from jremmen/window-location
Allow setting of quickfix window location
This commit is contained in:
commit
88ce3691b6
2 changed files with 14 additions and 9 deletions
17
README.md
17
README.md
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue