On Wed, Jun 18, 2014 at 4:43 PM, Ben Fritz <[email protected]> wrote: > On Wednesday, June 18, 2014 3:05:07 PM UTC-5, Ethan Hereth wrote: >> >> According to the following vim.wikia post you should be able to use >> >> Ctrl-O but I cannot seem to make it work. >> >> >> >> http://vim.wikia.com/wiki/Use_Ctrl-O_instead_of_Esc_in_insert_mode_mappings >> >> >> [SNIP] >> >> If I run the command ':!python %' (without the quotes, I never know if >> >> I really need to clarify that or not!) the python snippet runs like >> >> I'd expect to and I get the file foo.txt. However, when I define >> >> ':inoremap <F6> <C-o>!python %<CR>' and attempt to use it nothing >> >> seems to happen. > > <C-o> in insert mode will execute one NORMAL MODE command, then return you to > insert mode. > > Think about how you would do this from normal mode and you get your answer. > > !python %<CR> in normal mode won't do what you want (if it does anything). > > But, pressing ':' first will do what you want. > > The following mapping should work: > > :inoremap <F6> <C-o>:!python %<CR>
I knew it was something stupid I was doing. I don't know how that slipped my mind. That indeed does the trick. Thanks, Ethan Alan > -- > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_use" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
