Sublime Forum

Want to like. =) Help!

#1

Hi all, wasn’t sure where to ask this. My apologies if this isn’t in the right place.

But I wanted to ask the Sublime Text web site and community.

I own a small social publishing software company and we are looking at ways to speed up development of our core products. If you do a google on “social publishing software” you’ll see us #1 MediaBlinkk. My apologies for listing that, just wanted to give you some context. Anywho we currently use dreamweaver for development across the board.

I really like Sublime Text 2, but we are stopped dead in a couple of places in being able to use it and roll it out to all the guys/2 girls.

We hate how slow Dreamweaver is in general and how badly and slowly the ftp works(sometimes does/doesn’t) as well.

Our development goes as follows:

As a developer:

  • We develop on a local machine.
  • Test on a local machine. Local apache web server. A lot, if not most of the time this is on the developer’s machine, as they try out various options.
  • Then after testing, upload the file or files to the remote production server.

I’m guessing we aren’t alone in this. Maybe hundreds of thousands if not millions of developments should go this way.

Edited locally, posted copy to test and then posted to the production area. Each one nicely separated for continuity and to remove any slip ups.

We can’t afford to have anyone working directly on the files in production, as they are being called and used by thousands of web sites all of the time.

What is everyone else doing when using a local work flow, test and then post to production, tips?

Basically we want to edit locally and save and then place a copy of that file for test in the local apache htdocs directory, on the developer’s machine for them to test. And we don’t want to edit the files directly in test in the local apache htdocs directory.

Seems easy, but turns out to be a mini nightmare. =) Forcing us to go back to dreamweaver again. We just want to copy a file locally for test.

Thanks again for your help! And the community. We love the software and want to use it, just have to work out the flow above in a way that doesn’t eat up all the time that we save. =) What we want to do seems, so simple so tips are much appreciated.

-C

Sorry if this seems like a dumb question. =) TIA.

0 Likes

#2

Note: We have tried some workarounds, but didn’t want to post them in case people are doing it differently. We don’t want to post our files to git, we have our own versioning etc…system. Sometimes our developers may develop on one local machine/system, it’s faster and not even be connected to the internet until they post it to production.

Thanks! ideas? Thoughts, pointers, tips?

Best,

-C

0 Likes

#3

I’m not a web developer, so take what I say with a grain of salt.

What if you were to write a simple plugin to move files from the working directory to testing, and testing to production. Of course, this would mean there is some standard mapping between the directory structures (though I assume there would be). You could add a confirmation dialog box or only add it to the command palette (or both) to avoid accidental copies from one location to another.

Side note, I don’t think posting what you are doing (unless you can’t for some reason) would hurt. It would keep people from reposting what you are already doing.

0 Likes

#4

Hi skuroda, thanks very much for the post back.

We haven’t yet tried writing a plugin, you may be right there, could be a good idea, was hoping others might be doing the same local development and that there’d be an easy fix to this, or a flow we hadn’t considered that people are using.

Perhaps you are right.

Ok here are the things we’ve thought of and tried. We’d like to do all the stuff we can inside ST2(Sublime Text 2) if we can, so as to keep the developers/programers in the same context, increasing speed. And we need to make it as easy as possible, because a developer make try lots of different test iterations, not because they don’t get the code right =), because we know they always do :wink:, but because there may be a number of different ways something can be done and we may need to offer choices to either our clients or to our core systems as we have plugins as well. So it’s usually code, iterations, refactoring, until we get a nice elegant solution.

    1. We’ve tried using SFTP, which is a great plugin, but for some reason we can’t get it to ftp or bind to a local test directory on a local machine. example we thought we’d set up a project that ftp’d to a local test directory which would be basically just like copying a file there. And then another project on the same directory, that ftp’d to production when connected. Allowing us to test, then post to production. No joy, couldn’t get it to do that.
    1. Then we thought hey we’ll just save the file twice, once to save and then once to the apache test directory. But since the side bar always defaults to the folders/directory you are currently in, you then have to pound through a number of selections and directories to get to the right one to do that and then pound your way back again to the actual directory you are working in to work on any other files. Now that doesn’t sound like much, but after even a few iterations and a few files of doing that it’s untenable, imagine doing that for 50 files or 25 options or even a number of iterations and you can easily see the frustration and time lost. Not to mention the possibility of errors along the way etc…sleepy programmers and the like. =)
    1. Then we thought hey, maybe we can just quick clone the folders selection area in the side bar, making a second one there and then drag the folders to the second area, cool, easy and well needed here. That way the first folder/file selection area would be the one you are working in and then the second would be the one to drag it to. Eazy peazy, and elegant. As we could then use the already existing Sublime Text 2 code base for that and existing code. And without much work, just a clone of already available technology that would really be useful. But no joy there. And that would allow a copy feature, which is a really needed feature in this software.

We tried other stuff, but those are the first three we tried.

Maybe we could do a move(copy) plugin, as you suggested, that has a json config where you can set the dir path to copy to and then have the plugin add a right click option when you click a file or a folder to move it to. But I admit I am unfamiliar with the plugin system here.

Just was wondering how others do this, while staying within the ST2 context. The above is probably a quick fix, but I’d like to do it the third way above that we already tried, if possible, because that is already using the current ST2 code and just cloning it in the side bar which would be simple and quick and super handy.

There doesn’t seem to be a file copy option in the software, just a file save as option which isn’t quite the same and this is a big hole for this type of software.

Tips on a better flow or a copy option or starting a plugin for that or a right click option for that are much appreciated as you guys are great! And the current plugin creators are great as well!

Cheers,

-Colin

0 Likes

#5

Sorry in advance about the long post, couldn’t see any way around it. =)

0 Likes

#6

Here is how we do it for last 5 years or so.
In the begining we used SVN, now we are using Git, but thing are basically the same.

The most important thing is to set up a dev env on each workstation. Since we are only doing PHP, it’s fairly easy, but you could try Vagrant/Chef/Puppet to create an easy to distribute virtual machine.

So, workflow is this:

  • fetch all remote code (git pull, svn checkout)
  • do the work (if you are on git, then commit often and branch often, both operations are cheap in terms of speed, space used etc). Develop, test and tweak locally. Since the env is farily similar to stage/server, there are small chances that things will go wrong somewhere.
  • commit your changes (if you are on git you also need to push the changes)
  • Done.

There are plugins for sublime for both SVN and Git (and probably other VCS* as well), so you won’t leave the editor :smile:

Now, can you tell us what VCS are you using and why the workflow i described isn’t good?

VCS = version control system

0 Likes

#7

I don’t think ST supports dragging folders between projects via the sidebar, so from what you described, I think a plugin, called via a sidebar context menu is the way to go. I think net.tutsplus.com/tutorials/pytho … -2-plugin/ may be a good place to start for writing plugins. You may not want/need to actually go through it, but it does explain some of the basics (though somewhat mixed in) to writing a plugin. Side bar context menu commands have a single argument, the paths of the selected files. You can use this as the source. Then, as you mentioned, you can create a configuration for the destination directory. My guess is you won’t want to copy the selected folder/file to the destination directory. Out of curiosity, have you taken a look at the sidebar enhancements plugin? I know it adds quite a bit of functionality to the sidebar context menu, so perhaps it will have something built in that you can use, rather than needing to write a brand new plugin.

0 Likes

#8

Sup iamntz!

Cool! We do the exact same thing, except each production set is basically loaded onto their machine by a script ready for them, when they want it. And they grab it locally from there and branch naturally when they copy it and save it in their dev area on their local machine.

And then our developers can basically untether and code wherever they want. Saves a ton of time there.

That part we got, the version control. =) Saves us tons of time and allows us to write great code. In reality pull or push matters little, this has just worked really well for us. And allows our developers to work and forget the system, even when they can’t get a connection or when an online system might be down they can still keep working. Basically for them all the versioning is done behind the scenes for them. Pretty slick.

Plus then we can push to outside vendors, resellers, customers and even to our internal servers at the data centers and set times for pushes.

We are a small, but mighty shop, so probably much like ST2 we have to do everything really well. =)

I think though your answer is a good one, as it says we have the right flow for using ST2. We’ve basically had this flow since 2006. =) Time flies, but it’s been a good one.

Solution, Ahoy! =)

Ok I think we got it. =) Thank you for everyone’s patience with us. We just had to change our mind set a little bit, from what we had been using, to ST2 and we didn’t understand the ST2 software and nuances coming from a totally different system and view point.

We do now and it was pretty simple. Once we found the unofficial help doc.

We are now able to fully integrate and test ST2, how cool is that?

Thanks for all the thoughts, time, info and responses.

Cheers,

-C

0 Likes

#9

Hi skuroda, thanks very much for the reply. You are great! I’ll take a look and see what i can do. Thanks!

Yep. It was one of the first, here’s the plugins I loaded right away to set it up before trying ST2:

-Jquery
-Jquery Snippets Pack
-JSHint
-Package Control
-PhpDoc
-SFTP
-SideBarEnhancements
-SublimeCodeIntel
-SublimeLinter
-SyncedSideBar
-Tag
-Theme - Soda

And then set my user settings to this:

{
“autoIndent”: true,
“copyOnMouseSelect”: false,
“drawWhiteSpace”: “none”,
“font_face”: “Courier New”,
“font_size”: 14,
“gutter”: true,
“highlightLine”: true,
“ignored_packages”:

	"Vintage"
],
"rulers": false,
"tab_size": 4,
"theme": "Soda Dark.sublime-theme",
//"theme": "Soda Light.sublime-theme",
//"color_scheme": "Packages/Color Scheme - Default/Dreamweaver Blackbam.tmTheme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"use_tab_stops": true,
"wantVerticalScrollBar": false

}

I figured it best since we are a PHP, javascript, AJAX, jQuery and other javascript shop/software system.

Are there any others you might recommend?

Yeah I think you are right. So I had to change my thought process and viewpoint a little bit to get this to work.

Although in a weird way it does. =)

To trick the system, I removed all the projects and instead changed my viewpoint, ignoring projects et al. And instead added project folders to the side bar as metaphors for projects. Each folder being a project, metaphorically speaking.

Then I added a test folder to the side bar for the apache test area.

Now while I can’t actually drag and drop them, using the SideBarEnhancements plugin, I can right click and copy them and then go to the “project” folders or test “project” folder and paste them.

Although it takes about a dozen refresh requests and about 15 mins =), for them to actually display on the sidebar in the directory. A person would normally say, hey that’s a bad thing, but the really weird thing is that they actually copy right away if you look in a system file manager for them. The delay is basically only in the actual ST side panel display of them in the side bar. So that’s not too bad, just means the SideBarEnhancements plugin needs a little fixing/help or maybe another plugin to refresh the file list better/faster. Although for testing/copying stuff to places it works, if you don’t worry about the display catching up. =)

Or possibly there’s a side bar refresh interval setting we don’t know about, not yet sure, this is basically day one, of using ST2 for our stuff. =)

0 Likes

#10

Realize I didn’t finish my thought on the last post. It should have read, you probably don’t want to copy everything directly, but you also have access to the folders loaded into the project so can build the correct path within the test directory.

Okay onto a new thought :smile:

To be honest, I haven’t done much web development, so I’m not as familiar with those specific packages. It’s a tricky thing, with so many things in Package Control, it can be challenging/take a while to try all of the plugins that may be useful. With that being said, I know Emmet is a popular. I know some people also like the AutoFileName plugin. Another one (at least I) find useful is BracketHighlighter. Though probably not immediately useful, if you (or anyone at MediaBlinkk) develops tools, improves syntax definitions, etc ScopeHunter is a useful plugin to have.

The plugins can probably force a refresh request, but I don’t know if the developers will get around to that. If you update to ST3, there are command listeners, so you can run some arbitrary code after a plugin executes which may also work. But for the time being, if you haven’t already (though I hope you have because refreshing via a menu is a pain), you can define a keybinding for it. The command you would use is “refresh_folder_list”.

0 Likes

#11

No worries, I actually understood, what you meant, even with the snippet of text. =) No prob.

Yeah I think sooner or later we’ll just create a quick plugin that 1 click copies everything to test, and as well allows a person to right click files/folders and then automatically copies them to test, with a user config that allows you to set the test directory and any other needed options. And then release it back into the community. If there isn’t one already.

I think that most test env directories, probably mirror both production env and in many cases development env directory structures. So should be a snap. And that will let us go back to using traditional ST2 projects and projects as they should be used.

That way we can go back to using a CodeBlinkk project, an IdeaBlinkk project, a test project plus other misc projects and have them each encapsulated as projects like they should be. Less mind bending. =) And then we can just Ctrl+Alt+P between the projects and the test project. Put us back to our normal projects.

We can then probably extend that plugin, to add a quick plugin that 1 click copies everything/files that have changed to a remote production server where needed. Also with a user config. Should be easy enough. Then release that to the community.

We, much probably like you create most everything in reusable libraries as we see this as sort of a bootstrap system that allows a person to quickly create all kinds of different online software applications and software patterns and then infinitely customize them to make them your own. So we may not have too much use for emmet, as we are usually customizing or extending something or starting with a pattern to jumpstart the process and to reuse, reuse and save time. =)

We do actually create a development center tool called CodeBlinkk, for people to fully customize their stuff, as long as they know PHP, CSS and some javascript or if they don’t the development center, CodeBlinkk will actually hold their hands, from new to software to pro. So I’ll take a quick peek at the ScopeHunter could be helpful. And we are coming out with an API so I hope the doc stuff plugins here helps us out a bit.

My apologies to anyone listening for any of the information above, I just wanted to make sure to answer his question.

Once we actually create the plugins above I think that refresh thing will be less of a bother, since we’ll be able to switch to and open an actual test project in ST2.

You’d be surprised how close our development is to regular shrink wrapped software development. =) Except instead of deploying to a computer, we deploy to a server on the web and to phones, smart devices and iPads and Android tablets.

I’ll give all this some thought, thanks again for your help!

Best,

-C

0 Likes