1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 02:50:06 +08:00

Fix flygrep detach script

This commit is contained in:
Shidong Wang 2020-10-11 23:33:16 +08:00
parent 154510d15a
commit 9dbcb8c5b0

View File

@ -48,63 +48,7 @@ main () {
_detect autoload/SpaceVim/mapping/search.vim
_detect autoload/SpaceVim/logger.vim
_detect syntax/SpaceVimFlyGrep.vim
cat <<EOT > README.md
# FlyGrep.vim
> Asynchronously fly grep in vim
This plugin is automatically detach from [SpaceVim](https://github.com/SpaceVim/SpaceVim/). you can use it without SpaceVim.
![searching project](https://user-images.githubusercontent.com/13142418/35278709-7856ed62-0010-11e8-8b1e-e6cc6374b0dc.gif)
## Install
for dein.vim
```vim
call dein#add('wsdjeg/FlyGrep.vim')
```
for vim-plug
```vim
Plug 'wsdjeg/FlyGrep.vim'
```
## usage
```
:FlyGrep
```
you also can define custom mapping, for example:
```vim
nnoremap <Space>s/ :FlyGrep<cr>
```
Key Binding | Description
-----------| -----------
`SPC s /` | Searching in project on the fly with default tools
key binding in FlyGrep buffer:
Key Binding | Description
-----------| -----------
`<Esc>` | close FlyGrep buffer
`<C-c>` | close FlyGrep buffer
`<Enter>` | open file at the cursor line
`<Tab>` | move cursor line down
`<C-j>` | move cursor line down
`<S-Tab>` | move cursor line up
`<C-k>` | move cursor line up
`<Bs>` | remove last character
`<C-w>` | remove the Word before the cursor
`<C-u>` | remove the Line before the cursor
`<C-k>` | remove the Line after the cursor
`<C-a>`/`<Home>` | Go to the beginning of the line
`<C-e>`/`<End>` | Go to the end of the line
EOT
_default_readme "FlyGrep.vim" "Grep on the fly in Vim/Neovim"
_detect LICENSE
_checkdir plugin
cat <<EOT > plugin/FlyGrep.vim
@ -139,11 +83,7 @@ let g:FlyGrep_input_delay = 500
" A list of searching tools will be userd.
let g:FlyGrep_search_tools = ['ag', 'rg', 'grep', 'pt', 'ack']
let g:spacevim_data_dir
\ = $XDG_CACHE_HOME != ''
\ ? $XDG_CACHE_HOME . SpaceVim#api#import('file').separator
\ : expand($HOME. join(['', '.cache', ''],
\ SpaceVim#api#import('file').separator))
let g:spacevim_data_dir = '~/.cache'
""
" Enable FlyGrep statusline