Live data from Hacker News

Configuring Sublime Text 2

mutuallyhuman.com

81–90 of 92 posts

Re: Configuring Sublime Text 2

#81
post #65

Earlier quoted context omitted.

If the file uses tabs, at least you can choose to display the indentations as 2 spaces or 4 spaces. If the file uses spaces, you don't get to choose.

This is my reason for preferring tabs. Plus changing indent levels is faster via arrow keys.

The main reason for preferring spaces is wrapping complex calls split across lines. (Of which there is a lot in some languages such as obj-c or JavaScript.) We just went through the whole tabs vs spaces debate on a new project here with, I think, open minds and a general preference for tabs, and ended up using spaces. The alternative was tabs for basic indentation and spaces for line wrapping but that's too hard to maintain.

YMMV

Re: Configuring Sublime Text 2

#82

I've been tweaking my Sublime for 5 months or so, and this is how my config file looks so far. "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "detect_indentation": false, "detect_slow_plugins": false, "font_size": 10, "highlight_line": true, "highlight_modified_tabs": true, "margin": 0, "move_to_limit_on_up_down": true, "remember_open_files": false, "shift_tab_unindent": true, "tab_completion": fa…

This is just my opinion, but I think detect_indentation should always be turned on. The reason being that having mixed indentation in a file is worse than having the "wrong" indentation.

I use tabs strictly in my projects, but often times I work on websites built by other people and there's a hodgepodge of 2 spaces, 4 spaces, and tabs. It's best to leave it as it is and get out as soon as possible.

Re: Configuring Sublime Text 2

#83

Earlier quoted context omitted.

So kind of you to assume that I haven't used it. I use it on Windows and after I formatted my Window 7 and am now on Windows 8, I don't have my Sublime text preferences with me and was wondering how people are versioning and syncing theirs. In vim ( which I don't claim to be an expert user), every setting is in .vimrc. Including the vundler bundles. Now, I have to reinstall all the plugins from Package Control. How d…

Not sure the path for windows, but on OS X you could make a repository at ~/Library/Application Support/Sublime Text 2/Packages. It doesn't separate out system packages (basically all your language info/syntax highlight settings), but all your user-installed packages go there and user settings are in Packages/User. If you cloned that folder into a fresh install, it should bring everything you had previously along wit…

That is actually a big gripe I have with ST2. I would love ST2 to have its config files in an easy Unix-like place. Like dotfiles, or better yet, dot-directories.

(why dot-dirs instead of dot-files? Because while Windows does support symlinks, many programs do delete/newfile instead of modifying files, which breaks symlinks. In a dot-dir, that does not matter.)

But really, this is not a big gripe, and furthermore one easily solvable uing symlinks.

Re: Configuring Sublime Text 2

#86
post #65

Earlier quoted context omitted.

If the file uses tabs, at least you can choose to display the indentations as 2 spaces or 4 spaces. If the file uses spaces, you don't get to choose.

This is my reason for preferring tabs. Plus changing indent levels is faster via arrow keys.

And even faster using tab or shift+tab to pop up or down a level, regardless of whether you're using tabs or spaces.

Re: Configuring Sublime Text 2

#88
For those who sometimes prefer straight GUI, you can just drag the folder into Sublime Text (or Textmate) and it will open it in the sidebar (probably obvious to some, but I did not know to do it until I saw somebody else do it).

Also, another thing I have grown really attached to:

Command-Option [1,2,3,4] to open up multiple views within one window, good for viewing several files at once.

Re: Configuring Sublime Text 2

#89
post #67

What I need to know is how are people versioning the settings? For Vim, a simple .vimrc is all I need to take care of. What do people do for Sublime?

Same way. The user settings are stored in a few plain-text JSON files. Also I would hardly call .vimrc files "simple".

That's hardly the same thing.

>a few .json files >one .vimrc

Re: Configuring Sublime Text 2

#90
post #30

> "trim_trailing_white_space_on_save": true, # trims trailing whitespace bad for Markdown, as it will delete spaces that are needed for newline, I believe.

I find this to be a questionable practice. When coding I like the idea of "trim whitespace from _my changes_ on save", but doing it globally within a file creates a lot of diffs and makes for convoluted commits. Having a +/- 75 lines when you fix a typo in a comment is annoying when doing a code review.

If everybody on the team uses SublimeText (or an equivalent vim extension) I think this is a good idea, but when you have some folks using TextMate or other editors that are notorious for leaving extra whitespace, I find it better just to live with it.

Post reply on HN