vim-go: How to open files returned by GoFiles -


The Vimeo-plugin has one: the GoFile function to show the dependent source files on the current file is output looks like this :

  ['/ home / tretkow / tut / main.go', '/home/tretkow/tut/test.go']  

list How to open files from?

: gofile only by the look of your snippet go # tool # Files () .

It is possible to extract only one file name in some way:

 : E & lt; C-R & gt; = Know # device # files () [0] & lt; CR & gt;  

Or put that list in the scratch buffer:

 : vnew < CR & gt; : 0put = join (# tools # go to the files), '\ r') & lt; CR & gt; Use /home/tretkow/tut/main.go/home/tretkow/tut/test.go  

and gf to jump on file under cursor Please.


Here's a more sophisticated solution: : GoFile is the command to edit through the custom tab for : GoFiles Lets choose file - news

command command! -nargs = 1 -complete = customlist, GoFilesComplete GoFile Call GoFile (& lt; f-args & gt;) "Full Function Function! GoFilesComplete (ArgLead, CmdLine, CursorPos) Return Filter (# Tools # Files (), Go to 'v: val = ~ a: ArgLead') "Edit: Edit Cover Function" Edit "GoFile (file) A: file endfunction

Usage:

 : GoFile> Tab & gt;  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -