clickable.vim icon indicating copy to clipboard operation
clickable.vim copied to clipboard

Add a root path per project

Open fholgado opened this issue 11 years ago • 3 comments

Hi! This plugin looks really useful, but doesn't help me navigate through files for a couple of reasons:

  1. All the paths in our app are relative
  2. We use require.js for loading modules, which this plugin doesn't "see" as clickable

A nice solution for the first issue, which could be necessary for the second, is to add some sort of global root variable. For example:

/js/app.js should resolve to ~/code/myproject/web/js/app.js

Being able to navigate through a require.js declaration would also be kick ass.

define([
    'dojo/on',
    'dojo/dom',
    'dojo/topic',
    'codemirror4/lib/codemirror',
    'codemirror4/mode/htmlmixed/htmlmixed'
], function(on, dom, topic, CodeMirror) {
...

Each dependency on the require statement also has it's own root, in this case /web/js/.

I'm looking around at the code and it seems like this should be feasible. What do you think? I might spend some time tonight to see if I can get this to work!

Thanks for your work so far :)

fholgado avatar Aug 25 '14 16:08 fholgado

Yes , next version will be hookable. And I'm thinking how to make it workable with angular projects.

But , I have not got much time to do this for a while.

You can have a try~

Many Thanks~

gu-fan avatar Aug 25 '14 17:08 gu-fan

As you opened this thread, I'll put my thoughts here.

I'm thinking of what is needed for hooking usage.

    name
    piority
    match
    highlight(patten:[the pattern should contain cursor] and  hlGroup)
    action(success/failure)
    buffer(filetype/ project detection like package.json; 
              And is this needed???shall we put it in another plugin?
              like a require.vim for nodejs?)
    mapping

gu-fan avatar Aug 26 '14 04:08 gu-fan

mostly done. you can define your own pattern validator and trigger with the filetype.

see readme.

gu-fan avatar Oct 26 '14 13:10 gu-fan