From 805ded92ce2bff6dacf01668e9a6a3072930ebae Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Wed, 19 Feb 2020 18:47:38 +0800 Subject: [PATCH] Add option for setting todo labels (#3362) --- autoload/SpaceVim.vim | 4 ++++ autoload/SpaceVim/plugins/todo.vim | 9 +++++++-- doc/SpaceVim.txt | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index db8401b65..f747a148e 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -965,6 +965,10 @@ let g:spacevim_project_rooter_automatically = 1 " Config the command line prompt for flygrep and denite etc. let g:spacevim_commandline_prompt = '➭' +"" +" Option for setting todo labels in current project. +let g:spacevim_todo_labels = map(['fixme', 'question', 'todo', 'idea'], '"@" . v:val') + "" " @section lint_on_the_fly, options-lint_on_the_fly " @parentsection options diff --git a/autoload/SpaceVim/plugins/todo.vim b/autoload/SpaceVim/plugins/todo.vim index c0e3aba9e..49e8c5045 100644 --- a/autoload/SpaceVim/plugins/todo.vim +++ b/autoload/SpaceVim/plugins/todo.vim @@ -10,8 +10,6 @@ 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, @@ -56,6 +54,13 @@ endfunction " @todo Improve todo manager function! s:update_todo_content() abort + if exists('g:spacevim_todo_labels') + \ && type(g:spacevim_todo_labels) == type([]) + \ && !empty(g:spacevim_todo_labels) + let s:labels = g:spacevim_todo_labels + else + let s:labels = map(['fixme', 'question', 'todo', 'idea'], '"@" . v:val') + endif let s:todos = [] let s:todo = {} let argv = [s:grep_default_exe] + diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 211b2be98..3c701510a 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -1068,6 +1068,9 @@ Enable/Disable changing directory automatically. Enabled by default. *g:spacevim_commandline_prompt* Config the command line prompt for flygrep and denite etc. + *g:spacevim_todo_labels* +Option for setting todo labels in current project. + *g:spacevim_lint_on_the_fly* Enable/Disable lint on the fly feature of SpaceVim's maker. Default is 0. >