I had the following remap
autocmd filetype cpp nnoremap <F5> :w <bar> silent !g++ -ulimit -Wall -Wno-unused-result -std=c++11 -O2 % -o %:r && %:r<CR>
When I run this in Vim, a terminal like this shows up
If I have 2 remaps, one for compiling and one for running, I get shell returned with 139. I want to get the above functionality in Neovim.
These are the commands that I used
autocmd filetype cpp nnoremap <F9> :w <bar> !mkdir -p .outputs && g++ -std=c++17 -O2 -Wshadow -Wall % -o .outputs/%:r -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG<CR>
autocmd filetype cpp nnoremap <F12> :!.outputs/%:r<CR>
autocmd filetype cpp nnoremap <F5> :w <bar> !g++ -ulimit -Wall -Wno-unused-result -std=c++11 -O2 % -o %:r && %:r<CR>