Friday, January 29, 2010

Re: How to go to command line mode from script



On Fri, Jan 29, 2010 at 3:45 PM, Aarto Matti <aarto.matti@gmail.com> wrote:
Thanks, I did it! But still, how to send <CR> now? This is the function I'm trying to implement:

function! RunProject(...)
    if !exists("s:project_command") || s:project_command=="" || (a:0==1 && a:1=="alter")
        let s:project_command=expand("%:p")
        return ':!'.s:project_command
    else
        return ':!'.s:project_command<CR>
    endif
endfunction
map <expr> <F12> RunProject()
map <expr> <C-F12> RunProject("alter")


Ok,

return ':!'.s:project_command."\n"
that works :)


--
Aarto

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: