For language server to work, it is necessary to compile the projects with flag -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
. Take cmake project for example,
# Go into build folder in cmake project
mkdir build && cd build
# Create compile_commands.json with the flag
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
Call M-x start_glow_viewer
in a markdown buffer. See here for details.
In order to use this feature, glow
has to be installed manually.
sudo snap install go --classic
go get github.com/charmbracelet/glow