项目作者: davidosomething

项目描述 :
[unmaintained] Vim plugin to resolve node/JS/commonJS/Webpack modules
高级语言: Vim script
项目地址: git://github.com/davidosomething/vim-enhanced-resolver.git
创建时间: 2017-10-27T19:51:20Z
项目社区:https://github.com/davidosomething/vim-enhanced-resolver

开源协议:

下载


vim-enhanced-resolver

https://github.com/davidosomething/vim-enhanced-resolver

Resolve import and require in JavaScript projects of all kinds.
This project depends on
enhanced-resolve-cli

Installation

Using vim-plug:

  1. Plug 'davidosomething/vim-enhanced-resolver', { 'do': 'npm install --global enhanced-resolve-cli' }
  2. autocmd FileType javascript nmap <buffer> gf <Plug>(enhanced-resolver-go-cursor)

This maps your gf to try to resolve and edit module name under the current
vim cWORD (the hyphen-word_theCursorIs./over).

Usage

This plugin provides <Plug> mappings for normal mode.

  • <Plug>(enhanced-resolver-go-cursor) is what you probably want to map. Use
    nmap if you have other resolvers or mappings you want to fall back to.
  • <Plug>(enhanced-resolver-echo-cursor) will search for a quoted thing on the
    current line and echo the result. Useful for debugging.
  • <Plug>(enhanced-resolver-echo-resolve) will resolve the quoted thing on
    the current line and echo the result. Useful for debugging.

How it works

enhanced-resolve-cli resolves the module relative to the file’s directory.
It tries to find your webpack config (optional, doesn’t need one) and resolves
the path using Webpack’s
enhanced-resolve.

License

MIT