Skip to content

rstacruz/vim-node-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-node-import

r fs⏎

Turns into:

const fs = require('fs')

Also:

r path         const path = require('path')
r ../setup     const setup = require('../setup')
r path.join    const join = require('path').join
r React        const React = require('react')

v path         var path = require('path')

i path         import path from 'path'
i path.join    import { join } from 'path'

Semicolons are added if any other line in your buffer ends in a semicolon.

Status


Install

When using vim-plug, add this to your ~/.vimrc:

Plug 'rstacruz/vim-node-import'

By the way

This plugin works swimmingly with vim-closer, which, if you write JavaScript, you should also have.


Thanks

vim-node-import © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

About

Expand require() statements in JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published