Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created October 16, 2013 17:15
Show Gist options
  • Save pbrewczynski/7011408 to your computer and use it in GitHub Desktop.
Save pbrewczynski/7011408 to your computer and use it in GitHub Desktop.
nmap <leader>c :w \| ! g++ % -o output <CR> " Compiles but doesn't stay in "bash mode", it automatically returns to Vim
nmap <leader>c :w \| ! g++ % -o output \| ! ./output <CR> " Returns E34: No previous command
nmap <leader>c :w \| ! g++ % -o output && ./output <CR> " It works Perfectly (and "./output" isn't executed when compilation fail because of conditional execution.
@Raimondi
Copy link

nnoremap <leader>c :w \| ! g++ % -o output \\\| \! ./output <CR>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment