From 0c732266c09ea04b2229eeb1e2801f795b4999df Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 4 Oct 2020 03:10:49 +0200 Subject: `GitTodo` command to run `git todo` and load matches to quickfix list Allow a ref to be specified in an argument, falling back to `g:git_todo_default_ref`, or the `git todo` default. --- autoload/git_todo.vim | 9 +++++++++ plugin/git_todo.vim | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 autoload/git_todo.vim create mode 100644 plugin/git_todo.vim diff --git a/autoload/git_todo.vim b/autoload/git_todo.vim new file mode 100644 index 0000000..ca57921 --- /dev/null +++ b/autoload/git_todo.vim @@ -0,0 +1,9 @@ +function! git_todo#QuickfixTodos(ref) + let ref = a:ref + + if empty(ref) + let ref = get(g:, 'git_todo_default_ref', '') + endif + + cexpr system('git todo ' . ref) +endfunction diff --git a/plugin/git_todo.vim b/plugin/git_todo.vim new file mode 100644 index 0000000..6f5d283 --- /dev/null +++ b/plugin/git_todo.vim @@ -0,0 +1,7 @@ +if exists('g:loaded_git_todo') + finish +endif +let g:loaded_git_todo = 1 + + +command! -nargs=? GitTodo call git_todo#QuickfixTodos() -- cgit v1.2.3