vim-nodejs-errorformat


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2011-12-21
使用用户:  13
Github星:  33
插件作者:  Felix Geisendörfer

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# nodejs-errorformat

A simple vim plugin that allows to execute any opened node.js file with :make
and provides errorformat settings that allow you to quickly jump to any file /
line numbers referenced in a stack trace.

Install

Get [pathogen][], then:

cd ~/.vim/bundle
git clone git://github.com/felixge/vim-nodejs-errorformat.git

Usage

If you already know how :make and the quickfix window work in vim, just type
:make inside of a JS file to have it executed with node, then type :copen
to show the quickfix window.

However, if you are new to this, you probably want a keybinding like this in
your .vimrc

nmap <Leader><Leader> :w<CR>:make! \| botright cwindow<CR>

This will map <leader><leader> (,, for me) to excuting :make and
automatically opening the quickfix window if there was an error.

Screenshots

A simple JS file before executing the keybinding above:

Screenshot 1

The output of :make / running the file with node.js:

Screenshot 2

The quickfix window generated by this plugin:

Screenshot 3

添加新评论