skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.84k stars 109 forks source link

Compile and run oneliner? #208

Closed TornaxO7 closed 3 years ago

TornaxO7 commented 3 years ago

Hello! I have this mapping:

nnoremap <leader>gd :AsyncRun gcc % <bar> :AsyncRun -raw -cwd=$(VIM_FILEDIR) ./a.out<CR>

When I'm running this shortcut, than it returns this error message:

|| [gcc Test3.c | :AsyncRun -raw -cwd=/my/path ./a.out]
zsh|1| command not found: :AsyncRun
|| [Finished in 0 seconds with code 127]

How can I compile and run the file afterwards?

skywind3000 commented 3 years ago
nnoremap <leader>gd :AsyncRun -raw -cwd=$(VIM_FILEDIR)  gcc % && ./a.out<CR>
TornaxO7 commented 3 years ago

Dayum. Haha I forgot that this "option" && exists xD Thank you!