How do I install the ES6 tmLanguage into TextMate 2? - textmate

I want to install the ES6 language syntax highlighting at https://github.com/Benvie/JavaScriptNext.tmLanguage for TextMate 2. I cloned the repo, but it has a .tmLanguage directory with multiple files (.tmTheme, .tmLanguage, etc.).
Apparently, TM2 only supports everything inside a .tmBundle. Is there any clean way to just install the language support?

I just ran into this as well. There's a (closed, unfortunately) pull request that makes possible what you and I wanted. To get it working, I used dhensche's fork and performed the following:
Quit TextMate 2
Run the following:
git clone git#github.com:dhensche/JavaScriptNext.tmLanguage.git
cd JavaScriptNext.tmLanguage
./create-bundle.sh
cp -R JavaScriptNext.tmbundle ~/Library/Application\ Support/Avian/Pristine\ Copy/Bundles/
Re-launch TextMate 2, open an ES6 file, and select "JavaScript Next" from the toolbar along the bottom of the editor.
Hopefully Benvie will integrate proper TextMate 2 support in the build process soon, since it's not far off, as dhensche demonstrated.

Update
The JavaScriptNext.tmLanguage became obsolete since the official TextMate Javascript bundle now supports the new ES features.
Old answer below:
To have the most up-to-date version you should create a new bundle in the Bundle Editor File → New (⌘N), name it for convenience JavaScript Next:
Then, from the repo, open every .tmLanguage/.tmPreferences/.tmTheme file you want to use, and add it to your newly created bundle:
Now you should be able to select the JavaScript Next grammar:
Done!

Related

Mac OSX, Adobe Brackets - Cannot find file (JS, part of Brackets) to edit "_staticHtmlFileExts"

Sorry if this isn't the place for this, I don't know where else I'd ask.
For Mac OSX El Capitan
I am trying to edit the property _staticHtmlFileExts
The variable used to be defined in src/file/FileUtils.js, but has since been moved to src/LiveDevelopment/LiveDevelopmentUtils.js.
When I go to Show Developer Tools within Brackets, I can view the sources, and very easily find /LiveDevelopment/ (and the child JS file)...
But any changes I make to the file are not saves on the system, and thus do not persist on successive opens of the Brackets app.
When I try to find the same file on my system, it is nowhere to be found...
I have hidden folders set to display (which they all do, when present), so I do not believe this to be the issue.
How come I can view the files in the Dev Tools, but not on my system? How, or where, can I make the change permanently?
The build installed with the Brackets.dmg installed minified, concatenated source file (main.js under ~/Application/Brackets.app/Contents/www/) along with a source map, which is why you can see the sources in developer tools, but you cannot see the original source files.
See the article How to hack on Brackets for instructions on setting up a development environment if you want to modify the files themselves.
For reference, the steps are as follows:
Install the latest Brackets build (this gives you the native shell binaries which you'll use in step 6)
Fork the brackets repo
Clone your fork of the repo: git clone https://github.com/<username>/brackets
Fetch submodules: cd brackets && git submodule update --init
Add an "upstream" remote: git remote add upstream https://github.com/adobe/brackets
Run setup_for_hacking script with tools/setup_for_hacking.sh "/Applications/Brackets.app"
Note that the steps 2 and 3 are optional if you are just making modifications for yourself. If so, you can just clone straight from the master (git clone https://github.com/adobe/brackets).

Pandoc: autogenerate and autoreload reveal.js slides on markdown modification

I am using pandoc to generate some slides for reveal.js. Now, when I edit the markdown file, I have to manually regenerate the HTML and then manually reload it in my browser to see the changes.
Is there a way to automate this task?
Update
I ended up creating a Python package for this: Markdownreveal.
You can install it with:
pip install markdownreveal
And start working with your presentations with:
markdownreveal my_presentation.md
You can customize the style, generate ZIPs or PDFs, upload to GitHub pages... For more information, have a look at the full project's documentation.
Old answer
Well, there is no way to configure pandoc to do that. But you can always create a script.
I made a script called pandoc-watch that watches the markdown file and, on modification (when you save your changes), it will automatically regenerate the HTML for reveal.js and it will be reloaded in your browser, using reveal.js's local server.
Note:
Made for GNU/Linux OSs.
Requires: bash, curl, npm, grunt, inotifywait.
Usage: pandoc-watch markdown_slides.md.
It is only meant for reveal.js output!
The first time is run it will download reveal.js and all the required node.js packages, so it may take some time. All the downloaded files are kept in ~/.pandoc-watch, in case you want to clean everything.

Adding VIM plugins to Janus setup

I recently switched over to using Janus from a custom set of vim plugins and .vimrc. I'm really enjoying the setup, but one thing I'm missing is the automatic completion of blocks in Ruby.
For example, when I type:
def method <enter>
It would complete the block:
def method
# cursor here
end
I was using some of Tim Pope's plugins and can't recall which one provided the functionality (Rails maybe?) Is there a way to get this functionality using Janus? Is there a reason why someone wouldn't want this? It seems really convenient to have.
According to janus documentation documentation:
If you want to add additional Vim plugins you can do so by adding a ~/.janus.rake like so:
vim_plugin_task "zencoding", "git://github.com/mattn/zencoding-vim.git"
vim_plugin_task "minibufexpl", "git://github.com/fholgado/minibufexpl.vim.git"
ant then just run rake or run rake for the pluging you setup, on ~/.vim, for example:
rake zenconding
You're talking about endwise.
Presumably you could just add this repo to the Janus rakefile, however I've not tested. This is likely not included in Janus because this can pretty much be emulated with snipMate which is included in Janus.
The janus customization documentation currently reccommends using the ~/.janus directory for vim plugins.
You can use git clone to install vim plugins into the ~/.janus directory. E.g.
cd ~/.janus
git clone https://github.com/vim-scripts/Rename2.git rename2
The old method for customization, using rakefile is in a separate branch that is not maintained.

TextMate - How to install a bundle?

I see a lot of bundles here I'd like to get my hands on
http://svn.textmate.org/trunk/Bundles/
The problem is I don't know how to install them. I've read the section 5 of manual dedicated to bundles, but there's no example how to install those from SVN.
I see the existing ones have the extension .tmbundle, but those on SVN are done differently.
Try installing the bundle "GetBundles". It will help you pick new bundles in a nice GUI. I've been using it myself and it's definitely better than manually installing bundles.
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd !$
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
osascript -e 'tell app "TextMate" to reload bundles'
Then, go to "Bundles" - "GetBundles" - "Get Bundles". (source)
Alternatively, you can just put your .tmbundles into ~/Library/Application Support/TextMate/Bundles, as you may have seen from the code above.
Download a bundle by going to its page, e.g. https://github.com/textmate/matlab.tmbundle and clicking the Download ZIP button.
Unzip it.
Change the name of the folder from
matlab.tmbundle-master
to
matlab.tmbundle
Now you can open it.
Or you can just download them and double click to install, as long as the extension reads tmbundle, that's how I do it.

How to initialize sparkup plugin in Vim for MacOS?

Im new to Vim and am having trouble installing the sparkup plugin found at https://github.com/rstacruz/sparkup. I've copied the contents of the zip into the ftplugin folder and have tried to expand the div tag by pressing command e but appears.
Im stumped, any assistance would be appreciated
Make sure you have filetype detection enabled. That was the issue I ran into a while back on sparkup, with similar symptoms.
Try adding the following to your ~/.vimrc:
filetype indent plugin on
Most of the time, vim plugins come with specific help files, it does not seem to be the case for that one...
You can check the following things :
This a "file type" plugin : so it will only trigger when you are editing a *.html file. So make sure you're not doing your test on a new buffer but on a previously saved .html file.
Regarding your installation and the path of the sparkup files, make sure than sparkup.py and sparkup.vim are in ~/.vim/ftplugin/html (and not something like ~/vim/vim/ftplugin/html) or it won't work
Type :scriptnames it will list all loaded plugin : so somewhere in that list you should see sparkup.vim, if not it means it is not correctly installed or detected by Vim.
Regarding the shortcut to invoke sparkup, it seems to be <CTRL>e.
You can use vim version of Sparkup tailored for easy installation https://github.com/pyp/vim-sparkup.
With Pathogen
cd ~/.vim/bundle
git clone 'https://github.com/pyp/vim-sparkup.git'
With Vundle. Add this to .vimrc:
Bundle 'pyp/vim-sparkup'

Resources