Sublime Forum

Simple questions from a real beginner

#1

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

0 Likes

#2

About settings, perhaps this can help:

docs.sublimetext.info/en/latest/ … tings.html

0 Likes

#3

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:

{ "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. :smile:

0 Likes

#4

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.

0 Likes

#5

@SeanWcom

Thanks. It was the comma…I think :smiley: . 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

0 Likes

#6

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. :smile: 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): github.com/erinata/SublimeMarkdownBuild

Your conTEXt files… are those similar to LaTeX? I did a search, and there’s a LaTeXTools plugin here: 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. :smile:

0 Likes

#7

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 : Replace
Scope: yyy Find: Replace

Scope: yyy Find: Replace

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.

0 Likes

#8

You can check out 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.

0 Likes

#9

:sunglasses: Thanks for showing me that.

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

0 Likes

#10

[quote=“PhyWand”]:sunglasses: Thanks for showing me that.

Looks just the business: but for tomorrow now. It’s late here.[/quote]

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…

0 Likes

#11

Another big thank you to the “facelessuser” for this great package from an absolute beginner, who would also like to ask how a number of regex “find”: “”, “replace”: “” operations can be performed together.
Do we have to define them one by one and then perform all within a single command using “args”: {“replacements”: “<reg_ex_def_01>”, “<reg_ex_def_01>”]}
Or is there a way of creating a definition that includes a series of RegEx replacements?

0 Likes