Skip to content

Commit

Permalink
Improve todo manager (SpaceVim#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdjeg authored Oct 23, 2019
1 parent abe59e3 commit 37f1cf4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
Empty file.
34 changes: 32 additions & 2 deletions autoload/SpaceVim/plugins/todo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@

let s:JOB = SpaceVim#api#import('job')
let s:BUFFER = SpaceVim#api#import('vim#buffer')
let s:SYS = SpaceVim#api#import('system')

" @question any other recommanded tag?
let s:labels = map(['fixme', 'question', 'todo', 'idea'], '"@" . v:val')

let [
\ s:grep_default_exe,
\ s:grep_default_opt,
\ s:grep_default_ropt,
\ s:grep_default_expr_opt,
\ s:grep_default_fix_string_opt,
\ s:grep_default_ignore_case,
\ s:grep_default_smart_case
\ ] = SpaceVim#mapping#search#default_tool()

function! SpaceVim#plugins#todo#list() abort
call s:open_win()
endfunction
Expand All @@ -36,8 +47,27 @@ endfunction
function! s:update_todo_content() abort
let s:todos = []
let s:todo = {}
" @fixme fix the rg command for todo manager
let argv = ['rg','--hidden', '--no-heading', '-g', '!.git', '--color=never', '--with-filename', '--line-number', '--column', '-e', join(s:labels, '|'), '.']
let argv = [s:grep_default_exe] +
\ s:grep_default_opt +
\ s:grep_default_expr_opt
" @fixme expr for defferent tools
" when using rg, [join(s:labels, '|')]
" when using grep, [join(s:labels, '\|')]
if s:grep_default_exe == 'rg'
let argv += [join(s:labels, '|')]
elseif s:grep_default_exe == 'grep'
let argv += [join(s:labels, '\|')]
elseif s:grep_default_exe == 'findstr'
let argv += [join(s:labels, ' ')]
else
let argv += [join(s:labels, '|')]
endif
if s:SYS.isWindows && (s:grep_default_exe ==# 'rg' || s:grep_default_exe ==# 'ag' || s:grep_default_exe ==# 'pt' )
let argv += ['.']
elseif s:SYS.isWindows && s:grep_default_exe ==# 'findstr'
let argv += ['*.*']
endif
let argv += s:grep_default_ropt
call SpaceVim#logger#info('todo cmd:' . string(argv))
let jobid = s:JOB.start(argv, {
\ 'on_stdout' : function('s:stdout'),
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/deoplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ call deoplete#custom#source('racer', 'mark', '')
call deoplete#custom#option('ignore_sources', {'vim': ['tag']})

" denite
call deoplete#custom#option('ignore_sources', {'denite-filter': ['denite', 'buffer', 'around', 'member']})
call deoplete#custom#option('ignore_sources', {'denite-filter': ['denite', 'buffer', 'around', 'member', 'neosnippet']})

" clojure
call deoplete#custom#option('keyword_patterns', {
Expand Down

0 comments on commit 37f1cf4

Please sign in to comment.