I recently bought a macbook air, and I’m trying to program using the terminal instead of an ftp client + text editor.
I know how to SSH in, and from there run PHP (php -a), but I can’t quite figure out an overheadless way to create, write, and save a file in PHP. Any help would be perfect
I wouldn’t recommend programming using a simple text editor in a terminal. The best thing you could do is use an IDE such as Zend Studio, Eclipse PDT or NetBeans. There are many out there. IDEs give you syntax highlighting, code completion, etc and those are just some of the basic features. One feature I love about Zend Studio – even though I haven’t used it much – is Remote Server connections. It allows you to connect directly to a remote server and edit the files right in Zend Studio!
Why should I use an IDE?
Don’t use FTP+text editor. Just use FTP to download your files (if that’s the only way you can download them) and save the entire project into a folder and use an IDE to edit and save your files.
As many other people stated, you can use vim or nano in the terminal. I prefer vim and it does come installed with OS X so you don’t have to install anything.
Then while in vim, if you want to make changes your simply press the i key on your keyboard. That changes vim to “insert” mode. After making changes in “insert” mode, press ESC and then the colon key ( : ). Now you are ready to write your changes. Press the w key to write and q to quit and lastly press enter. That’s pretty much your most basic stuff for vim.