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.
- Make sure
Lua5.3
andguru
are installed:
go install golang.org/x/tools/cmd/guru@latest
sudo apt install lua5.3
- Clone this repository and
cd
to it; - Either
make install
for the default installation to$XDG_DATA_HOME/kate/tools/
, where$XDG_DATA_HOME
defaults to$HOME/.local/share
, or typemake
and then copy the filego-def
to any suitable location; - Add the tool to Kate editor:
- Optionally add a keyboard shortcut to launch the tool.
- 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
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.
Tested with Kate version 19.12.3 on Linux Mint 20.3.