On May 13, 1:39 am, J <[email protected]> wrote:
> 2. Is it possible to configure macros to make compiling more '1-click'-
> ish? It'd be nice if I could press F11 and it'll execute 'make' and './
> program'.
>
You'd need to configure Vim somehow to know the name of your program,
but something like this should work:
nnoremap <F11> :execute ':make' | !./program<CR>
To make it more general, you could create a global variable to use as
the program name:
nnoremap <F11> :execute ':make' | execute '!'.g:program<CR>
It should be easy enough to fiddle with it to prompt for g:program if
it doesn't exist. I'll leave that as an exercise for the reader with
these helpful hints:
:help exists()
:help input()
:help inputdialog()
And of course you'll need one of these:
:help expr1
:help :if
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---