Skip to content

Latest commit

 

History

History
56 lines (51 loc) · 2.51 KB

README.md

File metadata and controls

56 lines (51 loc) · 2.51 KB

go-heat.nvim 🔥

A neovim plugin to show the heatmap of your Go project, for a bird eye view of the test coverage.

Installation

-- Packer
use {  'lordvidex/go-heat.nvim',
  requires = { 'akinsho/toggleterm.nvim' },
  config = function() 
    require('go-heat').setup() 
  end
}

Screenshots

Heat in-Browser

Browser Shot

Heat in-Neovim

Terminal Shot

Default configurations

Below are the default configurations. You can override them by passing a table to the setup function.

local configs = {
  coverprofile = nil,                        -- default coverage profile (go-heat tries to look in cwd)
  svg_output = '/tmp/go-heat/temp.svg',      -- if not nil, will output the svg to this file
  open_in = 'browser',                      -- 'terminal' | 'browser' (terminal has lower quality than browser)
  browser_type = 'safari'                    -- only peculiar to Darwin; tested options: 'safari' | 'chrome' | 'arc' 
  debug = false,                            -- if true, will print debug messages
  -- any option passed to browser_type must be executable with `open` -a <name> in macos
}

Keymaps

This plugin does not set any keymap and you can set your own keymap to call the show function.
Below is an example of setting a keymap.

-- show the heatmap
vim.api.nvim_set_keymap('n', '<localleader>gth', '<cmd>lua require("go-heat").show()<cr>', { noremap = true, silent = true })

Requirements

References

  • go cover treemap: A tool to generate treemap visualizations of Go cover profiles

Checklist

  • Add convenient plugs and probably keymaps
  • Improve terminal render quality
  • Add more options for go-cover-treemap e.g. package_only, colors, etc
  • Reduce plugin dependencies / add scripts to install dependencies for all platforms

Please star🌟 this repository if you found go-heat useful.
Feel free to open an issue 🔭 or PR ➕ if you have any suggestions or contributions.