Finding file location of snippets - sublimetext2

I have a bunch of snippets installed. Some of them are intrusive and I would like to change their tab insertion code. Is there any way to quickly open the edit file of a snippet that I find from the Control+Shift+P directory?

For Sublime Text 2, in a word, no. The Command Palette does not have that functionality built-in. However, if you select Preferences -> Browse Packages... your OS will open up an Explorer/Finder/Nautilus/whatever window of the Packages directory. All packages/plugins are in (hopefully clearly-named) subdirectories, so if you don't like some Rails snippets, for example, look in the Rails directory for a likely file with a .sublime-snippet extension. These files are XML-based, and can be opened right in Sublime for editing.
Please note that this method only works in this straightforward manner with Sublime Text 2. In ST3, unless otherwise specified by the package author, all packages are in .sublime-package zipfiles, and are stored in a few different locations. To ease things, my good friend #skuroda wrote the PackageResourceViewer plugin, which allows the user to navigate through ST3 packages, view/edit files contained therein, and expand whole packages to the aforementioned Packages directory for editing of any file.

Related

Notepad++ re indent code? [duplicate]

Is there a way to re-indent a block of code? I'm looking for something similar to Ctrl+Shift+F in Eclipse (Auto-Format/Indent).
To be clear,
I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don't need a bunch of links to other XML-formatting tools.
I'm specifically working with XML and HTML.
Ideally, there's a keybinding as convenient as the one in Eclipse, so I don't have to break my workflow.
I already know about NppAutoIndent - it won't work, as I'm working with XML, HTML and CSS.
Since I upgraded to 6.3.2, I use XML Tools.
install XML Tools via the Plugin Admin (Plugins → Plugins Admin... Then search for "XML Tools", check its box and click the "Install" button).
use the shortcut Ctrl+Alt+Shift+B (or
menu → Plugins → XML Tools → Pretty Print)
In older versions:
menu → TextFX → HTML Tidy → Tidy: Reindent XML.
Install Tidy2 plugin. I have Notepad++ v6.2.2, and Tidy2 works fine so far.
For those who don't know, npp has a lot of support from plugins and other projects. You can download those plugins from SourceForge.
You need XML Tools to format your text in n++
After you have downloaded XML Tools ..
Exit Notepad++
Go To C:\Program File\Notepad++ .... Your N++ installed folder.
Place below files from xml tools which you downloaded in the npp root folder by copy replace
Go To ..\Plugins subfolder and place below downloaded file
Restart and enjoy!!!
Ctrl + Alt + Shft + B to format.
It's been the third time that I install Windows and npp and after some time I realize the tidy function no longer work. So I google for a solution, come to this thread, then with the help of few more so threads I finally fix it. I'll put a summary of all my actions once and for all.
Install TextFX plugin: Plugins -> Plugin Manager -> Show Plugin Manager. Select TextFX Characters and install. After a restart of npp, the menu 'TextFX' should be visible. (credits: #remipod).
Install libtidy.dll by pasting the Config folder from an old npp package: Follow instructions in this answer.
After having a Config folder in your latest npp installation destination (typically C:\Program Files (x86)\Notepad++\plugins), npp needs write access to that folder. Right click Config folder -> Properties -> Security tab -> select Users, click Edit -> check Full control to allow read/write access. Note that you need administrator privileges to do that.
Restart npp and verify TextFX -> TextFX HTML Tidy -> Tidy: Reindent XML works.
Not exactly a solution but a workaround.
Notepad ++ doesn't provide any such feature by default. But you can use some online tools to autoformat text like https://www.freeformatter.com/xml-formatter.html.
I had to update the proxy settings under Plugins -> Plugin Manager -> Show Plugin Manager -> Settings to see any PlugIns in the "Available" list.
After that, installing "XML Tools" was easy and did the requested job as described above.
Just install the latest notepad++ and install indent By fold. On the menu bar select Plugins -> Plugins Admin and selct indent By fold and the install. Works finest
To directly answer the OP, take a look at this guy's site: Thomas Hunter Notepad++ Tidy for XML. Simple steps to follow and you get very nice formatting of your XML right inside NPP. So far the only anomaly I've found is with nested self closing elements EG:
<OuterTag>Text for outer element<SelfClosingTag/></OuterTag>
Will be tidied up to:
<OuterTag>Text for outer element
<SelfClosingTag/></OuterTag>
There may be a way to fix this, but for the time being, it's managed to reduce the number of lines in my document by 300k and this particular anomaly can be worked around.
I'm using Notepad 7.6 with "Plugin Admin" and I could not find XML Tools.
I had to install it manually like #some-java-guy did in his answer except that my plugins folder was located here: C:\Users\<my username>\AppData\Local\Notepad++\plugins
In that directory I created a new directory (named XmlTools) and copied XMLTools.dll there. (And I copied all dependencies to the Notepad++ directory in Program files.)

ExtendScript plugin for Webstorm or PhPstorm?

when scripting for after effects I often use ExtendScript.
There is an extendscript package available for sublime text out there.
https://sublime.wbond.net/packages/ExtendScript
(this makes it possible to run your script directly from sublime text into after effects)
I was wondering if there is also something like this out there for any JetBrains IDEs (like WebStorm or PhpStorm etc.). I do know it has several plugins in it, but i don't know if there was ever one made for Expendscript like the one for sublime text.
I'm not aware of any... Please see http://devnet.jetbrains.com/message/5496889#5496889 for some hints
To be able to run adobe scripts from WebStorm, you can use external tools (Settings/External tools):
create a new external tool
specify a full path to Adobe tool capable of executing .jsx ("C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe", for example) as a 'Program'
add $FileName$ as parameters
set a working directory to $FileDir$
make sure to check Show in/Project views and Editor menu to be able to run your tool from file right-click menu in Project view/Editor
then you'll be able to run your tool from a right-click menu of your .jsx file - the file will be passed to Photoshop as an argument

How to edit Sublime Text 3 Soda Theme

I installed the Soda Theme on Sublime Text 3 on OSX and I was wondering where are the actual files and folder to the theme that way I could look at the theme file and make my own edits to it, along with I would like to adjust a few of the images used in the theme.
On the Git documents it says if you are to manually install Soda on Sublime you place the soda folder in the package directory, although when I install Soda via Control Package I don't see the Soda theme in package directory.
Unless explicitly designated to not use it, most packages for Sublime Text 3 use the .sublime-package format (essentially a zip file). These packages are stored one directory up from the Packages folder, in Installed Packages. If you want to work with them, I highly recommend getting the PackageResourceViewer plugin by #skuroda. Install it via Package Control.
Once installed, open the command palette with ⌘⇧P and type prv to get the PackageResourceViewer options. Choose Extract Package, navigate down to Theme - Soda, hit Enter, and you're all set - the directory Packages/Theme - Soda should now exist with all the files from the Github repo in it. The .sublime-theme files will probably be the ones you're most interested in for now.
Have fun!
This answer is similar to the accepted solution, but with little more steps if it is not working out of the box. This might help someone if they are stuck with an issue which I have described in one of the below steps.
install PackageResourceViewer using Package Control
Go to Preferences->Package Settings->PackageResourceViewer->Setting-User. copy paste the following 3 lines,save and close it.
{
"single_command": false
}
press Ctrl+shift+p to open Package Control and select PackageResourceViewer: Edit Package Resource from the list. Find the package you want to edit and click on it. In my case, I want to edit a theme which is installed via ColorSublime Package, So I selected that theme.
Now you will see that the selected package file opened in the sublime editor itself. Edit it as you want and save it and close it. The changes should reflect in sublime editor. In my case, since I changed the theme I need reload it. So I continued with the following steps too.
go to view menu select 'Show Console' and run following command to reset the theme.
view.settings().erase("color_scheme")
open Preferences->Settings and delete the "color_scheme" attribute and its value from the settings file and close it. Again select the color theme from Preferences->Color scheme. Now you should able to see the changes reflected which you made in the theme package.
Hope this helps!
You can do it as follows.
Extract Soda theme from the Sublime Text 2 ~/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default folder
In Sublime Text 3, Select Sublime Text / Preferences / Browse Packages ...
Create a folder adjacent to the Users folder called THEMES.
Drop all themes you want from Sublime Text 2 (including Soda theme or any other themes) from the folder ~/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default into your ~/Library/Application Support/Sublime Text 3/Packages/THEMES folder from Sublime Text 3.
Edit the XML in the theme you want to use.
Back in Sublime Text 3, select Sublime Text / Color Schemes / THEMES / YourTheme.tmTheme to use it.

How do I edit HTML.tmLanguage in sublime on mac osx

I'm to change it to support non-quote id, as in:
<div id=someId></div>
I found this
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8129
But am having issues finding where to edit the tmLanguage file
Don't listen to Jamie's answer. You should never be editing the Pristine packages. Instead, you can find all of Sublime Text's packages and grammar files in ~/Library/Application Support/Sublime Text/Packages or, from within Sublime Text, go to Sublime Text > Preferences > Browse Packages. However, if you edit HTML.tmLanguage from within the HTML folder, your changes will be overridden when Sublime Text is updated. To prevent this, duplicate the HTML folder and renaming it to Better HTML. Then in your User Settings (Preferences > Settings - User) add the following:
"ignored_packages":
[
"HTML",
"Vintage"
],
By ignoring the default HTML package, Sublime Text will be forced to use your version of the HTML.tmLanguage file and your changes will be preserved.
You can find the HTML.tmLanguage file by going to /Applications and then control/right click on Sublime Text 2.app and select 'Show Package Contents'. Then navigate to /Contents/Mac OS/Pristine Packages/.
Inside that folder, you should see a collection of sublime-package files. Find HTML.sublime-package and rename it to HTML.zip. You should then be able to extract the archive, just like any other zip folder, and inside you should find all assests related to Sublime's HTML package - including the HTML.tmlanguage.
Make sure to recompress and then rename the folder back to .sublime-package after making your edits!
EDIT: I have since recognised that this is incorrect, the Pristine Packages should never be edited. Follow BoundinCode's answer instead!

How To Auto-Format / Indent XML/HTML in Notepad++

Is there a way to re-indent a block of code? I'm looking for something similar to Ctrl+Shift+F in Eclipse (Auto-Format/Indent).
To be clear,
I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don't need a bunch of links to other XML-formatting tools.
I'm specifically working with XML and HTML.
Ideally, there's a keybinding as convenient as the one in Eclipse, so I don't have to break my workflow.
I already know about NppAutoIndent - it won't work, as I'm working with XML, HTML and CSS.
Since I upgraded to 6.3.2, I use XML Tools.
install XML Tools via the Plugin Admin (Plugins → Plugins Admin... Then search for "XML Tools", check its box and click the "Install" button).
use the shortcut Ctrl+Alt+Shift+B (or
menu → Plugins → XML Tools → Pretty Print)
In older versions:
menu → TextFX → HTML Tidy → Tidy: Reindent XML.
Install Tidy2 plugin. I have Notepad++ v6.2.2, and Tidy2 works fine so far.
For those who don't know, npp has a lot of support from plugins and other projects. You can download those plugins from SourceForge.
You need XML Tools to format your text in n++
After you have downloaded XML Tools ..
Exit Notepad++
Go To C:\Program File\Notepad++ .... Your N++ installed folder.
Place below files from xml tools which you downloaded in the npp root folder by copy replace
Go To ..\Plugins subfolder and place below downloaded file
Restart and enjoy!!!
Ctrl + Alt + Shft + B to format.
It's been the third time that I install Windows and npp and after some time I realize the tidy function no longer work. So I google for a solution, come to this thread, then with the help of few more so threads I finally fix it. I'll put a summary of all my actions once and for all.
Install TextFX plugin: Plugins -> Plugin Manager -> Show Plugin Manager. Select TextFX Characters and install. After a restart of npp, the menu 'TextFX' should be visible. (credits: #remipod).
Install libtidy.dll by pasting the Config folder from an old npp package: Follow instructions in this answer.
After having a Config folder in your latest npp installation destination (typically C:\Program Files (x86)\Notepad++\plugins), npp needs write access to that folder. Right click Config folder -> Properties -> Security tab -> select Users, click Edit -> check Full control to allow read/write access. Note that you need administrator privileges to do that.
Restart npp and verify TextFX -> TextFX HTML Tidy -> Tidy: Reindent XML works.
Not exactly a solution but a workaround.
Notepad ++ doesn't provide any such feature by default. But you can use some online tools to autoformat text like https://www.freeformatter.com/xml-formatter.html.
I had to update the proxy settings under Plugins -> Plugin Manager -> Show Plugin Manager -> Settings to see any PlugIns in the "Available" list.
After that, installing "XML Tools" was easy and did the requested job as described above.
Just install the latest notepad++ and install indent By fold. On the menu bar select Plugins -> Plugins Admin and selct indent By fold and the install. Works finest
To directly answer the OP, take a look at this guy's site: Thomas Hunter Notepad++ Tidy for XML. Simple steps to follow and you get very nice formatting of your XML right inside NPP. So far the only anomaly I've found is with nested self closing elements EG:
<OuterTag>Text for outer element<SelfClosingTag/></OuterTag>
Will be tidied up to:
<OuterTag>Text for outer element
<SelfClosingTag/></OuterTag>
There may be a way to fix this, but for the time being, it's managed to reduce the number of lines in my document by 300k and this particular anomaly can be worked around.
I'm using Notepad 7.6 with "Plugin Admin" and I could not find XML Tools.
I had to install it manually like #some-java-guy did in his answer except that my plugins folder was located here: C:\Users\<my username>\AppData\Local\Notepad++\plugins
In that directory I created a new directory (named XmlTools) and copied XMLTools.dll there. (And I copied all dependencies to the Notepad++ directory in Program files.)