w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Call C# assembly from Python (in sublime text plugin)
If you're trying to add language support to sublime text by using the C# code to process the editor contents and send back meta-data (syntax highlighting info, autocomplete options, etc.) then a standard approach would be to wrap the C# code in a separate server process and talk to it over sockets in python. If on the other hand you're looking to directly modify sublime text's behaviour than this approach won't do much for you. Some examples of the server approach for extending language support in other editors would be, the VimClojure plugin which talks to a separate java process to add clojure support to vim, or ENSIME which connects to a server written in scala to add scala support to emacs.

Categories : C#

Search and replace in current file with Sublime Text plugin
I don't think the Sublime Text plugin API can save the buffer, but you could use the file_name() method in the sublime.View class and work with the file directly. As noted by @MattDMo, the file can be saved using view.run_command('save'). It may be easier to use the file name if your old build file worked with that.

Categories : Python

Alignment plugin in Sublime Text does not work with style.less (less file)
I haven't tested this yet, but I have a pretty strong hunch that it might help your case. Open sublime text, and go to Preferences>Browse Packages Look for the Alignment plugin folder and enter in it. Look at the files in there, you will see: Base File.sublime-settings CSS.sublime-settings Javascript.sublime-settings JSON.sublime-settings Try your hand at creating a LESS.sublime-settings file in there, copying the contents of another of the settings files, for example, the JSON.sublime-settings contains this: { "alignment_chars": ["=", ":"] } It seems to me, that to enable alignment to work as expected with other filetypes not designed as default with the plugin, one would have to add this settings file to the plugin in order for it to work out. I am not sure if the file

Categories : CSS

Upload to Amazon EC2 as root using Sublime Text SFTP Plugin
Without knowing which plugin you talking about my guess is you are thinking FTP and sFTP are same protocols. They are not the same protocols http://www.wise-ftp.com/know-how/ftp_and_sftp.htm , you need something that can handle sftp like http://wbond.net/sublime_packages/sftp or checkout free tools like cyberduck http://cyberduck.ch/ or winscp http://winscp.net/eng/index.php

Categories : Amazon

Is there a way to import Python3's multiprocessing module inside a Sublime Text 3 plugin?
Assuming you intend this program for wide distribution, it's probably unreasonable to expect users to install Python 3 in a standard location in order to use your work. However, depending on Python's redistribution license, you may be able to get away with just bundling multiprocessing with your plugin. If your main my_awesome_plugin.py file is in the root of your plugin directory, put the full multiprocessing directory in as a subdirectory and you should be able to import multiprocessing as mp just fine. Fortunately it's pure Python, so you don't have to worry about platform-specific distributions. EDIT OK, my bad. After a little more exploring around the ...lib/python3.3/ hierarchy, it turns out there is a compiled _multiprocessing.so library in there to supplement the pure Python ve

Categories : Python

Start Sublime 3 from terminal, when default is Sublime Text 2
When you run sublime, your computer should run a bash file at /usr/bin/sublime (running which sublime as Mike Li suggested will confirm the location. Open that up and edit it for Sublime Text 3. The contents of that file should be: #!/bin/bash /usr/lib/sublime-text-2/sublime_text --class=sublime-text-2 "$@" Edit it as so: (On my computer the executable is called subime_text_3 instead of subime_text. Verifiy by opening /usr/lib/sublime-text-3.) #!/bin/bash /usr/lib/sublime-text-3/sublime_text_3 --class=sublime-text-3 "$@" Point it to the location of Sublime Text 3 on your system. Edit Build 2221 (using the ppa) changed the installation directory from /usr/lib/sublime-text-2 to /opt/sublime_text_2

Categories : Linux

how to install sublime text indent xml in sublime 3
The location is system dependent, but are located at: OS X: ~/Library/Application Support/Sublime Text 3/Packages/ Windows: %APPDATA%/Sublime Text 3/Packages/ Linux: ~/.config/sublime-text-3/Packages/

Categories : Xml

Sublime Text 2 Python.sublime-package
Remove existing /User/Python.sublime-package and try manually unzip Python.sublime-package (change it's extension to .zip) to Package folder /Packages/Python. Package folder can be revealed via Preferences->Browse Packages... command.

Categories : Python

Pylint sublime plugin development
It is possible, but utmost difficult. You can try to see if these modules are available as .py files in Sublime Text 2 source code and drop then to PYTHONPATH Pylint reads. If the modules in the question are native modules, Pylint can see only if they are distributed as shared libraries and you point PYTHONPATH/LD_LIBRARY_PATH to this modules. If the modules are embedded inside Sublime Text 2 binary you have little hope to make Pylint understand them (unless you provide hinting by hand). In this case the behavior is operating system specific.

Categories : Python

Sublime Text 2 C Compiling
What Operating System do you use? Linux? Using Linux is more practical, because you compile in the terminal. Installing the Compiler 1 - Make sure that you have the compiler installed. If you dont have, open the terminal (Ctrl + Alt + t) and type this and press Enter: sudo apt-get install g++ gcc build-essential Compiling a file Open the terminal and go to the local that you had saved the files. Type in the terminal: gcc filename.c -o filename Then, type: ./filename The program you run in the terminal normally. PS: gcc is for programs in .c g++ for programs in .cpp -o = to create an "executable" file ./ = to run the program

Categories : C

Using Sublime Text 3 as a Python IDE with 3.3.2?
Set your "cmd" to the following: "cmd": ["/Library/Framework/Python.framework/Versions/3.3/bin/python3", "-u", "$file"], and it should work. Probably the reason your path addition didn't work was because it was missing the beginning /.

Categories : Python

Sublime text 2 snippets
Sorry snippets are primarily meant for reusability; you can do precisely as you say above but cannot insert specific things - you would have to write your own plugin in order to add this functionality as it would require things like a specific way of selecting things to modify and replace which would be specific to it.

Categories : Python

Jslint and sublime text
I found solution in this link: http://nicksantan.com/blog/2012/12/adding-auto-format-code-indenting-to-sublime-text-2/ Hopt it work.

Categories : Javascript

Vintage Sublime Text go to tab N
Not that it matters, but those are ST1 docs. The command is probably focus_view (though I haven't checked it). If you are using ST3, I'd recommend trying Vintageous. It appears to be much more complete than the built in vintage mode. For example, 3gt does move you to the third tab with this plugin.

Categories : Vim

Using Sublime Text 2 for C++ and OpenGL
I c++, if you want to use a (static in this example) library, you have to link against it. In normal english, you have to tell your compiler where it can find the implementations of the library's functions. I don't know how to do that in your editor, but usually there is something called linker settings, where you can link all the libraries you need for your project. For more info see this wiki page

Categories : C++

RubyTest has no output in Sublime Text 2
Personally, I'd recommend installing ZenTest and using its autotest functionality to continually run your tests in a terminal window. It watches for changes in the tests and reruns them automatically. It's very handy as you write your code and tests.

Categories : Ruby On Rails

uninstall sublime text 3 on ubuntu 12.04
Option 1 If you installed sublime-text-3 with apt-get, based on this article: http://www.webupd8.org/2013/07/sublime-text-3-ubuntu-ppa-now-available.html With these lines: sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt-get install sublime-text-installer You could remove your installation: sudo apt-get remove sublime-text-installer Option 2 If you installed Sublime Text 3 from a .deb package which was downloaded directly from Sublime Text page: http://www.sublimetext.com/3 And you have used this command for installation sudo dpkg -i sublime-text_build-3047_amd64.deb Or you just double clicked on it and Ubuntu Software Center installed it... So, in this case: sudo dpkg -r sublime-text But you have to reinstall Sublime Text 2 in each case

Categories : Ubuntu

Why is it not OK to call Matplotlib from Sublime Text 2?
You need to install matplotlib before you can import anything from pylab. Try installing the package from the downloads page. (exactly as @nordev says)

Categories : Python

sublime text remove repository
Click on Sublime Text 2 on the menu bar, then Preferences -> Browse Packages to open up a Finder window pointing to ~/Library/Application Support/Sublime Text 2/Packages. Open the User folder and open Package Control.sublime-settings in Sublime Text. You should see a list of installed packages, and a key (possible down at the bottom) called "repositories". The file should look something like this: { "auto_upgrade_last_run": null, "installed_packages": [ "PackageName", "AnotherPackageName", "AwesomeSublimePlugin", "Neon Color Scheme" ], "repositories": [ "https://github.com/SoMeUsEr/BadURL" ] } and to delete the repository you should make it look like this: { "auto_upgrade_last_run": null, "installed_packages

Categories : Python

sublime text 2 portable update not sure how?
Assume that your old version is installed in Sublime.old, and the new version in Sublime.new. Make sure Sublime Text 2 is closed, then move the Sublime.newData folder to someplace else (like your Desktop, for now), just in case anything breaks. Then, copy (don't move) the Sublime.oldData folder to Sublime.new. Fire up the program and check to see that everything is there, and works properly. Please note that this method will not work when upgrading from ST2 to ST3, as there are major differences in the way plugins are run.

Categories : Windows

Make Envs Available To Sublime Text
Just a guess, but if you are using the build system, perhaps adding the "shell": true option? If it's a plugin you are working through, perhaps create an issue for the plugin (I'm guessing it's on github)

Categories : Ruby On Rails

Unable to run tests from sublime text 3
From looking at this issue, it's probably related to your bundler generated binstubs. Looking at the RVM docs, you might want to try running: gem regenerate_binstubs or: bundle install --binstubs If you still have issues after that, I'd try totally removing the binstubs. Instructions for doing that can be found here.

Categories : Ruby

Sublime Text 3 - Clean Paste
Not too much work to make this python 3 compatible: # coding=utf8 import sublime_plugin, sublime, re, html def clipboard(): return sublime.get_clipboard() def copy(data): sublime.set_clipboard(data) # to transfer data to sublime text def clean_paste(data): # clean word data = str(data) data = data.replace(u'”', '"').replace(u'“', '"').replace(u'’', "'") data = data.replace('________________________________________', ' ') # clean htmlentities data = re.sub('&([^;]+);', lambda m: unichr(html.entities.name2codepoint[m.group(1)]), data) return data; # to transfer data from sublime text def clean_copy(data): # clean html data = str(data) data = re.sub(r'<br ?/?>', ' ', data, re.I); data = re.sub(r'<[^>]*>', '', da

Categories : Python

How to update Sublime Text 2 on Ubuntu 12.04?
There is a PPA for Sublime Text 2: https://launchpad.net/~webupd8team/+archive/sublime-text-2 But remember, that you will be integrating a new third-party-repository into your system.

Categories : Ubuntu

Sublime Text 3 C++ Build System for OS X
According to this thread, ST simply doesn't allow for interactive builds. Edit: Check out this thread here for a workaround.

Categories : C++

The REPL of sublime text 2 can't using the command of git?
SublimeREPL is for programming language interpreters like Clojure or Python, not shell programs like git. What you need is sublime-text-2-git, available from the Package Control menu as "Git". SideBarGit may also be useful.

Categories : GIT

Can i add css property shortcuts to sublime text?
These are called snippets. For this particular example, Open the Tools menu and select New Snippet..., then paste in the following: <snippet> <content><![CDATA[margin: 0 auto;]]></content> <tabTrigger>m-a</tabTrigger> <scope>source.css</scope> </snippet> Save this file as Packages/User/CSS/margin auto.sublime-snippet and you should be good to go. Open a CSS file, type m-a, hit Tab, and you're all set. Snippets are pretty powerful, and also allow for tab stops to enter customized data. For example, you could set up some boilerplate code that only requires that the colors be customized like so: <snippet> <content><![CDATA[body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; bo

Categories : HTML

Sublime Text 2. Autocomplete python `from`
Have you checked out SublimeCodeIntel? It's available through Package Control, and has this functionality. The initial indexing of your packages may take some time, but once it's all set (you may need to restart Sublime once or twice to get everything loaded) it works like a charm.

Categories : Python

In Sublime text 2 php autocomplete is not working
In your sublime User/Preferences.sublime-settings file add: { "auto_complete_selector": "source, text", } This will enable auto-complete even when there is no closing PHP tag.

Categories : PHP

Sublime Text indentation issue
For ST2 : Open the html package and edit the Packages/HTML/Miscellaneous.tmPreferences file. Replace the text with the one below. The below regex accepts basic jsp tags in <c:if> format & JSP comments. This will not format scriplets. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>name</key> <string>Miscellaneous</string> <key>scope</key> <string>text.html</string> <key>settings</key> <dict> <key>decreaseIndentPattern</key> <string>(?x) ^s* (&lt;/(?!html) ([A-Za-z0-9]

Categories : Jsp

Sublime Text 2 python SublimeREPL
CtrlShiftP is the keyboard shortcut for the Command Palette, which is what you want. You can also open it via Tools -> Command Palette.... CtrlP is Goto Anything, and has nothing to do with Package Control or installing things. Don't use it. Open the Command Palette by whichever way suits you best, menu or keyboard shortcut. Once there, type PCI and Package Control: Install will be highlighted. Hit Enter, and a dropdown of the full list of available packages should appear. Now, type "sublimerepl" and it should show up. Click on it or hit Enter and you should see a message at the bottom of the window that SublimeREPL is installing. Once it's done, restart ST2 (for good luck) and it should be available in the Tools menu down at the bottom. Please read the full documentation to familiari

Categories : Python

Python settings in Sublime Text 2
First make sure that you saved the file with .py extension and then try to run again. You also need to check that the Python in your .sublime-build is correct. For this look at %APPDATA%Sublime Text 2PythonPython.sublime-build file. This file should have something like this: { "cmd": ["C:\python27\python.exe", "-u", "$file"], "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", "selector": "source.python" } This is equivalent to doing the following on the command line, check that you can do: python -u C:your_pathyour_script.py If this doesn't work from the command line it also wont from sublime.

Categories : Python

How to run Ruby file on Sublime Text
It is possible to run your programs when you need to have user input from the keyboard, but it isn't very nice. When I do so, I need to input from a terminal that opens when I run Sublime, while also reading the response from the program at the bottom of the editor. It is simply easier to run the program from the console/terminal. So, the answer is, while it is possible to do so, there are concerns. You may need to use STDOUT.sync = true or STDOUT.flush to help manage the buffer with the OS, you have two thing to look at, while doing so... yuck. It may not be the answer you are looking for, but as a developer, you should be comfortable running things from the console/terminal.

Categories : Ruby

Sublime Text 3 Java autocomplete
Sublime 3 does have basic autocompletion for Java baked-in - if you start typing "pub", for example, it'll suggest "public". I'd also suggest looking at the Javatar plugin, which adds things like automatic creation of classes, packages, and interfaces. The QuickJava plugin might also be worth a look - it adds automatic creation commands for setters, getters, and constructors.

Categories : Java

Change behavior of Alt key in Sublime Text 2
There is a Sublime Text 2 plugin called Sublemacs Pro that provides emacs-like keybindings and operations, including those that you mentioned pining for. You can find installation instructions and the complete keybinding reference on the Github page.

Categories : Osx

Make Sublime Text treat