Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/vim-goimpl
https://github.com/mattn/vim-goimpl
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mattn/vim-goimpl
- Owner: mattn
- Created: 2020-01-07T01:06:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-01-07T05:29:11.000Z (over 4 years ago)
- Last Synced: 2024-07-03T14:59:24.650Z (3 months ago)
- Language: Vim script
- Homepage:
- Size: 2.93 KB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-goimpl
`:GoImpl` command for Go
## Usage
When you have an interface
```go
type Foo interface {
DoSomething()
}
```Implement struct of struct/interface under the cursor
```
:GoImpl
``````go
type FooImpl struct {
}type (f *FooImpl) DoSomething() {
panic("not implemented") // TODO: Implement
}
```Implement struct of struct/interface with given interface
```
:GoImpl io.Reader
``````go
func (r *Reader) Read(p []byte) (n int, err error) {
panic("not implemented") // TODO: Implement
}
```Implement struct of struct/interface with given interface and given name
```
:GoImpl io.Reader Bar
``````go
type Bar struct {
}func (b *Bar) Read(p []byte) (n int, err error) {
panic("not implemented") // TODO: Implement
}
```## Installation
For [vim-plug](https://github.com/junegunn/vim-plug) plugin manager:
```viml
Plug 'mattn/vim-goimpl'
```## License
MIT
## Author
Yasuhiro Matsumoto (a.k.a. mattn)