Skip to content

Me1onRind/gomodule-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gomodule-info

Provides a function to get the Go Module info.

You can configure shortcuts to insert import path prefix quickly.

install

vim-plug

Plug 'Me1onRind/gomodule-info'

Provide functions

GoModuleName()

Retrun current editing file's go module name. It will lookup parent directory until find out go.mod or arrive root directory.

configure

edit your .vimrc

function InsertGomoduleImportItem()
    let str = "\t\"" . GoModuleName() ."/\""
    call append(line('.'), l:str)
    normal j$
    startinsert
endfunction

nmap gii :call InsertGomoduleImportItem()<CR>

You can do change detail according to persion preference or do something else.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published