treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Using Sublime Text 2 with PRE and CODE annoyance.

  • Howdy beautiful people of css-tricks... I use Sublime Text 2 religiously and love it, but as of late im having an annoying problem (more like annoyance).

    On my website i show code snippets. What i use is Google's prittyprint and a custom theme i created, well a couple different themes. But when i add my code in Sublime i cannot add any indentions between the pre element. Otherwise it will indent my code when rendered.

    I was wondering if anyone else has had this problem or if this is just a common "suck it up and deal with it" kind of situation.

    If yall need some more clarification ill take some screen shots. Basically i want to indent my pre elements in my text editor (to have nice clean readable code) rather than having them indent on my actual page.

    Thanks guys...

  • I use google Prettyprint without knowing quite that well how it works...but I am not understanding what "indentations between pre" is...

  • Basically, when i write some code (< pre >< code >), i want it to look aligned with the rest of the code, readable, etc. When i use pre and code tags, it makes it difficult because if i add any tabs or spaces, it will render those tabs and spaces as well

    Code indention: Pre Code Tabing

    Code Rendering: Pre Code Rendering

  • I think I'd call this a "Suck it up and deal with it" situation. You can't really get around it since you want your text-editor not to show you the actual HTML. There are ways of achieving what you want but it would be much to much effort for very little reward.

  • @jamy_za, alright man. Doing some research on the matter i think you're right. Im just gonna have to suck it up. Thanks for confirming lol..