$ cp clangshebang.cpp myprogram.cpp
$ chmod +x myprogram.cpp
$ ./myprogram.cpp
hello shell
In Emacs init.el:
(global-set-key (kbd "<f5>") #'my/try-build-run-project)
(global-set-key (kbd "<f7>") #'my/try-build-project)
In emacs session, hit f5
. It will run myprogram.cpp
.
In terminal:
$ ./myprogram.cpp --gen-emacs-dirlocals
In emacs session, hit f5
. It will do the right thing.
If you just want to build, hit f7
.
I haven't added projectile-projectile-test-cmd
yet because I am lazy.