Skip to content

Instantly share code, notes, and snippets.

@tsuyoshicho
Created March 17, 2020 03:10
Show Gist options
  • Save tsuyoshicho/a23a859f0b23fc1eeffbf234b572944c to your computer and use it in GitHub Desktop.
Save tsuyoshicho/a23a859f0b23fc1eeffbf234b572944c to your computer and use it in GitHub Desktop.
grep test code
to gist
let s:Grep = s:V.import('App.Grep')
" top grep util
let module_list = s:Grep.modules()
let module_list = s:Grep.modules(prio_list) " prio list sorted
let module = s:Grep.module('name')
" module
if module.is_available()
let instance = module.new()
endif
let name_str = module.name()
let feat_dict = module.feature()
" instance
let cmd_list = instance.command({param_dic}) " list
let cmd_list = instance.grepprg({param_dic}) " list
param_dic
like Grep.execute
but async do not affect
" combination
let result_promise = s:Grep.execute(instance, 'query', {param_dict}) " promise
param_dict
async: 1 (default system-depend)
-> can async, run async/could not async run sync
regex / pattern (exclude)
ignorecase / smartcase (upper compatible)
recursive
---
note problem
vital module bundle config?
multi submodule
-> random
@tsuyoshicho
Copy link
Author

tsuyoshicho commented Mar 17, 2020

let module      = s:Grep.avaliable_module(prio)

is avaliable and highest prio module get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment