Home Download Buy Blog Forum Support

Simple questions from a real beginner

Simple questions from a real beginner

Postby PhyWand on Thu Apr 12, 2012 12:11 pm

I more or less stubbled across Sublime, and am finding the experience good...

But (isn't there always):

    Where do I set the font face (Mac OSX) - that is in which settings file? I tried a few, and got nowhere- the one alluded to in the documentation seems a bit elusive (aka, I cannot find the thing)?

    Is there a simple way to concatenate a series of operations on the text files - I guess writing a macro, rather than recording one?

( As an indication of my competence/ willingness to spend hours tinkering, I can write snippets, but have baulked at extending the syntax colouring...so far.)

Settle these, and I think I might defect to Sublime full time...

Thanks in antiicpation

Ian
PhyWand
 
Posts: 5
Joined: Thu Apr 12, 2012 12:02 pm

Re: Simple questions from a real beginner

Postby guillermooo on Thu Apr 12, 2012 1:00 pm

About settings, perhaps this can help:

http://docs.sublimetext.info/en/latest/ ... tings.html
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Simple questions from a real beginner

Postby SeanWcom on Thu Apr 12, 2012 1:23 pm

I don't have a Mac in front of me, but the steps should be similar for setting your font. Click Preferences, then "Settings - User" and that will open up the Preferences.sublime-settings file. This is a json formatted file. Here's a short example of how you'd specify the font:

Code: Select all
{
  "font_face": "Consolas",
  "font_size": 11
}


Note that there are a TON of settings you can change in here. The best reference is in the master list of settings. Click Preferences, then "Settings - Default" to view the json formatted list of default settings (with comments). It's recommended that you don't change the settings here, but copy them to your user settings instead.

Lastly, just be sure to maintain proper json structure. Note in my code snippet above that there's not a comma after the font_size declaration. Adding a comma will break the parsing. You may be thinking, "duh" but I'd rather give you too much info. :)
Multiple selections... one of my favorite ST2 features. View some noob-friendly screen casts here.
SeanWcom
 
Posts: 101
Joined: Wed Aug 03, 2011 1:31 am
Location: Georgia

Re: Simple questions from a real beginner

Postby SeanWcom on Thu Apr 12, 2012 1:27 pm

PhyWand wrote:Is there a simple way to concatenate a series of operations on the text files - I guess writing a macro, rather than recording one?


What are you trying to do? I'm thinking that learning how multiple selections work, and getting comfortable with a few hotkeys will get you started in the right direction, but I'm not sure if I'm reading your question right. I used to have some nice multiple selection screencasts laying around, I'll see if I can find them.
Multiple selections... one of my favorite ST2 features. View some noob-friendly screen casts here.
SeanWcom
 
Posts: 101
Joined: Wed Aug 03, 2011 1:31 am
Location: Georgia

Re: Simple questions from a real beginner

Postby PhyWand on Thu Apr 12, 2012 1:48 pm

@SeanWcom

Thanks. It was the comma...I think :D . Maybe just too late last night, but having read the documentation and examples, I could not get it to play ( I thought I'd tried with and without commas). Now it does, I'll probably be happy going through the system profile and copying over those bits as I need them on-I noticed the TON- probably learning by example about json structure as I go (and not being too much of a pest, I hope)

@guillermooo
Thanks.. That helped me set up, e.g., the non-distraction mode —but I could not get the fonts to work.

@SeanWcom

About the macro. I another text editor I have a series of grep search and replace / selected line deletions depending on the contents of the line, etc (30-40 actions, I'd guess). Those actions, when performed in the correct order turn a series of conTEXt files into html files. In Sublime I cannot easily see how I'd store a series of such actions to perform the lot using a single invocation. I'd guess at a command file that's read in. Thanks in anticipation. Ian
PhyWand
 
Posts: 5
Joined: Thu Apr 12, 2012 12:02 pm

Re: Simple questions from a real beginner

Postby SeanWcom on Thu Apr 12, 2012 2:08 pm

Gotcha - for that, you'd probably have to start learning the build system - which I haven't yet. I've relied on the hard work of others who have created plugins that do what I need. :) If I knew more python I might be willing to tackle some of those... anyway - the ST2 build system will let you take a source file and "build" it. How and what it does is up to how you've written the build script.

As an example, here's a plugin that will let you build markdown files (and automatically preview in your browser): https://github.com/erinata/SublimeMarkdownBuild

Your conTEXt files... are those similar to LaTeX? I did a search, and there's a LaTeXTools plugin here: https://github.com/SublimeText/LaTeXTools

That may not be related at all... but should give you an idea of what can potentially be done. The folks here on the forum are incredibly helpful and enterprising and are usually happy to help you get started, or in some cases, throw something together for you if you ask nicely. My Python-fu is weak though. :)
Multiple selections... one of my favorite ST2 features. View some noob-friendly screen casts here.
SeanWcom
 
Posts: 101
Joined: Wed Aug 03, 2011 1:31 am
Location: Georgia

Re: Simple questions from a real beginner

Postby PhyWand on Thu Apr 12, 2012 4:48 pm

OK, thanks.

Not a quick process, then (for me, at least—python and I had a glancing blow a while back). It was not clear to me from a quick skim of the documentation that build files could access the commands within the engine itself. Having read a bit more, it's more obvious, but also more obvious that I'll need to get to grips with python to do anything much, and that might take more time than it gains, fun although it might be.

FWIW, it seems to me that there might be a few people who could have a need to string together a series of regex replace functions, so maybe worth a feature request? What I have in mind is that I write a text file containing, e.g.

Scope: xxx Find : <regex> Replace <regex>
Scope: yyy Find: <regex> Replace <regex>
....
Scope: yyy Find: <regex> Replace <regex>

And that some cunning piece of code picks up my file and crunches through them one at a time....

Maybe there is even someone who can write a top and tail to this, so that anyone can fill in the middle with what they want to do. I understand the flexibility built into Sublime, but maybe a meso-level will make the power more accessible? That seems very much in keeping with the configuration files approach...

BTW: this place passes the friendly natives text, always important when considering investing time in a piece of software.
PhyWand
 
Posts: 5
Joined: Thu Apr 12, 2012 12:02 pm

Re: Simple questions from a real beginner

Postby facelessuser on Thu Apr 12, 2012 4:59 pm

You can check out https://github.com/facelessuser/RegReplace

It allows you to create regex sequences you can run. You can configure it to even run a sequence on file save etc.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Simple questions from a real beginner

Postby PhyWand on Thu Apr 12, 2012 8:08 pm

8-) Thanks for showing me that.

Looks just the business: but for tomorrow now. It's late here.
PhyWand
 
Posts: 5
Joined: Thu Apr 12, 2012 12:02 pm

Re: Simple questions from a real beginner

Postby PhyWand on Mon Apr 30, 2012 9:13 am

PhyWand wrote:8-) Thanks for showing me that.

Looks just the business: but for tomorrow now. It's late here.


A big thanks to the faceless one for creating this. After a spell overseas I'm back on the case, and getting to grips with it—slowly, but that's just me. But looks really nice: flexible and easy to see what you've done, and can do....so long as I remember to put those commas in the correct places

And an aside.. Having project files that can themselves be edited by ST2: hours saved (and reinvested) already...
PhyWand
 
Posts: 5
Joined: Thu Apr 12, 2012 12:02 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 30 guests