Syntax highlighting for Jade in Sublime Text 2? - editor

I just started using Sublime Text 2 on Mac. I also just started using Jade for my views in Node.js, and am wondering if there is a way to add syntax highlighting for Jade into Sublime Text 2.

If you have git installed, this worked perfectly for me:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone https://github.com/davidrios/jade-tmbundle Jade
Bonus to get stylus syntax highlighting working run:
git clone https://github.com/stylus/stylus.git Stylus

Sublime Text 2 supports Textmate syntax definition files. There is a Jade Textmate bundle at https://github.com/miksago/jade-tmbundle.
Install by creating a new folder in your Sublime Text "Packages" folder, call the new folder Jade, then curl -O https://raw.github.com/miksago/jade-tmbundle/master/Syntaxes/Jade.tmLanguage or otherwise download that file into the new folder. The editor will load the syntax immediately.

Why yes, there is! And it uses a nice packaging system too:
If you need to, install Package Control from here
Open the command palette (command + shift + P) and go to Package Control (just type "install"). You may need to wait for the repository to be updated.
When in package control type "jade" to find the Jade Syntax Highlighting package. Hit enter to install it.
You now have syntax highlighting for Jade and a nifty package controller for other Sublime goodies. This search shows a lot of available tools for working with Jade, Jade+Bootstrap, pyjade, etc
Edit - Sublime doesn't need to be restarted after installing this package so this step was removed.

#jurka -
OS X:
~/Library/Application Support/Sublime Text 2/Packages/
Linux:
~/.Sublime Text 2/Packages/
Windows:
%APPDATA%/Sublime Text 2/Packages/
Clone into the path shown above for linux.

Jade is also available via the Sublime Package Control.

For ubuntu 11.10 correct path to packages for me is ~/.config/sublime-text-2/Packages
You can easily find your packages location using Menu: "Preferences" -> "Browse Packages..."

The accepted answer refers to a plugin that is deprecated and no longer active.
For those who are still looking for a supported Jade plugin for Sublime Text, you should use this repo:
https://github.com/davidrios/jade-tmbundle
This is also on Package Control:
https://packagecontrol.io/packages/Jade

If you are on Mac:
Go to Library/Applciation Support/Sublime Text 2/Packages/ then,
curl -O https://raw.github.com/miksago/jade-tmbundle/master/Syntaxes/Jade.tmLanguage

I've made the following on linux ST2 build 2221:
git clone https://github.com/miksago/jade-tmbundle.git Jade.tmbundle
Then
zip -r Jade.zip Jade.tmbundle/
mv Jade.zip Jade.sublime-package
mv Jade.sublime-package /sublime_folder_location/Pristine Packages/

Related

How do I run cmder inside atom on windows 10?

I have install cmder and atom editor (v. 1.19.3). Also install the platformio-ide-package for atom. And I do еverything that has been described in this article - http://thebar.cc/atom-editor-cmder/, but in my atom editor ->settings missing the part with Shell Override: ... , where I can change the path. Is this is a bug on my editor? And can anyone tell me how to fix that and set the Atom editor with the Cmder console.
Got it working with simply putting C:\Windows\System32\cmd.exe into Shell Override and C:\path\to\cmder\vendor\init.bat into Auto Run Command, no quotes, no nothing.
It's not much of answer(I can't comment yet), but it might help.
Shell override is in: Atom Settings(or ctrl + ,) > Packages > platformio-ide-terminal > Settings. Scroll down and you will see.
I didn't make it work yet(actually by googling found this question). If I do I'll edit this comment(Hope I can do it). I'm on Windows 7.
EDIT:
It works(win7). What I did is I removed double quotes (") around the path inside the file atom.bat. Of cause edit path to where is your cmder folder is.
Use platformio-ide-terminal and in the settings of the package:
Shell Override C:\Windows\System32\cmd.exe
Shell Arguments /K C:\path\to\cmder\vendor\init.bat
Since my machine is slow to start the batch script, here's an elegant way to add a loading message so it doesn't seem like the terminal is unresponsive, just add this to AutoRun:
#cls & echo Loading... & C:\your\path\cmder\vendor\init.bat

How do you execute a lua file in sublime text 3?

How do you execute a lua file in sublime text 3? I tried opening the console and typing build <filename>.lua. I also looked through the menu's for a build and run. Supposedly saving a file or hitting F7 is supposed to execute lua scripts, but that did not work either. I expected 'helo world' to print in the console upon save and all it said was the file was written.
contents of helo.lua:
print('helo world');
You can manually create a build configuration for Lua. However, I suggest that it is simpler to install a Lua package that includes one.
Install Package Control
Open the Command Palette (Ctrl-Shift-P on Windows or COMMAND + SHIFT + P on Mac)
Type something like "packins" to get the "Package Control: Install Package" item.
After a momentary pause a list of available packages will appear. Type "Lua" to filter to Lua packages.
My personal favorite is "Lua Dev". Select this package and Package Control will download and install the package for you.
From now on, if your have your syntax set to Lua for a file (Ctrl-Shift-P, "Set Syntax: Lua", or click in the bottom right corner of the window and choose Lua) then pressing F7 (aka Tools->Build) will evaluate the file using the Lua interpreter.
You may also need to install "Fix Mac Path". At the time of this writing this package was not found by Package Control. Alternatively, install "Fix Mac Path" by running the following command in terminal:
git clone https://github.com/int3h/SublimeFixMacPath.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/FixMacPath
Go to Tools > Build System > New Build System.
Paste this code
{
"cmd": ["lua", "$file"],
"file_regex": "^lua: (...*?):([0-9]*):?([0-9]*)",
"selector": "source.lua"
}
Save it as lua.sublime-build
To run a lua program press ctrl+B.
PS: Ensure that lua executable is in you $PATH

What would be the alternate command for mate gemfile for some other editor in windows?

I started with rails tutorial but there was the use of mate editor in that which is for apple OS but i m using windows and have installed a recommended editor komodo edit.
What can be the alternative to this for komodo edit?
$ mate Gemfile
Not sure if I follow but mate Gemfile is no different to just opening any editor and doing File -> Open and selecting the file Gemfile. It's just an alias for opening the application TextMate and opening the file Gemfile
Instead of using Mate command on Windows, you must first add Notepad (or any other editor you'd like) as the main program
git config --global core.editor "'C:\ProgramData\...notepad location' -multiInst -notabbar -nosession -noPlugin
And then you will be able to create the file by writting
start notepad README.md

How to launch and edit a file from Git using Notepad++?

I have set up Notepad++ as my default editor as in this topic:
How can I set up an editor to work with Git on Windows?
with this command:
git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
Now, I'm working through a Ruby on Rails tutorial. On one step, the author uses the command:
$mate README.markdown to launch his TextMate editor and edit the readme file.
My question is, now that I have set up Notepad++ as my default editor, what is the equivalent command that I should use to launch Notepad++ and edit the file?
Note: I'm a beginner with this Git and Ruby on Rails. Please go easy on me! Thanks in advance.
C:/Program Files/Notepad++/notepad++.exe README.markdown
And since you'll probably want to use notepad++ a lot from the command line, you may want to alter your PATH to include its root directory, so you don't need to write the full path each time.
Add notepad++.exe to your Windows path enviromental variable( the whole path), this option is in computer, right click, advance system setting enviromental variables.
After from command promp just do:
notepad++ markdown.README
You could also just use the whole path to notepad.exe everytime but that gets old, just learn how to edit your enviromental variables in windows.
You must first add Notepad++ as the main program. On Git Bash
git config --global core.editor "'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk' -multiInst -notabbar -nosession -noPlugin
And then you will be able to create the file by writting
start notepad README.md
start notepad++ README.md

Add/Find Style files in/to latex

Question 1
I am getting the following error in Latex:
! LaTeX Error: File `fancybox.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
However, the file fancybox.sty is actually located in the folder from where I am running the pdflatex command. Why is not able to find it?
I just installed Latex on Ubuntu using the command
apt-get install texlive-latex-base
and the pdflatex command works.
Question 2
I want to install this texments from CTAN. Can I do this through apt-get? Is there another Easy way?
Thanks,
Ajay G.
The fancybox LaTeX package is included in the texlive-latex-extra package for Ubuntu. If you install the texlive-latex-extra package using Synaptic or apt-get, your document should compile:
$ sudo apt-get install texlive-latex-extra
A couple other things that may help you in the future:
The TeXLive installation in Ubuntu is currently the 2007 edition. The 2009 edition of TeXLive was just released recently (see the TeXLive website for downloads). The 2007 edition will work most of the time, but the 2009 edition contains the latest version of the packages with their bug fixes. Just a heads-up.
I'd recommend installing the full set of TeXLive package under Ubuntu so that you don't have to dig through the repository and install new files each time you want to add a new \usepackage line to your .tex file. If you install the texlive-full package, that'll cover all the bases:
$ sudo apt-get install texlive-full
Note, however, that the full TeXLive package set is a large download and will take some time to install.
Try
apt-file -x search '/fancybox.sty$'
and you may get the answer like:
texlive-latex-recommended: /usr/share/texmf-texlive/tex/latex/fancybox/fancybox.sty
so "texlive-latex-recommended" is the right package to install.
Have you tried manually as it says in the official Ubuntu documentation?
https://help.ubuntu.com/community/LaTeX
If a package you desire is not in Ubuntu's repositories, you may look on CTAN's web site or TeX Catalogue Online to see if they have the package. If they do, download the archive containing the files. In this example, we'll install example package foo, contained in foo.tar.gz.
Once foo.tar.gz has finished downloading, we unzip it somewhere in our home directory:
tar xvf foo.tar.gz
This expands to folder foo/. We cd into foo/ and see foo.ins. We now run LaTeX on the file:
latex foo.ins
This will generate foo.sty. We now have to copy this file into the correct location. For the purposes of this example, we will copy this into our personal texmf tree. The advantages of this solution are that if we migrate our files to a new computer, we will remember to take our texmf tree with us, resulting in keeping the same packages we had. The disadvantages are that if multiple users want to use the same packages, the tree will have to be copied to each user's home folder.
We'll first create the necessary directory structure:
cd ~
mkdir -p texmf/tex/latex/foo
Notice that the final directory created is labeled foo. It is a good idea to name directories after the packages they contain. The -p attribute to mkdir tells it to create all the necessary directories, since they don't exist. Now, using either the terminal, or the file manager, copy foo.sty into the directory labeled foo.
Now, we must make LaTeX recognize the new package:
texhash ~/texmf
The new package should now be installed. To use it in your LaTeX document, merely insert \usepackage{foo} in the preamble.
It should work with the style file in the directory from where you were running the pdflatex command, but a solution to this problem is simple:
sudo cp *.sty /usr/share/texmf-texlive/tex/latex/base/
sudo mktexlsr

Resources