mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 02:20:03 +08:00
Update documentation
This commit is contained in:
parent
83bfe0e5e8
commit
35f2e71913
@ -102,6 +102,22 @@ function! SpaceVim#mapping#search#grep(key, scope)
|
||||
\ 'opt' : opt,
|
||||
\ 'ropt' : ropt,
|
||||
\ })
|
||||
elseif a:scope ==# 'd'
|
||||
call SpaceVim#plugins#flygrep#open({
|
||||
\ 'input' : input('grep pattern:'),
|
||||
\ 'dir' : fnamemodify(expand("%"), ":p:h"),
|
||||
\ 'cmd' : cmd,
|
||||
\ 'opt' : opt,
|
||||
\ 'ropt' : ropt,
|
||||
\ })
|
||||
elseif a:scope ==# 'D'
|
||||
call SpaceVim#plugins#flygrep#open({
|
||||
\ 'input' : expand('<cword>'),
|
||||
\ 'dir' : fnamemodify(expand("%"), ":p:h"),
|
||||
\ 'cmd' : cmd,
|
||||
\ 'opt' : opt,
|
||||
\ 'ropt' : ropt,
|
||||
\ })
|
||||
elseif a:scope ==# 'f'
|
||||
call SpaceVim#plugins#flygrep#open({
|
||||
\ 'input' : input('grep pattern:'),
|
||||
|
@ -187,10 +187,10 @@ function! SpaceVim#mapping#space#init() abort
|
||||
" Searching in buffer directory
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'd'], "call SpaceVim#plugins#flygrep#open({'input' :"
|
||||
\ . " input(\"grep pattern:\"), 'dir' : fnamemodify(expand('%'), ':p:h')})",
|
||||
\ 'grep in arbitrary directory', 1)
|
||||
\ 'grep in buffer directory', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'D'], "call SpaceVim#plugins#flygrep#open({'input' :"
|
||||
\ . " expand(\"<cword>\"), 'dir' : fnamemodify(expand('%'), ':p:h')})",
|
||||
\ 'grep cursor word in arbitrary directory', 1)
|
||||
\ 'grep cursor word in buffer directory', 1)
|
||||
" Searching in files in an arbitrary directory
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'f'], "call SpaceVim#plugins#flygrep#open({'input' :"
|
||||
\ . " input(\"grep pattern:\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
|
||||
@ -217,6 +217,9 @@ function! SpaceVim#mapping#space#init() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'b'], 'call SpaceVim#mapping#search#grep("a", "b")', 'search in all buffers with ag', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'B'], 'call SpaceVim#mapping#search#grep("a", "B")',
|
||||
\ 'search cursor word in all buffers with ag', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'd'], 'call SpaceVim#mapping#search#grep("a", "d")', 'search in buffer directory with ag', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'D'], 'call SpaceVim#mapping#search#grep("a", "D")',
|
||||
\ 'search cursor word in buffer directory with ag', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'p'], 'call SpaceVim#mapping#search#grep("a", "p")', 'search in project with ag', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'a', 'P'], 'call SpaceVim#mapping#search#grep("a", "P")',
|
||||
\ 'search cursor word in project with ag', 1)
|
||||
@ -234,6 +237,9 @@ function! SpaceVim#mapping#space#init() abort
|
||||
\ 'search in all buffers with grep', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'B'], 'call SpaceVim#mapping#search#grep("g", "B")',
|
||||
\ 'search cursor word in all buffers with grep', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'd'], 'call SpaceVim#mapping#search#grep("g", "d")', 'search in buffer directory with grep', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'D'], 'call SpaceVim#mapping#search#grep("g", "D")',
|
||||
\ 'search cursor word in buffer directory with grep', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'p'], 'call SpaceVim#mapping#search#grep("g", "p")', 'search in project with grep', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'P'], 'call SpaceVim#mapping#search#grep("g", "P")',
|
||||
\ 'search cursor word in project with grep', 1)
|
||||
@ -250,6 +256,9 @@ function! SpaceVim#mapping#space#init() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'b'], 'call SpaceVim#mapping#search#grep("k", "b")', 'search in all buffers with ack', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'B'], 'call SpaceVim#mapping#search#grep("k", "B")',
|
||||
\ 'search cursor word in all buffers with ack', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'd'], 'call SpaceVim#mapping#search#grep("k", "d")', 'search in buffer directory with ack', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'D'], 'call SpaceVim#mapping#search#grep("k", "D")',
|
||||
\ 'search cursor word in buffer directory with ack', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'p'], 'call SpaceVim#mapping#search#grep("k", "p")', 'search in project with ack', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'k', 'P'], 'call SpaceVim#mapping#search#grep("k", "P")',
|
||||
\ 'search cursor word in project with ack', 1)
|
||||
@ -266,6 +275,9 @@ function! SpaceVim#mapping#space#init() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'b'], 'call SpaceVim#mapping#search#grep("r", "b")', 'search in all buffers with rg', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'B'], 'call SpaceVim#mapping#search#grep("r", "B")',
|
||||
\ 'search cursor word in all buffers with rg', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'd'], 'call SpaceVim#mapping#search#grep("r", "d")', 'search in buffer directory with rg', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'D'], 'call SpaceVim#mapping#search#grep("r", "D")',
|
||||
\ 'search cursor word in buffer directory with rg', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'p'], 'call SpaceVim#mapping#search#grep("r", "p")', 'search in project with rg', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'r', 'P'], 'call SpaceVim#mapping#search#grep("r", "P")',
|
||||
\ 'search cursor word in project with rg', 1)
|
||||
@ -282,6 +294,9 @@ function! SpaceVim#mapping#space#init() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'b'], 'call SpaceVim#mapping#search#grep("t", "b")', 'search in all buffers with pt', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'B'], 'call SpaceVim#mapping#search#grep("t", "B")',
|
||||
\ 'search cursor word in all buffers with pt', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'd'], 'call SpaceVim#mapping#search#grep("t", "d")', 'search in buffer directory with pt', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'D'], 'call SpaceVim#mapping#search#grep("t", "D")',
|
||||
\ 'search cursor word in buffer directory with pt', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'p'], 'call SpaceVim#mapping#search#grep("t", "p")', 'search in project with pt', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'P'], 'call SpaceVim#mapping#search#grep("t", "P")',
|
||||
\ 'search cursor word in project with pt', 1)
|
||||
|
@ -1257,6 +1257,7 @@ The available scopes and corresponding keys are:
|
||||
| Scope | Key |
|
||||
| -------------------------- | --- |
|
||||
| opened buffers | b |
|
||||
| buffer directory | d |
|
||||
| files in a given directory | f |
|
||||
| current project | p |
|
||||
|
||||
@ -1290,6 +1291,23 @@ Notes:
|
||||
| `SPC s r r` | rg |
|
||||
| `SPC s r R` | rg with default input |
|
||||
|
||||
**Searching in buffer directory:**
|
||||
|
||||
| Key Binding | Description |
|
||||
| ----------- | ----------------------------------------------------------- |
|
||||
| `SPC s d` | searching in buffer directory with default tool |
|
||||
| `SPC s D` | searching in buffer directory cursor word with default tool |
|
||||
| `SPC s a d` | searching in buffer directory with ag |
|
||||
| `SPC s a D` | searching in buffer directory cursor word with ag |
|
||||
| `SPC s g d` | searching in buffer directory with grep |
|
||||
| `SPC s g D` | searching in buffer directory cursor word with grep |
|
||||
| `SPC s k d` | searching in buffer directory with ack |
|
||||
| `SPC s k D` | searching in buffer directory cursor word with ack |
|
||||
| `SPC s r d` | searching in buffer directory with rg |
|
||||
| `SPC s r D` | searching in buffer directory cursor word with rg |
|
||||
| `SPC s t d` | searching in buffer directory with pt |
|
||||
| `SPC s t D` | searching in buffer directory cursor word with pt |
|
||||
|
||||
##### Searching in all loaded buffers
|
||||
|
||||
| Key Binding | Description |
|
||||
|
Loading…
Reference in New Issue
Block a user