diff --git a/.ci/detach_plugin.sh b/.ci/detach_plugin.sh index c5bdb3f33..6d2422b87 100755 --- a/.ci/detach_plugin.sh +++ b/.ci/detach_plugin.sh @@ -65,57 +65,18 @@ main () { _detact lua/spacevim/api/logger.lua _detact lua/spacevim/logger.lua _detact syntax/SpaceVimFlyGrep.vim - _default_readme "FlyGrep.vim" "Grep on the fly in Vim/Neovim" + _detact_bundle FlyGrep README.md + _checkdir plugin + _detact_bundle FlyGrep plugin/FlyGrep.vim + _detact_bundle FlyGrep addon-info.json + _checkdir doc/ + _detact_bundle FlyGrep doc/FlyGrep.txt _detact LICENSE _checkdir plugin - cat < plugin/FlyGrep.vim -"============================================================================= -" FlyGrep.vim --- Fly grep in vim -" Copyright (c) 2016-2022 Shidong Wang & Contributors -" Author: Shidong Wang < wsdjeg@outlook.com > -" URL: https://github.com/wsdjeg/FlyGrep.vim -" License: MIT license -"============================================================================= - -"" -" @section Introduction, intro -" @stylized FlyGrep -" @library -" @order intro version dicts functions exceptions layers api faq -" Fly grep in vim, written in pure vim script for MacVim, gvim and vim version -" 8.0+. -" - -"" -" @section CONFIGURATION, config -" FlyGrep has strong default options, but you can also change the option -" yourself. - -"" -" FlyGrep will start to searching code after a delay, the default value is -" 500ms. -let g:FlyGrep_input_delay = get(g:, 'FlyGrep_input_delay', 500) - -"" -" A list of searching tools will be userd. -let g:FlyGrep_search_tools = get(g:, 'FlyGrep_search_tools', ['ag', 'rg', 'grep', 'pt', 'ack']) - -let g:spacevim_data_dir = get(g:, 'spacevim_data_dir', '~/.cache') - -"" -" Enable FlyGrep statusline -let g:FlyGrep_enable_statusline = get(g:, 'FlyGrep_enable_statusline', 1) - -"" -" Set FlyGrep default command prompt -let g:spacevim_commandline_prompt = get(g:, 'spacevim_commandline_prompt', '➭') - -command! -nargs=0 FlyGrep call FlyGrep#open({}) -EOT git add . git config user.email "wsdjeg@qq.com" git config user.name "SpaceVimBot" - git commit -m "Auto Update" + git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}" git remote add wsdjeg_flygrep https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/FlyGrep.vim.git git push wsdjeg_flygrep master cd - @@ -144,7 +105,7 @@ EOT git add . git config user.email "wsdjeg@qq.com" git config user.name "SpaceVimBot" - git commit -m "Auto Update" + git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}" git remote add wsdjeg_dein_ui https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/dein-ui.vim.git git push wsdjeg_dein_ui master cd - diff --git a/bundle/FlyGrep/README.md b/bundle/FlyGrep/README.md new file mode 100644 index 000000000..aa27838d8 --- /dev/null +++ b/bundle/FlyGrep/README.md @@ -0,0 +1,55 @@ +# 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 s/ :FlyGrep +``` + +Key Binding | Description +-----------| ----------- +`SPC s /` | Searching in project on the fly with default tools + +key binding in FlyGrep buffer: + +Key Binding | Description +-----------| ----------- +`` | close FlyGrep buffer +`` | close FlyGrep buffer +`` | open file at the cursor line +`` | move cursor line down +`` | move cursor line down +`` | move cursor line up +`` | move cursor line up +`` | remove last character +`` | remove the Word before the cursor +`` | remove the Line before the cursor +`` | remove the Line after the cursor +``/`` | Go to the beginning of the line +``/`` | Go to the end of the line + diff --git a/bundle/FlyGrep/addon-info.json b/bundle/FlyGrep/addon-info.json new file mode 100644 index 000000000..941b90981 --- /dev/null +++ b/bundle/FlyGrep/addon-info.json @@ -0,0 +1,5 @@ +{ + "name": "FlyGrep", + "description": "Fly grep in vim", + "author": "Wang Shidong" +} diff --git a/bundle/FlyGrep/doc/FlyGrep.txt b/bundle/FlyGrep/doc/FlyGrep.txt new file mode 100644 index 000000000..146180755 --- /dev/null +++ b/bundle/FlyGrep/doc/FlyGrep.txt @@ -0,0 +1,36 @@ +*FlyGrep.txt* Fly grep in vim +Wang Shidong *FlyGrep* *FlyGrep* + +============================================================================== +CONTENTS *FlyGrep-contents* + 1. Introduction..............................................|FlyGrep-intro| + 2. CONFIGURATION............................................|FlyGrep-config| + +============================================================================== +INTRODUCTION *FlyGrep-intro* + +Fly grep in vim, written in pure vim script for MacVim, gvim and vim version +8.0+. + + +============================================================================== +CONFIGURATION *FlyGrep-config* + +FlyGrep has strong default options, but you can also change the option +yourself. + + *g:FlyGrep_input_delay* +FlyGrep will start to searching code after a delay, the default value is +500ms. + + *g:FlyGrep_search_tools* +A list of searching tools will be userd. + + *g:FlyGrep_enable_statusline* +Enable FlyGrep statusline + + *g:spacevim_commandline_prompt* +Set FlyGrep default command prompt + + +vim:tw=78:ts=8:ft=help:norl: diff --git a/bundle/FlyGrep/plugin/FlyGrep.vim b/bundle/FlyGrep/plugin/FlyGrep.vim new file mode 100644 index 000000000..9af60e7cb --- /dev/null +++ b/bundle/FlyGrep/plugin/FlyGrep.vim @@ -0,0 +1,43 @@ +"============================================================================= +" FlyGrep.vim --- Fly grep in vim +" Copyright (c) 2016-2022 Shidong Wang & Contributors +" Author: Shidong Wang < wsdjeg@outlook.com > +" URL: https://github.com/wsdjeg/FlyGrep.vim +" License: MIT license +"============================================================================= + +"" +" @section Introduction, intro +" @stylized FlyGrep +" @library +" @order intro version dicts functions exceptions layers api faq +" Fly grep in vim, written in pure vim script for MacVim, gvim and vim version +" 8.0+. +" + +"" +" @section CONFIGURATION, config +" FlyGrep has strong default options, but you can also change the option +" yourself. + +"" +" FlyGrep will start to searching code after a delay, the default value is +" 500ms. +let g:FlyGrep_input_delay = get(g:, 'FlyGrep_input_delay', 500) + +"" +" A list of searching tools will be userd. +let g:FlyGrep_search_tools = get(g:, 'FlyGrep_search_tools', ['ag', 'rg', 'grep', 'pt', 'ack']) + +let g:spacevim_data_dir = get(g:, 'spacevim_data_dir', '~/.cache') + +"" +" Enable FlyGrep statusline +let g:FlyGrep_enable_statusline = get(g:, 'FlyGrep_enable_statusline', 1) + +"" +" Set FlyGrep default command prompt +let g:spacevim_commandline_prompt = get(g:, 'spacevim_commandline_prompt', '➭') + +command! -nargs=0 FlyGrep call FlyGrep#open({}) +