requirejs.vim


Ⅰ. 插件描述

Simple vim plugin that allows 'gt' in javascript files that include dependencies with require.js

Ⅱ. 基本信息

创建日期:  2012-09-19
使用用户:  1
Github星:  2
插件作者:  Simon

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

I'm afraid this is broken. Feel free to try anyways and fix/improve. Or check this out: https://github.com/nyanhan/requirejs.vim He seems to be a little bit more active on it than I am ;)

requirejs.vim

Simple vim plugin that allows 'gt' in javascript files that include dependencies with require.js

This the first vim plugin i created. Recommendations for improvements most welcome.

Install and Use

To install, copy the javascript file into vim's ftplugin folder.

To use it, open a file with require.js define/require instructions, move the
cursor either over the filename-string or the name of a module and press gt and
the module's file will be opened in a new tab.

How it works

The script scans your current workingdirectory recursively for a
requirejs.config statement, gets the baseUrl and paths configs.

When you perform a gt, the module will be found using the baseUrl and paths (if
exist).

Todos

  • make sure that we are in a file with require.js instructions (define,
    require)
  • save map for each buffer
  • update map after creating new dependency
  • use requirejs itself to determine the path of all dependencies

添加新评论