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
Related
I opened the ~/Applications/Sublime Text.app/contents/MacOS/Packages/Color Scheme - Default.sublime-package with vim and changed some settings in the color theme that I was using. When I then saved the changes and restarted sublime text 3, the changed wasn't in effect (I tried multiple times and double checked everything).
Should you be able to just edit the package without extracting/unzipping anything? I read at different places that you should unzip and then edit, why is that?
Does ST3 read the color theme from somewhere else? Does this apply to all sublime-package files? A short explanation would be nice.
You shouldn't be modifying anything in that folder. The changes you make there will get overwritten by whatever you have in your Packages folder anyways (not the Packages folder you went to). The correct Packages folder you want to go to can be found by doing Preferences -> Browse Packages.
The best way to make modifications to files in a package is to use a plugin called PackageResourceViewer which you can install with Package Control. Once you have it installed, just do the following:
Open up the command palette with ⌘+Shift+P
Type in PackageResourceViewer: Open Resource and press Enter
Use the arrow keys to find the package and file you want to make modifications to and then press Enter
If you'd like to see the entire contents of a package (all the folders and files inside it), just do the following and a folder with the package name will be created in your Packages folder
Open up the command palette with ⌘+Shift+P
Type in PackageResourceViewer: Extract Package and press Enter
Use the arrow keys to find the package you want to extract and then press Enter
Go to your Packages folder by doing Preferences -> Browse Packages and you will see the entire folder for your package.
I am using Octave for some Machine Learning work and I have noticed in my package library in Sublime that there is SublimeREPL: Octave as an option.
However when I select it, I get the following error message:
FileNotFoundError(2, "No such file or directory: octave")
Is there a way to use sublime to code with Octave?
Many thanks
First, you need to find out where your octave executable lives, and note the full path to it. On Linux or OS X, open your favorite terminal emulator and type which octave, and if it's in your $PATH variable it will print the full path to it (for example, /opt/local/bin/octave or something like that). If it's not in your path, or if you're on Windows, you'll have to search around a bit until you find octave or octave.exe, if you're on Windows.
Once you have the path, open Sublime and select Preferences -> Browse Packages..., which will open your Packages folder (surprisingly). Navigate to Packages/SublimeREPL/config/Octave and open the Main.sublime-menu file in Sublime - don't worry, it's just plain JSON. Go down to line 18 (or thereabouts) - it should say "cmd": ["octave", "-i"],. Change "octave" to "/full/path/to/octave", obviously replacing /full/path/to/ with the actual full path you noted earlier.
Save the file, and you should be all set. Tools -> SublimeREPL -> Octave should now open up an interactive session, just like running octave -i on the command line would do. You can use all of the usual SublimeREPL shortcuts to send code to the running REPL, or just use if for testing functions, code snippets, etc.
Have fun!
I am using Sublime Text 3 on OS X
Octave programs are running perfectly. So you can try the below mentioned steps
Open Sublime
Goto Tools --> Build System --> New Build System...
Paste this code
{
"cmd": ["/usr/local/octave/3.8.0/bin/octave-3.8.0", "$file"],
"selector": "source.m"
}
Save it as Octave.sublime-build
Now use Octave as your build system
Use ⌘ + B to run your code.
Enjoy!
I am using Sublime Text 2 for Mac. I have installed the Package Control for Sublime Text 2, following the instructions from https://sublime.wbond.net/installation#st2 without any trouble. However, when I open up Ctrl+Shif+P to search for available packages, it does not show any.
See the image screenshot here
Do you have any solutions for it? I try restart Sublime but it doesn't solve the problem.
Take a look in your user Preferences.sublime-settings and remove the Package Control from the "ignored_packages" list if it is there.
If you use a Linux based system, you may have to check permissions of /home/user/.config/sublime-text-3. Check if the directory is owned by your user. If not, change the owner user for that directory.
Click the Preferences > Browse Packages and check whether Package control file is there or not.
You can manually put package control file there by downloading it from here and get rid of issues.
I had the same problem. I had to restart my computer to properly reset Sublime Text 2. It seems from your comment that you also got the Package Control list to show up after restarting your computer.
Your screenshot image is currently broken, but make sure you have the zipfile "Package Control.sublime-package" in the Installed Packages directory.
Open the console and run this command:
curl http://sublime.wbond.net/Package%20Control.sublime-package -o ~/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages/Package\ Control.sublime-package
Then restart sublime.
See this issue: https://github.com/wbond/sublime_package_control/issues/652
How do I add the HexViewer to Sublime Text2? I am here (https://github.com/facelessuser/HexViewer) and the instructions say "Download is available in Package Control or you can download or clone directly and drop into your Sublime Text 2 packages directory (plugin folder must be named HexViewer)" Where/what is Package Control?
And if/when I have installed it successfully, what is the toggle key?
Thanks.
Package Control can be found here.
Take a look at Default (<Your OS>).sublime-keymap on the github page for the keymaps.
Follow this instruction
1st step: Ensure Package Control is installed.
2nd step: In Sublime Text, press ctrl + shift + p (Win, Linux) or cmd + shift + p (OSX) to bring up the quick panel and start typing Package Control: Install Package.
3rd step: Select the command and it will show a list of installable plugins.
Start typing HexViewer; when you see it, select it.
4th step: Restart to be sure everything is loaded proper.
5th step: Enjoy!
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