I am running on Ubuntu 14.04 and when I right click on a file and do Open With >> Other Application and click on Show All Applications, Sublime Text 2 does not appear. When I installed it originally I ran this command:
sudo sublime /usr/share/applications/defaults.list
and I changed all occurrences of gedit.desktop to sublime.desktop. However, it still opens everything with gedit by default. How can I get Sublime Text 2 to show up when right clicking and choosing Open With? And why is gedit still default? Thanks for reading.
Here what you can achieve:
NOTE: This is for Windows users, not sure if it will work on other operating systems.
Open regedit.exe
FOR FOLDERS
Navigate to this key using the tree on the right: HKEY_CLASSES_ROOT\Directory\shell\
Create a new key in the shell key with any name like: Sublime or Open with Sublime Text or Sublime Text
There will be a key with a Name: (Default) and enter the Data: Open as Sublime Project
Create a new Binary Value with Name: Icon and enter the Data: C:\Program Files\Sublime Text 3\sublime_text.exe (Make sure you change the version of the Sublime Text you are using)
Create a new key in the key name (Sublime or Open with Sublime Text or Sublime Text) with Name: command
There will be a key (in that command key) with a Name: (Default) and enter the (Choose any one of the option below)
Data: C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1" (If you want to open the project in new sublime window)
Data: C:\Program Files\Sublime Text 3\sublime_text.exe "%1" (If you want to open the project in sublime window, which is already running or you are currently using)
FOR FILES
Navigate to this key using the tree on the right: HKEY_CLASSES_ROOT\*\shell\
Create a new key in the shell key with any name like: Sublime or Open with Sublime Text or Sublime Text
There will be a key with a Name: (Default) and enter the Data: Open with Sublime
Create a new Binary Value with Name: Icon and enter the Data: C:\Program Files\Sublime Text 3\sublime_text.exe (Make sure you change the version of the Sublime Text you are using)
Create a new key in the key name (Sublime or Open with Sublime Text or Sublime Text) with Name: command
There will be a key (in that command key) with a Name: (Default) and enter the (Choose any one of the option below)
Data: C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1" (If you want to open the file in new sublime window)
Data: C:\Program Files\Sublime Text 3\sublime_text.exe "%1" (If you want to open the file in sublime window, which is already running or you are currently using)
Related
I did see:
Sublime text: how to add a key binding to hex_viewer package command
Sublime Text set key binding for Tools > Babel > Babel Transform
I have installed JSON Reindent in my Sublime (3.2.2 Build 3211). To reindent a JSON I press Ctrl+Shift+P type in JSON Reindent in command pallet and press enter.
I would like to bind a key combo say Ctrl+Shift+J to JSON Reindent command. I already have my own Default (Linux).sublime-keymap in the right place with a lot of overrides. But I'm unable to find command name.
This functionality is brought in by a plugin so command won't be available here. I tried to:
bind indent and reindent, no luck
bind json_reindent, JSON_Reindent and JSON Reindent, no luck
enable command logging via sublime.log_commands(True) in cosole, then did
Ctrl+A (select all)
Ctrl+Shift+P
type in JSON Reindent in command pallet
press Enter
It printed following in console (nothing for JSON reindent).
>>> sublime.log_commands(True)
command: move_to {"extend": true, "to": "eol"}
command: select_all
command: show_overlay {"overlay": "command_palette"}
What do I put for command to bind a plugin's command in my Default (Linux).sublime-keymap?
{ "keys": ["ctrl+shift+j"], "command": "?????" },
The command you're looking for is found in the plugin's sublime_json_reindent.py file and is, in fact, called as sublime_json_reindent. It can also be found in the Default.sublime-commands file.
I installed Sublime text 2 on my windows system . I'm trying to create a shortcut that would open the command line on the current file directory like i can using notepad++ . Also , on a similar note , how do i use/create shortcuts for "Open containing folder" in a way notepad++ allows me.
I think what you're looking for is the Terminal plugin by wbond, the author of Package Control. You can right-click and select Open Terminal Here... or use the CtrlShiftT keybinding to open a terminal at any file's directory, or use CtrlAltShiftT to open it at the directory containing the current project file.
I've installed subl handler, and I'm trying to test it with the recommended:
open 'subl://open/?url=file:///etc/hosts'
Running this in terminal opens the SublHandler.app itself, but then does nothing - it doesn't open sublime text, let alone the file specified.
In SublHandler prefs, I have the "path to subl" set to /usr/local/bin/subl. If I run /usr/local/bin/subl in my terminal, it opens sublime text.
Any ideas as to why SublHandler isn't working?
Looks like the latest binary from asuth is not working correctly on Maverics. Try my fork here https://github.com/grych/subl-handler - it is working on 10.9.1.
In Sublime Text 2, what steps do I need to take to get Syntax Highlighting for the Laravel Blade Template Engine to work?
As described in http://daylerees.com/2012/04/06/notable-blade-syntax-support-by-medalink/, I took https://github.com/Medalink/Laravel-Blade, unzipped it and copied the folder into Sublime's packages folder.
However, it doesn't seem to work (see screenshot), even if I set it manually using Tools\Command Palette...\Set Syntax: Blade
Is this only meant to work with particular Color Schemes (if so, which ones), or what am I missing? (I just started using Sublime Text today)
The easiest way to install plugins for Sublime Text 2 is through Package Control.
To install Package Control:
Installation is through the Sublime Text 2 console. This is accessed via the ctrl+` shortcut. Once open, paste the following command into the console:
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
This command creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it.
When you have Package Control installed all you need to do to install the Blade syntax highlighter is to:
Open the command palette and type "install package"
Press enter
Wait for a new palette to show up after it has fetched the package list
Type "blade syntax"
Press enter
Enjoy
For Sublime text 3 as well as sublime text 2
install Sublime Package Control (more help on: http://wbond.net/sublime_packages/package_control/installation)
then restart sublime text (2/3)
and press ----> control (or command in mac) + shift + p
there search for package control: install package
wait for another interaction screen
search for Laravel Blade (and other packages if you want)
{
For video tutorials on this and other , subscrive this channel : https://www.youtube.com/channel/UChEv_j3fE4k2r7KcEApFDyQ
}
Also, once you have Package Control installed, you should also install the package 'DetectSyntax'. It will automatically detect the blade syntax so you don't have to manually set it for each file.
In case you installed the Laravel Blade Syntax Highlighter using Package control, that plugin, for some reason keeps throwing out errors.
Package Control: The package specified, laravel-blade, is not available
What I did is just Preference > Browse packages and then rename the folder into laravel-blade. Seems working with no pesky errors now. What I did is just gut feel. I did not even read anything in the files in the folder.
--
Edited: Go to Preference > Browse packages > Package Control.sublime-settings and remove the offending entry.
mine was stored in users folder, just do a folder search for "laravel-blade" and remove the entry from json config
Find: laravel-blade
Where: /Users/:username/Library/Application Support/Sublime Text 2/Packages
How do I remove a completion from Sublime Text 2?
Specifically, in a Ruby file, after the num symbol #, hitting tab autocompletes to # =>.
I don't need this completion, and it's really annoying when trying to write comments. How do I remove it?
It's a snippet installed by default with the Ruby package.
In order to disable it:
Open Sublime Text 2.
Select Preferences -> Browse Packages...
It will open a directory, open the directory Ruby
Rename the file Add-'#-=-'-Marker.sublime-snippet in Add-'#-=-'-Marker.sublime-snippet.old
Assuming that you run SublimeText2 on Mac go to Preferences > Browse Packages. In the folder Packages find the Folder Ruby. In Ruby find the file Add-'#-=-'-Marker.sublime-snippet and manipulate it.
But I strongly recommend to put the changes in a user file. I think this is Preferences > Settings - More > Syntax Specific - User
See: http://www.sublimetext.com/docs/2/settings.html