Is it possible to extend Sublime Text 3's go_to_definition? - sublimetext

This will unfortunately be a broad question.
go_to_definition:
doesn't work for jinja2 macros
doesn't go to variable declarations
I also want it to add a suffix and search for that phrase too
Is it possible to improve the go_to_definition so I can make it work for the above scenarios?

As a matter of fact, it is possible, if you know Python. The GotoDefinition class is defined in the Default package in symbol.py (for some reason...). To access it in ST3, install the PackageResourceViewer via Package Control. Open the Command Palette, search for the PackageResourceViewer: Edit Package Resource option, scroll down to Default, then scroll down and select symbol.py. You can now edit to your heart's delight, and assuming everything goes properly, once you save the file the plugin should be automatically reloaded and you can test your modifications.
In case you're not that familiar with developing Sublime plugins, here is the API reference, the unofficial docs, and the Sublime forum for your perusal. Good luck!

Related

Sublime Text Plugin Modification

So I found this plugin: https://gist.github.com/KatsuomiK/3542836
And it is very close to what I'm looking for. I am trying to use sublime text 3 for note taking, and need some way to store images in my notes. Since sublime is a text editor, I do not hope to have actual inline images. Instead, what makes the most sense to me is to have local file links which I can click to open up an image. This plugin has the same click link feature, but it opens web links in a browser rather than local files. I'm actually not sure on what the most user friendly option would be, but here is one idea.
Hover mouse over local link (e.g. /Users/gus/image.jpg)
Press some hotkey
Image opens up either in preview or the quick look feature in OSX (would be nice since you could close with a simple spacebar)
If necessary there could be some kind of tag for a local link.
I am not experienced with making sublime plugins, but something tells me this could be a quite simple endeavor for a skilled coder. If you can help me out I would greatly appreciate it (and so would anyone trying to use sublime for note taking and even coding at times)

ace x markdown editor not working for joomla 3.2? alternatives?

So I installed the ace x markdown editor plugin for joomla 3.2 because it has a nice feature to insert code snippets in stackoverflow style. So I really need that.
I tried this extension, but it seems to not work. Is there an alternative?
But: There is no documentation, it seems I just have to enable it and hope it works. But it just happens nothing, the normal editor shows up:
No errors, but old editor:
the plugins are installed:
The plugin is supposed to look like this:
The second step you have to do is going to: Global configuration area and select the new editor, then if you save your changes and the old editor still appearing, it could be because your profile has the older one selected... in this case you have to go to your user details page and select the new editor or put into default.

sublime text 2 autocomplete codeigniter project

frustrated and hopelessly question.
so i downloaded sublime text 2 for first time, i installed packagemanager and a autocomplete.php file from
https://github.com/martinredola/sublimetext2-codeigniter-completions
now question is, how can i setup syntax autocomplete for codeigniter+html+css and disable all other irrelevant odd autocompelete list that pop up !!!
i'm looking for some one who tell me steps he did to make prefect workflow for codeigniter development using sublime text 2.
thanks alot in advance
There is.
Install Sublime Package Control
Then open "Package Control", choose "Package Control: Install Package".
Type in "CodeIgniter" and install the package "CodeIgniter Snippets".
codeigniter snippet doesn't properly work with sublime text 2. I use this package with sublime text 3 and i don't have problems and if you add the sublimelinter package you can do very nice things.
You must install the package control first, the instructions are in the page
https://packagecontrol.io/installation
then hit ctrl+shift+p and write "install package", a full list of applications will be shown then search Codeigniter Snippet and hit enter, repeat the process for sublime linter and it's done
Trust me, I have been down this route many times. In the end, simply it is not worth it. Codeigniter is just not setup for easy autocomplete items.
I use PHPStorm as well as sublime text 2 for work with codeigniter, and even phpstorm which is a commercial product does not have support for codeigniter. There are much more valuable things to setup in a developement enviroment for php, for example do you have a debugger? That was another thing that really helped with my codeigniter development.
I do not use it all the time, usually I like to use a lightweight solution like sublime text 2, but when you are working on pure php code and cant always just set var_dump and print_r statements everywhere - a debugger really helps.

Where to find the tags used in theme short codes? As well as the general tags used in pyroCMS?

I was wondering where to find the tags to type to take advantage of shortcodes programmed in themes. Many themes have them, such as the one below. However I can never find the information required to make use of them in the read me's or on site documentation. Which makes using them impossible for me. Is there a specific html, css, or php file that is consistent to each theme and shows them?
Given the lack of write ups on what tags to use suggests that theme creators expect people to know which file to find them in.
https://www.pyrocms.com/uploads/default/store/listings/11-25-2012_9-41-20_PM.png
https://www.pyrocms.com/uploads/default/store/listings/11-25-2012_9-41-20_PM.png
On a more PyroCMS rather than theme specific note, is there a list of all tags and their uses? Such as {{ settings:site_name }}, or the page body tag. Every link I have found to a list says that the list has been moved.
Thank you for your time once again.
Open up your file directory and navigate to:
path/to/your/files/system/cms/plugins/theme.php
Each one you can use is listed here along with an example in the function description. Each plugin in this folder is lined out the same way (files, session, asset, etc). You should be able to view each one and play with how to incorporate them into your project.
Edit: Also, you can find more information here: http://docs.pyrocms.com/2.1/manual/plugins
Notice that this is specific to version 2.1. If you are not using 2.1, in the top navigation add click on documentation and then select your version.

Modify contents of Firefox download dialog from add-on kit

I'd like to be able to add an option to the download dialog that pops-up in Firefox when starting a file download. Is it possible to do so using the new add-on SDK or do I have to do it the old way?
edit: Obviously, if the new option is selected, I need a way to know it and execute code based on it.
That's something you would use XUL overlays for. I guess that the dialog you are talking about is chrome://mozapps/content/downloads/downloads.xul - the download manager. AFAIK doing this isn't possible with the Add-on SDK, it only provides the most common UI integration points. You could create a traditional extension however, it can overlay any dialog.
There is no existing module that will help you that I know of, so you would have to create one, or wait for one to be made by someone else. But the main idea to extending browser UI is simple, and goes like this:
When the addon is loaded, scan for open windows of the type that you wish to extend.
extend the open windows by adding xul elements and javascript to the page.
listen for newly opened windows, and test that they are the type that you are looking for once they open
extend newly opened windows while your addon is active
Clean up after yourself when windows close or when your addon is disabled/uninstalled.
The last step is the most important and never matter with old school extensions which were not restartless.
Some for the built-in modules that you can look at that do this are the widget module, the context menu module, and the hotkeys module, all of which you can find here.
I've made a couple myself which are the toolbar button module, the xulkeys module, the menuitems module, and a few others, all of which you can find here.
Recently I wrote an extension do the same things. A bootstrap extension, not using addon-sdk.
I already submit it on AMO, but wait for review
https://addons.mozilla.org/en-US/firefox/addon/download-dialog-tweak/
And the source code
https://github.com/muzuiget/download_dialog_tweak

Resources