Questions tagged [sublime-text-plugin]

Sublime Text is a multi-language, multi-platform code editor with a Python-based plugin API. Use this tag for questions relating to Sublime Text plugin programming.

Sublime Text is a multi-language, multi-platform code editor with a Python-based plugin API. Use this tag for questions relating to Sublime Text plugin programming.

768 questions
5
votes
1 answer

How to get user input before saving a file in Sublime Text

I'm making a plugin in Sublime Text that prompts the user for a password to encrypt a file before it's saved. There's a hook in the API that's executed before a save is executed, so my naïve implementation is: class…
5
votes
3 answers

Convert php arrays with the new syntax

I looking for a way (regex, snippet ,plugin etc) to convert the old arrays with the new php syntax with sublimeText. // Old synthax $var = array( 'foo' => 'bar' ); // New synthax $var = [ 'foo' => 'bar' ]; someone has an idea ?
5
votes
1 answer

Sublime Text (3) plugin define new panel

I see a lot of calls to this show_panel function with an args object like this: { "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} } I cannot find where the show_panel function is defined and am…
km6zla
  • 4,787
  • 2
  • 29
  • 51
4
votes
1 answer

Snippet fails to be inserted silently in ST3

I have been following this, this, this, this and this to create my own template in ST3. So when I create a new file, I preload the file with template content. I have read I should do this with a snippet. I create a file and try to apply a snippet in…
user1156544
  • 1,725
  • 2
  • 25
  • 51
4
votes
1 answer

Sublimetext integration with Windows Subsystem for Linux (WSL, bash)

Is there a way of executing bash commands from sublimetext? In many projects it's just better developing with linux tools via the Windows Subsystem for Linux (WSL, bash) as most tools are built for linux. In windows, you can run bash commands in a…
4
votes
0 answers

Save search patterns with SublimeText

Often we write regex patterns in SublimeText with the "Search" or "Replace" feature: and then a few weeks later we need it again, but the only option to find it again is to use the UP or DOWN key to browse the past Regex history. These patterns…
Basj
  • 41,386
  • 99
  • 383
  • 673
4
votes
2 answers

How to install a program from GitHub?

I am very new to GitHub. Recently I downloaded a program for printing in Sublime Text from GitHub. Here is the link: https://github.com/svenax/SublimePrint But after I downloaded the program called SublimePrint-master.zip, I don't know how to…
dullboy
  • 207
  • 1
  • 3
  • 10
4
votes
2 answers

How can I accurately set the new cursor positions after text replacements have been made

I am trying to adapt a plugin for automated text replacement in a Sublime Text 3 Plugin. What I want it to do is paste in text from the clipboard and make some automatic text substitutions import sublime import sublime_plugin import re class…
Matt
  • 45,022
  • 8
  • 78
  • 119
4
votes
1 answer

Sublime Text Double Click highlighting modification

Sublime Text does not register a sass variable ($variable) as a single item when highlighting, so when I double click on the name, it highlights the word, but does not include the $-symbol in the highlighting. Visual Studio, on the other hand,…
Russell Strauss
  • 1,160
  • 3
  • 14
  • 30
4
votes
2 answers

Sublime Text Go To Folder Shortcut

I am familiar with sublime text's Ctrl+P to navigate between files, but is there any command or plugin to navigate between folders (Highlight them in the sidebar) and perform actions on them there?
4
votes
1 answer

Sublime Text menu item not working

I'm trying to create a sublime text plugin. I successfully created it, and I'm now trying to add an item to the menu, and when it's selected, it will call the plugin. I'm having trouble inserting the menu item in the correct place, and calling the…
Horay
  • 1,388
  • 2
  • 19
  • 36
4
votes
2 answers

Paste multi-cursor copy/paste WITHOUT newlines in sublime text

Is there a way to paste a multi-cursor (Ctrl+d, Ctrl+d, ... Ctrl+C) select, stripped of its newlines? If [...] represents the highlight, and ⦙ the cursor: The ⦙[red]. The ⦙[blue]. The ⦙[green]. And if I pasted I'd get: red blue green⦙ but instead…
Ashley Coolman
  • 11,095
  • 5
  • 59
  • 81
4
votes
0 answers

How to disable trailing space warning in sublimelinter

I am using SublimeLinter in sublime text 3. I want SublimeLinter to ignore trailing space warning as I've set "trim_trailing_white_space_on_save": true I dont like the red color warning while I am writing. It is distracting me. I tried this in…
4
votes
2 answers

How to Access a Class through "Ctrl+Click" in Sublime Text 3

I've got this class as an example: Which plugin do I use to be able to click on: PHPUnit_Framework_TestCase And get to the class? class PracticeTest extends PHPUnit_Framework_TestCase { public function testHelloWorld() { $greeting =…
LoveAndHappiness
  • 9,735
  • 21
  • 72
  • 106
4
votes
3 answers

Is it possible to show image in Sublime Text 3 output panel?

I am writing a sublime text 3 plugin. I have an image (PNG format). I would like to load this image into Sublime Text 3 custom output panel, to show it as a preview. Does anyone have idea how to do this or is it even possible?
Djuka
  • 505
  • 5
  • 19