sublime-text-plugin

How to enable sublime text to take first line as file name while saving?

纵饮孤独 提交于 2019-12-06 05:30:46
Earlier the Sublime used to take first line as file name by default but now it's "untitled". Is there a way to enable it or is there a plugin for that? Thanks The first line is only used as the file name for unsaved files when the syntax is set to Plain Text. As soon as you change the syntax highlighting and type something, it will change the tab name to "untitled". The implementation for this is in the Default package, set_unsaved_view_name.py file. To get it to work for all syntaxes: Install PackageResourceViewer through Package Control if it is not already installed Open Command Palette

Get all scope names on Sublime Text 3

浪尽此生 提交于 2019-12-05 03:42:37
I am creating a plugin for ST3 and need the list of all defined scopes. I know that hitting ctrl+alt+shift+p shows the current scope in the status bar but I can't do it for every file extension. Edit: In addition to simple .tmLanguage files I am extracting the .sublime-package files and reading .tmLanguage files from inside. This added some entries like source.php to the list. But source.python is still missing ! Actually, the python code is: ( this is for Python 3.3 ) import sublime, sublime_plugin, os, subprocess, glob, tempfile, plistlib from zipfile import ZipFile def scopes_inside(d):

PHP Syntax Check in Sublime Text Editor

∥☆過路亽.° 提交于 2019-12-04 23:43:30
问题 In Gedit, I can add an External Tool of "php -l" on the current document, and if I have PHP command line installed, it will syntax check the document. Is there a way to do this with Sublime Text Editor? (Note, I have a Mac and it has PHP CLI installed.) I imagine I'll have to paste a code snippet into Sublime plugin, right? 回答1: The action you are referring to is called "linting" and there are a number of plugins for Sublime that lint PHP files. As mentioned by Len_D, PHP Syntax Checker is

Save the edit when running a Sublime Text 3 plugin

只愿长相守 提交于 2019-12-04 19:17:30
问题 For understanding what I'm trying to achieve : printing delayed text in another view... I'm trying to make this sublime text 3 plugin run properly I want to call multiple method of my class using the edit passed in parameter of my run method as so : # sample code, nothing real class MyCommandClass(sublime_plugin.TextCommand): myEdit = None def run(self, edit): self.myEdit = edit # stuff self.myMethod() def myMethod(self): # use self.myEdit ... And I try to use it later on another method, but

How to Enable MathJax Rendering in Sublime Text Markdown Preview

情到浓时终转凉″ 提交于 2019-12-04 16:58:15
问题 Using Sublime Text 3, I'm writing a Markdown document that includes math. The Markdown Preview package enables real-time rendering of the document in the browser (Chrome). So as I write, the changes are visible. The following is my markdown text. $a = \sin^{2}(\Delta \phi/2) + \cos(\phi_{1})\cos(\phi_{2})\sin^{2}(\Delta \lambda/2)$ $c = 2 \arcsin(\sqrt{a})$ $d = rc$ MarkdownPreview manual says something like "When enable_mathjax is true ", but I cannot figure it out where it is. For

Comparing the contents of two files in Sublime Text

空扰寡人 提交于 2019-12-04 07:18:38
问题 I have two cloned repositories of two very similar open-source projects, which I have been working on in different instances in Sublime Text 2 to arrive at my desired result. Code from both of these projects was used. I have been using Git as version control for my project, but have not included the original projects. Thus, I would like to be able to quickly compare the contents of two files of the original project and compare the differences between them and my project. I was hoping that

Set my own syntax in Sublime Text

蹲街弑〆低调 提交于 2019-12-03 22:48:05
问题 Sometimes I use Sublime Text for writing reminders. I always use the same layout for this task which looks like this : >Title >>Subtitle >>>Comment > Title >> ... Where a > represent a tab character So I'm wondering if it's possible to create my own syntax highlighting for this kinds of files, with one color for the title, another one for the subtitle and the regular color for the comment. 回答1: Syntax highlighting is performed using .tmLanguage syntax definitions. They are formatted in Apple

How to enable brackethighlighter plugin in sublime text 3?

戏子无情 提交于 2019-12-03 17:15:51
I am using sublime text 3 build 3059 , brackethighlighter plugin is installed but not working how to make it work ? i tried several solutions but no effect. here is screenshot: The plugin is working - you'll notice in your screenshot that the opening and closing {} brackets are bold underlined in white (the default style), and are also shown in the gutter, next to the line numbers. If you want to customize the display more, first open Preferences -> Package Settings -> Bracket Highlighter -> Bracket Settings - User . It will be blank at first. Next, open ... -> Bracket Settings - Default .

PHP Syntax Check in Sublime Text Editor

霸气de小男生 提交于 2019-12-03 16:02:17
In Gedit, I can add an External Tool of "php -l" on the current document, and if I have PHP command line installed, it will syntax check the document. Is there a way to do this with Sublime Text Editor? (Note, I have a Mac and it has PHP CLI installed.) I imagine I'll have to paste a code snippet into Sublime plugin, right? MattDMo The action you are referring to is called "linting" and there are a number of plugins for Sublime that lint PHP files. As mentioned by Len_D, PHP Syntax Checker is one, but I'd actually recommend SublimeLinter for Sublime Text 2 instead. (There is a different

Save the edit when running a Sublime Text 3 plugin

▼魔方 西西 提交于 2019-12-03 12:29:30
For understanding what I'm trying to achieve : printing delayed text in another view... I'm trying to make this sublime text 3 plugin run properly I want to call multiple method of my class using the edit passed in parameter of my run method as so : # sample code, nothing real class MyCommandClass(sublime_plugin.TextCommand): myEdit = None def run(self, edit): self.myEdit = edit # stuff self.myMethod() def myMethod(self): # use self.myEdit ... And I try to use it later on another method, but when I execute the plugin I get this error : ValueError: Edit objects may not be used after the