Sublime Forum

Txt File Syntax and Format Problem

#1

I am having an issue with the syntax/format for txt files, I am using Grandson Of Obsidian but even when I change it the problem remains. Grandson Of Obsidian is a dark theme, and when I open a text file it is grey, with dark grey font. In addition the text in the text file is about 1/3 from the border, there is no way to move it. It is almost like there is a forced margin.

http://s18.postimg.org/5ay8l0vrp/sublime_problem.jpg

I have tried to figure this out myself but I cannot. I would appreciate any guidance.

Thank you.

0 Likes

#2

Don’t know about the coloring issue, but ensure “draw_centered” is not set to true in your user preferences (it defaults to false). You could also just add “draw_centered”: false to your user preferences.

After you open a file, if you go to Preferences -> Color Scheme, is Grandson of Obsidian selected?

0 Likes

#3

Hey,
The resident expert is back.
So the draw center is not in my user preferences. And the theme is the same after I open a file. Poking around in my preferences reminded me that I recently added a package for MarkDownEditor, and this seems to be a recent issue. I will do some testing to see if this is the issue. I appreciate the help.

derrick

0 Likes

#4

That was exactly it, MarkDown Editor package! That said I want to use MarkDown Editor without it screwing with my .txt files. Why would it do that?

0 Likes

#5

Can you post a link to that package? I can’t find it on package control.

0 Likes

#6

I am pretty sure this is it:
github.com/ttscoff/MarkdownEditing

0 Likes

#7

And of course the old classic, I reinstalled it and things are fine. Humm, my brain is so far gone with django I am not quite on my game of figuring stuff out.

0 Likes

#8

I took a quick look at some of the settings in that plugin. They do set change it (take a look at Markdown.sublime-settings). Anyways, setting in your user settings should override what they have. I’m not sure why they decided to roll their own coloring file, but that’s besides the point. Anyways, glad things got fixed for you.

0 Likes

#9

Josh Earl’s SBT tips most recent e-mail answered it, I think:
"Sublime does a decent job of guessing what syntax highlighting to apply when you open a file, but it can’t quite read your mind. (Although I’m thinking of submitting a UserEcho request for ST4 … anybody with me?)

So it has no way of knowing that you want .txt files to always open with Markdown highlighting.

Fortunately, there’s a simple fix: Sublime allows you to specify what syntax to use for a given file extension.

To force Sublime to open all .txt files with Markdown highlighting, open a file with a .txt extension, then click View | Syntax | Open all with current extension as … | Markdown."

1 Like

#10

Yup that works. Another possible solution is using a plugin like ApplySyntax. For a file extension, I believe this will give you the same behavior. The benefit of ApplySyntax is it gives you a bit more flexibility. For example, with the plugin, you can look for a particular mutlipart extension, such as *.spec.rb. You may also look at the the contents of the file and do some pattern matching. For what it’s worth, I believe ST guessing is based on a list of extensions/patterns defined in the tmLanguage file.

0 Likes