https://github.com/maxim2266/go-def
A tool for Kate editor for finding symbol definitions in Go source files.
https://github.com/maxim2266/go-def
find-definition golang kate-editor lua
Last synced: 2 months ago
JSON representation
A tool for Kate editor for finding symbol definitions in Go source files.
- Host: GitHub
- URL: https://github.com/maxim2266/go-def
- Owner: maxim2266
- License: bsd-3-clause
- Created: 2022-09-15T18:58:33.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-17T09:34:21.000Z (over 3 years ago)
- Last Synced: 2024-12-30T09:42:15.333Z (over 1 year ago)
- Topics: find-definition, golang, kate-editor, lua
- Language: Lua
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-def
[](https://opensource.org/licenses/BSD-3-Clause)
`go-def` is a tool for Kate editor for finding symbol definitions in Go source files.
It locates the definition of the symbol under cursor.
### Installation Steps
1. Make sure `Lua5.3` and `guru` are installed:
```
go install golang.org/x/tools/cmd/guru@latest
sudo apt install lua5.3
```
2. Clone this repository and `cd` to it;
3. Either `make install` for the default installation to `$XDG_DATA_HOME/kate/tools/`, where
`$XDG_DATA_HOME` defaults to `$HOME/.local/share`, or type `make` and then copy the file
`go-def` to any suitable location;
4. Add the tool to Kate editor:

5. Optionally add a keyboard shortcut to launch the tool.
### Notes
- I don't know how to make Kate open files in read-only mode from the command line, so just beware
that all files are opened writable.
- The tool uses [`guru`](https://pkg.go.dev/golang.org/x/tools/cmd/guru) for finding the definitions,
and in large projects it can be quite slow to respond (10 seconds or so), while Kate editor provides no
visual feedback, so be patient.
### Status
Tested with Kate version 19.12.3 on Linux Mint 20.3.