1

I often start new projects in the same way. I guess it exists a way to be fast a starting a project.

For example: I am trying to start new composer project with the following function. I perfectly see the string 'New Project name: '.

But when I press enter, my cursor just goes on top of current file.

function! CreateProject()
    let new_name = input('New Project name: ')
    exec '!composer create-project foo/bar ' + l:new_name + ' 1.0.0'
endfunction
1

For concatenating string, you should use . instead of +.

I don't have composer installed, so instead of calling composer, I simply called the unix echo function like so :

exec '!echo ' . l:new_name . ' 1.0.0'

And it prints the entered name with the 1.0.0 after.

Ref :

  • 1
    You have no composer, but you solved my problem. It is running!!! – sensorario Sep 12 '15 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.