vim-js2coffee


Ⅰ. 插件描述

JavaScript to CoffeeScript from the comfort of your Vim buffer

Ⅱ. 基本信息

创建日期:  2013-09-30
使用用户:  7
Github星:  6
插件作者:  Jarrod

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'jarrodctaylor/vim-js2coffee'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'jarrodctaylor/vim-js2coffee'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'jarrodctaylor/vim-js2coffee'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/jarrodctaylor/vim-js2coffee

Ⅳ. 文档说明

# vim-js2coffee
JavaScript to CoffeeScript and CoffeeScript to JavaScript from the comfort of your vim buffer.

Demo

vim-js2coffee-demo

INSTALLATION

Use your plugin manager of choice.

  • Pathogen

    • git clone https://github.com/JarrodCTaylor/vim-js2coffee ~/.vim/bundle/vim-js2coffee
  • Vundle

    • Add Bundle 'https://github.com/JarrodCTaylor/vim-js2coffee' to .vimrc
    • Run :BundleInstall
  • NeoBundle

    • Add NeoBundle 'https://github.com/JarrodCTaylor/vim-js2coffee' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'https://github.com/JarrodCTaylor/vim-js2coffee' to .vimrc
    • Run :PlugInstall

REQUIREMENTS

You need a VIM version that was compiled with python support, which is typical
for most distributions on Linux/Mac. You can check this by running
vim --version | grep +python
if you get a hit you are in business.

You will need to npm install js2coffee and coffee-script to preform the actual compilation. Make
sure that you have access to both js2coffee and coffee from your shell in order for this plugin
to be able to function.

Usage

The plugin provides four commands:

JSBuffer2Coffee
JSSelection2Coffee
CoffeeBuffer2JS
CoffeeSelection2JS

For ease of usage you can map the above actions to a shortcut. For example,
if you wanted leader mappings you could set something like the following in
your vimrc:

nnoremap<Leader>bc :CoffeeBuffer2JS<CR>
nnoremap<Leader>sc :CoffeeSelection2JS<CR>
nnoremap<Leader>bj :JSBuffer2Coffee<CR>
nnoremap<Leader>bs :JSSelection2Coffee<CR>

添加新评论