-
Notifications
You must be signed in to change notification settings - Fork 32
Task Examples
Linwei edited this page Feb 18, 2020
·
25 revisions
[project-init]
command=mkdir build && cd build && cmake .. -G "MinGW Makefiles"
cwd=<root>
errorformat=
[project-build]
command=cmake --build build
cwd=<root>
errorformat=%f:%m:%l
[project-run]
command="build/$(VIM_PRONAME)"
cwd=<root>
output=terminal
Project wide grep, will ask you input a keyword to search:
[grep-word]
command=rg -n --no-heading --color never "$(?keyword)" "<root>" -tc -tcpp -tpy -tvim -tgo
cwd=$(VIM_ROOT)
errorformat=%f:%l:%m
If you want to search current word under cursor, you can use <c-r><c-w>
to pick up current word, or define another task to search word under cursor directly:
[grep-cword]
command=rg -n --no-heading --color never "$(VIM_CWORD)" "<root>" -tc -tcpp -tpy -tvim -tgo
cwd=$(VIM_ROOT)
errorformat=%f:%l:%m
They can be defined as a global task, and use a .ignore
in each project to indicate what to search and what to skip.
[gen-tags]
command=ctags -R -f tags .
cwd=$(VIM_ROOT)
errorformat=
Don't forget set:
:set tags+=./tags;
It will allow vim search tags files in all parent directories of current buffer.