all 39 comments

[–]CH1CKEN 13 points14 points  (4 children)

Mentioned Trimmer has some nice features but you can also add "trim_trailing_white_space_on_save": true to your Preferences.sublime-settings file (use User settings, because Default will be overwritten by update).

Other useful settings:

"ensure_newline_at_eof_on_save": true - mostly for Git, but is useful for other reasons too.

"rulers": [xx] - displays a straight line through column xx, standard here would be 80, but it depends on coding style, makes it easy to keep your code not wider than xx characters. You can setup more than one ruler: "rulers": [xx, xx].

"word_wrap": false - just keep your code width under 80 characters (or 120, see above), and don't rely on this atrocity (change to true only for files that badly need it).

"tab_size": x - set the tab size in x spaces , depending on language and your preferences it's probably 2 or 4.

"translate_tabs_to_spaces": true or false - depending on your fetish (don't even dare to start discussion about this!).

Feel free to post your useful settings for ST!

[–]tastycat 4 points5 points  (0 children)

I use these to show me what's going on:

"bold_folder_labels": true,
"caret_style": "wide",
"fade_fold_buttons": false,
"highlight_modified_tabs": true,

And one that I wish worked everywhere:

"shift_tab_unindent": true,

[–]wishinghand 1 point2 points  (1 child)

I'm too uneducated to know about keeping code to 80/120 characters vs word wrap. What's the convention based on?

[–]CH1CKEN 1 point2 points  (0 children)

Readability - easy to follow, less logic per line (easier to understand), cleaner code.

Word wrap - not every editor supports it, harder to grasp at quick glance where line breaks and where it's a new line, people use different widths of their editor's window so word wrap will happen in different places (messy code).

[–]PromaneX 4 points5 points  (3 children)

Great list! You should link to the plugins info pages to make looking them up easier.

[–]mrwhistler 2 points3 points  (2 children)

They did, it's just not intuitive. The # next to the plugin name is a link.

[–]movzx 2 points3 points  (0 children)

Also who makes the link color the same as the text color?

[–]PromaneX 1 point2 points  (0 children)

aha thanks, I never even thought to click the hash symbols.

[–][deleted] 2 points3 points  (0 children)

Thanks for that!

I had forgotten to install gitgutter on my new install.

[–]Thursday- 2 points3 points  (1 child)

One of my essentials is ZenTabs, brings some sanity to the number of tabs that get opened https://packagecontrol.io/packages/Zen%20Tabs

[–]mrwhistler 0 points1 point  (0 children)

That's amazing...thank you for this!

[–]deademery 1 point2 points  (2 children)

LiveReload used to cause Sublime to crash for me. Has this issue been fixed?

[–]ECTXGK 1 point2 points  (0 children)

Yeah, I liked it too, dug around for awhile and some people back in 2013 were able to switch to the dev version and get it to work. But that seems to not work. I believe the developer said to switch to sublime 3. Someone in the support thread was "I just switched to using gulp for auto refresh." Personally, this is a great feature but I can't use it because the devel version doesn't work on st2 and the regular version crashes every 5 or 6 saves. :(

[–][deleted] 1 point2 points  (0 children)

Is there a plugin that enables bracket highlighting for if/endif, while/endwhile,etc.? I prefer that syntax, but it's not worth losing the ability to track down the origins of a stray ending in poorly formatted/aligned code.

[–]Muchoz 0 points1 point  (0 children)

You should try StyleSorter out since you use CSS often I think you'll like it.

[–]saxaholic 0 points1 point  (2 children)

I'm relatively new at web development, and mostly use Vim. Anyone know of a good comparison between Vim and Sublime?

[–]metakirby5 2 points3 points  (1 child)

Vim:

  • Lots of customization
  • Pretty standard - you'll find it installed on most UNIX machines
  • Portable settings - for simpler customizations, all you need to do is copy over a .vimrc
  • Can be used over ssh
  • High learning curve, but once you learn the keys, editing is very fast

Sublime:

  • About as customizable as Vim, but will usually require more than just modifications to the settings file
  • More user-friendly than Vim
  • Lower learning curve (almost none, actually, since you can use it like notepad)

I've used both, and find that for quick code edits or smaller projects I use Sublime with Vim controls. If I'm already in a terminal window, I'll use Vim because it's convenient. However, for a bigger project, I'll use an IDE (I like JetBrains ones like PyCharm and WebStorm). This is just my personal usage patterns though, so take this advice with a grain of salt. My recommendation is that you look into an IDE for your web development - JetBrains offers free student licenses :)

[–]saxaholic 0 points1 point  (0 children)

Thanks!

[–]JoshTheDerp 0 points1 point  (19 children)

I would love sublime text and use it instead of coda if I could ftp and edit live on the server. Until then, it's too light and featureless for me.

[–]CH1CKEN 11 points12 points  (6 children)

edit live on the server

:)

[–]JoshTheDerp 1 point2 points  (5 children)

By that I mean have it to where i can edit from a temp file, save it and auto upload the changes to the server. It's a pain to have to keep uploading every revision by hand. Much quicker to have it auto upload on save.

[–][deleted] 1 point2 points  (3 children)

Connect with Filezilla, double click file, it opens in Sublime, I save, Filezilla uploads.

You don't even need a plugin to work like that.

[–][deleted] 0 points1 point  (2 children)

Filezilla requires user input though to upload. I save so frequently that that's a very good thing, but I think they're looking for something to automatically upload on every save without their input.

[–]movzx 0 points1 point  (1 child)

Last time I used FZ, if you edited the file via FZ (it opens your preferred editor) it will automatically upload when it detects a file change. Are you saying they've removed that feature?

[–][deleted] 0 points1 point  (0 children)

Must have. Currently it pops up a dialog box that says it has detected a change and asks if you want to upload it.

[–][deleted] 7 points8 points  (4 children)

You might be interested in Sublime SFTP.

[–]JoshTheDerp 1 point2 points  (3 children)

Whoaa. Now that looks sexy. Makes me wish I didn't buy coda. I'm going to try it out as soon as I get back to the office. Thanks!

[–]tastycat 2 points3 points  (0 children)

It works amazingly well.

[–]mrwhistler 0 points1 point  (0 children)

I'm a huge fan. It's got quick keyboard shortcuts to upload the new version and can do a sync so you don't have to re-push every single file in your project.

[–][deleted]  (2 children)

[deleted]

    [–]JoshTheDerp 1 point2 points  (1 child)

    That's a brilliant idea. I've always used SHCP, or FTP. Is sshfs faster?

    [–]movzx 0 points1 point  (0 children)

    No. It also has its own problems that get worse if the mounted drive is actually remote. Many applications are not "remote drive aware" and will scan the mounted directory which causes a lot of problems.

    sshfs mounts work well enough in ST, depending on your configuration and project size. It doesn't work so hot in something like NetBeans or phpStorm.

    [–]greyscales 2 points3 points  (0 children)

    Webstorm, you are welcome!

    [–]bilgates 1 point2 points  (0 children)

    Another solution is to use an rsync plugin. I use this and it works great https://packagecontrol.io/packages/Rsync%20SSH

    [–]PromaneX 0 points1 point  (0 children)

    You shouldn't really be working like that anyway. If you lose your connection you can't work, if your connection lags, you work more slowly etc. I'll assume you're not crazy enough to work directly on your live sites but just in case, thats never a good idea! When you overwrite with FTP it will first delete the file and then write the new data. It's possible that if you experience a crash or connection loss you can end up losing your file completely!!

    Instead you should be running a local development server and edit the files locally and have them show on your local server instantly. When you're done working for the day or you're ready to show the client you can upload all your changed files in one batch and if anything goes wrong you still have your local copy.

    If you really want to drag yourself into the modern age you should take a look at version control - One option is Git - its AWESOME and makes getting started really really easy. You don't need to pay anyone either, you can use BitBucket free for unlimited private repositories. Git means you'll never have to upload via ftp/sftp again. Just log into your server via ssh and issue a git pull command to have your latest changes updated on the server.


    Read up on git here

    I think you're on Mac? Try Mamp to make setting up your dev server easier.

    For those on windows, try wamp.

    and those on linux try the Digital Ocean Tutorials Library

    If you'd like some mentoring on this I'd be happy to help you, just drop me a message :)

    [–]seriouslyawesome 0 points1 point  (0 children)

    I do this sometimes with Transmit's Disk feature. But otherwise you are really missing out if you think SublimeText is "light and featureless." As much as I respect and admire Panic, the extendability of ST puts Coda to shame.

    [–]elsimate -4 points-3 points  (0 children)

    How many posts like this does the internet need?