Compile and run scripts from within Vim
Plugin 'jacob-thompson/vim-compilerun'
Plug 'jacob-thompson/vim-compilerun'
git clone https://github.com/jacob-thompson/vim-compilerun.git ~/.vim/bundle/vim-compilerun
return { "jacob-thompson/vim-compilerun", name = "vim-compilerun" }
The following vimscript code maps CompileRun to F5
in the Normal
, Insert
, and Visual
modes:
map <F5> <Cmd>CompileRun<CR>
imap <F5> <Esc><Cmd>CompileRun<CR>
vmap <F5> <Esc><Cmd>CompileRun<CR>
The following lua code maps CompileRun to F5
in the Normal
, Insert
, and Visual
modes:
vim.keymap.set("n", "<F5>", "<Cmd>CompileRun<CR>")
vim.keymap.set("i", "<F5>", "<Esc><Cmd>CompileRun<CR>")
vim.keymap.set("v", "<F5>", "<Esc><Cmd>CompileRun<CR>")
:CompileRun