Mapping hotkey for compile and run in Vim editor #1663
stefanos82
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
Should it perhaps be added to the README for the vim editor syntax highlighter? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Actually it matches the Show and Tell in Discussions. Can you move it, please? It does not let me 😕 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Those of you who use Vim as your editor of choice and would like to map a hotkey to compile and run C3 projects, you can do so with the following steps:
$HOME/.vim/after/ftplugin/
c3
.vim
file; I happened to name itc3mappedkeys.vim
nmap <F5> :up <bar> !clear && /<your-own-location-the-compiler-can-be-found>/c3c/c3c run -q<CR>
and save itTo explain the last point what it actually does, it goes like this: even if you haven't saved your changes, the editor will do so, thanks to the
:up
command (:up or :update
: Like:write
, but only write when the buffer has been modified.); then, we clear the terminal and then we execute thecompile-and-run but without the verbosity turned on by default
command.That's really it; enjoy!
Beta Was this translation helpful? Give feedback.
All reactions