Sublime Forum

Question for web developers

#1

I’m hoping to hear some examples of how other web developers utilize Sublime Text 2 for development.

This is my current workflow:
I use transmit (sftp app) to connect/browser remote servers. Then I open files from transmit and edit in a text editor (Currently Smultron) I like ST2 but when opening remote files from Transmit there is no way to know the files remote path. This is a big issue for me because in our system lots of tiles have the same name. Example (global.css) would be the file name for each site we support.

Do other web developers have a different workflow?

  1. Work locally and upload?
  2. Don’t care about remote file path
  3. Mount remote server as local drive

I hoping someone has a better way to use ST2 for web development that I haven’t thought of. This problem could be completely solved if the remote file path was included but there’s no wait to know if that feature will be added. (It is in the requested feature list)

0 Likes

#2

I work locally on ST2, use the livereload app to see changes on save, and upload files with the SFTP plugin by Will Bond: http://wbond.net/sublime_packages/sftp

0 Likes

#3

For me working locally and uploading to a remote server is ideal, however not always practical. If I don’t have a local set-up I use Transmit to mount the server as a local drive. I find this works extremely well. The only issue I run in to is when I open a project when the remote server isn’t currently mounted. (You get a bunch of empty files) Working this way you see the path relative your Volumes directory. The structure will be identical to that of the remote server, so that should solve your issue?

0 Likes

#4

Thanks I’ll check out “livereload app” I haven’t heard of it. I was aware of the built in sftp app but I really love transmit, it would be hard to give up.

0 Likes

#5

Thanks for the reply. I have tried mounting the drive using transmit and your right that does solve the problem. I think I’m just used to navigating a server via transmit, I really like the “Go To” feature so I can type out the directory paths. If I mount it local then I have to use finder which by default won’t see .htaccess and other files I may need to edit.

Thanks again for the reply, I knew I couldn’t be the only person doing web development on remote servers.

0 Likes

#6

BestGreek, do you use any type of version control? If you don’t, I strongly recommend it. It sounds scary, and even pointless if you’re a one-man operation, but it really isn’t! It has changed the way I develop websites, and now I pretty much never use FTP software. Here is my process:

Development

  1. Setup GIT repository in Beanstalk (http://beanstalkapp.com/) for new website
  2. Develop new website locally (running on MAMP or WAMP server)
  3. Commit all code to Beanstalk as I go
  4. Test site locally
  5. Deploy, when ready, to production server using Beanstalk’s very handy deployment tools

Maintenance

  1. Make change locally
  2. Test change locally
  3. Commit change to Beanstalk
  4. Deploy change from Beanstalk to production server

Github is great too (and a little cheaper), but being new to version control I found Beanstalk a little more approachable. Also, their deployment tools are totally awesome - they make the transition from FTP a lot easier.

Finally, you can manage GIT using command line (lots of people do), but I have found Tower (http://www.git-tower.com/) to be more my style.

Hope that helps. :wink:

0 Likes

#7

Have you tried using the sidebar in Sublime Text? Just drop your whole FTP folder into it, and you will see the files hidden by the OS. You can then use the handy CMD-P file search to local your files. Just another option!

0 Likes

#8

[quote=“jonathan”]BestGreek, do you use any type of version control? If you don’t, I strongly recommend it. It sounds scary, and even pointless if you’re a one-man operation, but it really isn’t! It has changed the way I develop websites, and now I pretty much never use FTP software. Here is my process:

Development

  1. Setup GIT repository in Beanstalk (http://beanstalkapp.com/) for new website
  2. Develop new website locally (running on MAMP or WAMP server)
  3. Commit all code to Beanstalk as I go
  4. Test site locally
  5. Deploy, when ready, to production server using Beanstalk’s very handy deployment tools

Maintenance

  1. Make change locally
  2. Test change locally
  3. Commit change to Beanstalk
  4. Deploy change from Beanstalk to production server

Github is great too (and a little cheaper), but being new to version control I found Beanstalk a little more approachable. Also, their deployment tools are totally awesome - they make the transition from FTP a lot easier.

Finally, you can manage GIT using command line (lots of people do), but I have found Tower (http://www.git-tower.com/) to be more my style.

Hope that helps. :wink:[/quote]

I totally agree its crazy to edit a live site. In my own case I am editing on a live server but its a development server. Once something is ready I do commit it (subversion) and then update the production server with “svn update”. I am on a mac and I have used MAMP but I didn’t like it. I prefer to build on the exact same system my code will run against. I think if I was going to go the route of local development I’d probably create a Vmware instance of Centos and mount that as a drive.

Also a lot of projects I do are just messing around and trying new things out and in those cases it dosen’t matter if its right on the server since its only for me.

I have tried bean stalk but I ended up just settings up my own svn server and using that. I haven’t had a project that used GIT yet but I do love github and I will probably find a reason to use git soon.

I’ll go take another look at MAMP incase its improved, but last time I used it the whole thing felt very clunky to me.

Thanks for the reply, its really interesting to hear how other developers do similar work.

0 Likes

#9

[quote=“jonathan”]

Have you tried using the sidebar in Sublime Text? Just drop your whole FTP folder into it, and you will see the files hidden by the OS. You can then use the handy CMD-P file search to local your files. Just another option![/quote]

I have tried that yet but thanks for the idea, I’ll try it tonight.

0 Likes

#10

[quote=“BestGreek”]I’ll go take another look at MAMP incase its improved, but last time I used it the whole thing felt very clunky to me.

Thanks for the reply, its really interesting to hear how other developers do similar work.[/quote]

No worries! I find it interesting myself.

As for MAMP, yeah, don’t get too excited. It works…but that’s about it. Really, I mean any sort of local web server…whatever your flavour is. I just find developing locally so much faster. I cannot stand waiting for a file to upload on each save. If you have a laptop and are traveling (with no Internet connection), you can continue to develop as well.

0 Likes

#11

I used to edit files locally and upload it via FTP to production servers like you, then I took an arrow to the knee. Since then I use Subversion to commit the project files to my central online repository from which I checkout files to the production server. I’m considering migrating to git.

0 Likes

#12

I use a VM to dev on my mac, mount that as a local drive via Transmit, add the site/folder to a project in Sublime Text 2 and edit the files as needed, manage the code via git (github) on the command line and rsync to whatever box i need to when im done.

BTW, If you use the sidebar in Sublime Text, you can drag in two folders, and if the file names that you open are the same, the name of the folder will be appended to the file name in the file tab. eg index.php - folder 1 and index.php - folder 2.

Further to this, if the folders that you have dragged in are also named the same, the path to each file will be appended to the file name in the file tab. eg /site1/www/index.php and /site2/www/index.php

0 Likes

#13

[quote=“matt-g”]I use a VM to dev on my mac, mount that as a local drive via Transmit, add the site/folder to a project in Sublime Text 2 and edit the files as needed, manage the code via git (github) on the command line and rsync to whatever box i need to when im done.

BTW, If you use the sidebar in Sublime Text, you can drag in two folders, and if the file names that you open are the same, the name of the folder will be appended to the file name in the file tab. eg index.php - folder 1 and index.php - folder 2.

Further to this, if the folders that you have dragged in are also named the same, the path to each file will be appended to the file name in the file tab. eg /site1/www/index.php and /site2/www/index.php[/quote]

Thanks, I was thinking about possibly doing it this way. From all the options available right now this is what I’ll likely do. I still wish when opening remote files it showed the proper file path. At my day job we have a proprietary development language and its not possible to run locally. At least for my own projects this solution will work really well.

Thanks for sharing the idea, its great to here other dev’s way of working.

0 Likes

#14

As a Web Developer in Linux I mount my SFTP projects trough sshfs.
And my FTP projects I mount trough curlftpfs.
Both are really handy.

~Juje007

0 Likes

#15

@matt-g: Can you explain this a little further? I have been looking at alternatives to MAMP. What software do you use for your VM? What OS are you running on the VM? Thanks!

0 Likes

#16

for those on Windows who want to mount s/ftp as a drive, google netdrive. It is free for personal use.

0 Likes

#17

[quote=“jonathan”]

@matt-g: Can you explain this a little further? I have been looking at alternatives to MAMP. What software do you use for your VM? What OS are you running on the VM? Thanks![/quote]

I don’t know what he is using but you can use “VMware fusion”. Then any linux distro you want will work, I personally use Cento OS 6. After you setup the VM you use use the ipaddress to access it, or you can use your Mac’s host file to give it a domain name.

If this is something your interested in doing you probably need to be comfortable setting up the linux install from scratch. If you need more detailed steps how to go about this let me know, or maybe matt-g will have more details.

0 Likes

#18

Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?!

0 Likes

#19

[quote=“jonathan”]

Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?![/quote]

I have in the past run a VM and tried to have as close a match as possible to my production server and this works great. When I’m working on something less critical I work on a remote server directly. In one instance I have a development site and production site on the same server. After development is completed/QA’ed I commit the changes then go to the production directory and update the files. In my cases I don’t have to change server settings or packages, I just edit/write php code so there is little to no impact on the production server. There are downsides to doing this but one upside is if something works on development it will work in production being they are the same box.

0 Likes

#20

[quote=“BestGreek”]Thanks for the feedback. I’m comfortable setting up a Linux box. My current web host is a Linode “slice” which I installed Ubuntu on. That’s sort of what I want, because it’s so easy to customize. MAMP is great if all you need is MAMP as it is out of the box.

Running Linux in a VM seemed like a good (if not somewhat slow) way to create the ideal development server. However, I’m new to Max/OSX, so I’m not sure what other devs are doing out there. Surely not everyone is using MAMP!?![/quote]

my production box is also linode (used to be slicehost until they sold out and began to suck) with ubuntu and i do local dev on an identically set up ubuntu install in a VM using vmware fusion.

a while ago, i wrote a tutorial on how to clone your production VPS to a VM. that tutorial lives here.

i hope that helps someone.

0 Likes