Skip to content

Use `gf` on JavaScript import/require statement

Notifications You must be signed in to change notification settings

oesse/vim-nodegf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-nodegf

Build Status

Use gf on JavaScript import/require statement to go to the imported file.

Installation

Requirements:

  • Vim 8 or NeoVim v0.2.0
Plug 'oesse/vim-nodegf'
cd ~/.vim/bundle
git clone git://github.com/oesse/vim-nodegf.git

Why?

I know of Node.vim which contains similar functionality and more, as well as vim-javascript-gf.vim which does basically the same thing.

Node.vim includes features I personally do not use and I found the resolution mechanism to not always work. Also file paths are resolved with "." and ".." links still present, which I don't like, e.g. require('./foo/bar') when in file project-root/baz would open the correct file as project-root/baz/./foo/bar.

vim-javascript-gf.vim uses the npm module require-relative to resolve paths and I found it after I wrote this plugin.

This plugin is 100% vimscript, is unit tested, has no dependencies, and I tried to keep it very small.

About

Use `gf` on JavaScript import/require statement

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published