Skip to content

Commit da2828f

Browse files
authored
Merge pull request #18 from raspine/master
Adds support for AsyncRun
2 parents 9247a5f + 3329838 commit da2828f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ and whenever one is found, it runs the cmake command there, assuming the CMakeLi
1414
file is just one directory above. Any arguments given to :CMake will be directly passed
1515
on to the cmake command. It also sets the working directory of the make command, so
1616
you can just use quickfix as with a normal Makefile project.
17+
If you have the [AsyncRun plugin](https://github.com/skywind3000/asyncrun.vim)
18+
installed, it will be used automatically and you will be able to check the
19+
result of the cmake command in the quickfix as well.
1720

1821
* `:CMakeClean` deletes all files in the build directory. You can think of this as a CMake version of make clean.
1922

plugin/cmake.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ function! s:cmake(...)
6868

6969
let s:cmd = 'cmake '. l:argumentstr . " " . join(a:000) .' .. '
7070
echo s:cmd
71-
let s:res = system(s:cmd)
72-
echo s:res
71+
if exists(":AsyncRun")
72+
execute 'copen'
73+
execute 'AsyncRun ' . s:cmd
74+
execute 'wincmd p'
75+
else
76+
let s:res = system(s:cmd)
77+
echo s:res
78+
endif
7379

7480
exec 'cd - '
7581

0 commit comments

Comments
 (0)