node.js - File path completion relative to the current file directory -


is possible have file path completion relative current file directory ? able search file (like command-t or ctrlp) , insert relative path.

this nodejs/component development, require other modules of project.

(i found example sublime text https://github.com/jfromaniello/sublime-node-require)

thanks

edit:

i add example illustrate question:

. |-- models |   `-- user.js `-- views     `-- home         `-- index.js 

i'm working on file views/home/index.js , want require models/user.js views/home/index.js

var usermodel = require('../../models/user'); 

is there way in vim path of models/user.js relative views/home/index.js (here in example ='../../models/user').

filename-completion done working directory.

if want things relative current file, can add

set autochdir 

to ~/.vimrc.

you can change working directory current window with

:lcd %:p:h 

see :help 'autochdir', :help :lcd , :help filename-modifiers.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -