diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index e75f9ea55..2c2f09760 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -1208,7 +1208,15 @@ 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') +let g:spacevim_todo_labels = ['fixme', 'question', 'todo', 'idea'] + +"" +" @section todo_prefix, options-todo_prefix +" @parentsection options +" Option for setting todo prefix in current project. +" The default is `@` + +let g:spacevim_todo_prefix = '@' "" " @section lint_on_the_fly, options-lint_on_the_fly diff --git a/autoload/SpaceVim/plugins/todo.vim b/autoload/SpaceVim/plugins/todo.vim index 18513bce1..9c540fdfe 100644 --- a/autoload/SpaceVim/plugins/todo.vim +++ b/autoload/SpaceVim/plugins/todo.vim @@ -75,8 +75,10 @@ function! s:update_todo_content() abort \ && type(g:spacevim_todo_labels) == type([]) \ && !empty(g:spacevim_todo_labels) let s:labels = g:spacevim_todo_labels + let s:prefix = g:spacevim_todo_prefix else - let s:labels = map(['fixme', 'question', 'todo', 'idea'], '"@" . v:val') + let s:labels = ['fixme', 'question', 'todo', 'idea'] + let s:prefix = '@' endif let s:todos = [] @@ -189,7 +191,7 @@ function! s:get_labels_regex() let separator = '|' endif - return join(map(copy(s:labels), "v:val . '\\b'"), + return join(map(copy(s:labels), "s:prefix . v:val . '\\b'"), \ separator) endfunc diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index c4c3a8123..c895fc5cb 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -79,14 +79,15 @@ CONTENTS *SpaceVim-contents* 58. statusline_unicode.............|SpaceVim-options-statusline_unicode| 59. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape| 60. todo_labels...........................|SpaceVim-options-todo_labels| - 61. vim_help_language...............|SpaceVim-options-vim_help_language| - 62. vimcompatible.......................|SpaceVim-options-vimcompatible| - 63. warning_symbol.....................|SpaceVim-options-warning_symbol| - 64. wildignore.............................|SpaceVim-options-wildignore| - 65. windisk_encoding.................|SpaceVim-options-windisk_encoding| - 66. windows_index_type.............|SpaceVim-options-windows_index_type| - 67. windows_leader.....................|SpaceVim-options-windows_leader| - 68. windows_smartclose.............|SpaceVim-options-windows_smartclose| + 61. todo_prefix...........................|SpaceVim-options-todo_prefix| + 62. vim_help_language...............|SpaceVim-options-vim_help_language| + 63. vimcompatible.......................|SpaceVim-options-vimcompatible| + 64. warning_symbol.....................|SpaceVim-options-warning_symbol| + 65. wildignore.............................|SpaceVim-options-wildignore| + 66. windisk_encoding.................|SpaceVim-options-windisk_encoding| + 67. windows_index_type.............|SpaceVim-options-windows_index_type| + 68. windows_leader.....................|SpaceVim-options-windows_leader| + 69. windows_smartclose.............|SpaceVim-options-windows_smartclose| 3. Configuration...........................................|SpaceVim-config| 4. Commands..............................................|SpaceVim-commands| 5. Public functions.....................................|SpaceVim-functions| @@ -837,6 +838,11 @@ TODO_LABELS *SpaceVim-options-todo_labels* Option for setting todo labels in current project. +============================================================================== +TODO_PREFIX *SpaceVim-options-todo_prefix* + +Option for setting todo prefix in current project. The default is `@` + ============================================================================== VIM_HELP_LANGUAGE *SpaceVim-options-vim_help_language* diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index fcfcd2a7d..56a6de625 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -86,6 +86,7 @@ lang: zh - [自定义任务](#自定义任务) - [任务自动识别](#任务自动识别) - [任务提供源](#任务提供源) + - [代办事项管理器](#代办事项管理器) - [Iedit 多光标编辑](#iedit-多光标编辑) - [Iedit 快捷键](#iedit-快捷键) - [高亮光标下变量](#高亮光标下变量) @@ -2169,6 +2170,22 @@ call SpaceVim#plugins#tasks#reg_provider(funcref('s:make_tasks')) ![task-make](https://user-images.githubusercontent.com/13142418/75105016-084cac80-564b-11ea-9fe6-75d86a0dbb9b.png) +### 代办事项管理器 + +待办事项管理插件将异步执行`rg`命令,结果会展示在底部待办事项窗口。 +默认的快捷键是 `SPC a o`,默认的标签前缀是 `@`, +默认的标签包含:`['fixme', 'question', 'todo', 'idea']`. + +配置示例: + +``` +[options] + todo_labels = ['fixme', 'question', 'todo', 'idea'] + todo_prefix = '@' +``` + +![todo manager](https://user-images.githubusercontent.com/13142418/61462920-0bd9d000-a9a6-11e9-8e1f-c70d6ec6ca1e.png) + ### Iedit 多光标编辑 SpaceVim 内置了 iedit 多光标模式,可快速进行多光标编辑。这一功能引入了两个新的模式:`iedit-Normal` 模式和 `iedit-Insert`。 diff --git a/docs/documentation.md b/docs/documentation.md index fd3467591..d2c186a8c 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -2226,9 +2226,16 @@ With the above configuration, you will see the following tasks in the SpaceVim r ### Todo manager The todo manager plugin will run `rg` asynchronously, the results will be displayed on todo manager windows. -The key binding is `SPC a o`. +The key binding is `SPC a o`. The default `todo_prefix` option is `@`, +and the `todo_labels` is: `['fixme', 'question', 'todo', 'idea']`. -The default tags is: `'@fixme', '@question', '@todo', '@idea'`. +Example: + +``` +[options] + todo_labels = ['fixme', 'question', 'todo', 'idea'] + todo_prefix = '@' +``` ![todo manager](https://user-images.githubusercontent.com/13142418/61462920-0bd9d000-a9a6-11e9-8e1f-c70d6ec6ca1e.png)