volgar1x / vim-gocode

A Go bundle for Vundle or Pathogen
238 stars 34 forks source link

Some useful commands #1

Closed volgar1x closed 10 years ago

volgar1x commented 11 years ago

Here is somme commands i'd like to implement :

volgar1x commented 11 years ago

CurPkg, RelPkg and Install commands implemented in b814333a1056

volgar1x commented 11 years ago

GoTest command implemented in 026060b60f

volgar1x commented 11 years ago

I'm trying to give completion to GoInstall and GoTest commands. It partially works, here is what I started :

function! GocodeCompletePkg(arg, cmd, index)
    let s:base=DirName(@%)
    let s:dirs=filter(split(globpath(s:base, a:arg.'*'), '\n'), 'isdirectory(v:val)')
    let s:ndirs=len(s:dirs)

    if s:ndirs <= 0
        return ''
    elseif s:ndirs == 1
        let s:matched=s:dirs[0]
    else
        let s:matched=s:dirs[0] " TODO select the next match
    endif

    return substitute(s:matched, s:base.'/', '', '').'/' " add a trailing / to quickly match a child
endfunction

I would like to select the next match, any help will be nicely accepted :)

graycreate commented 11 years ago

where is the go run?

volgar1x commented 11 years ago

It is not implemented yet.

graycreate commented 11 years ago

first,your work is great,thx for your contribution. here,i have a question :if this plugin will auto-install gocode in GOPATH/src/github.com/nsf/gocode. because i don't remember i have installed it there manually. the reason why i chose this plugin is that i can store all this in .vim fold and upload it to github.In this way, i can clone it back easily when i have a new machine. thanks!

volgar1x commented 11 years ago

It currently does not install automatically nsf/gocode and I do not think that is the plug-in job. You can add, for yourself, in your .vimrc :

system("go install github.com/nsf/gocode")

graycreate commented 11 years ago

yeah,thx

volgar1x commented 10 years ago

I don't think I will create new commands anymore.