Skip to content

johnmathews/project-dashboard.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

project-dashboard.nvim

A modern Neovim dashboard plugin that displays comprehensive project statistics and insights when you open a git repository.

✨ Features

  • πŸ“Š Project Statistics - File counts, lines of code by language, comprehensive project metrics
  • 🌿 Git Insights - Total commits, branches, remotes, and repository status
  • πŸ‘₯ Contributors - Top contributors with commit counts
  • πŸ™ GitHub Integration - Stars, forks, open issues, and repository metadata (via GitHub API)
  • 🎨 Modern UI - Clean tiled layout with bordered panels and Unicode icons
  • ⚑ Performance - Async data loading with performance tracking
  • πŸ”§ Highly Configurable - Customize layout, spacing, tiles, and behavior
  • πŸš€ Auto-trigger - Automatically opens when entering a git repository

πŸ“¦ Installation

Using lazy.nvim

{
  'johnmathews/project-dashboard.nvim',
  dependencies = {
    'nvim-lua/plenary.nvim',
    'nvim-tree/nvim-web-devicons'  -- optional, for file icons
  },
  config = function()
    require('project-dashboard').setup({})
  end
}
use {
  'johnmathews/project-dashboard.nvim',
  requires = {
    'nvim-lua/plenary.nvim',
    'nvim-tree/nvim-web-devicons'
  },
  config = function()
    require('project-dashboard').setup({})
  end
}

Using vim-plug

Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-tree/nvim-web-devicons'  " optional
Plug 'johnmathews/project-dashboard.nvim'

" In your init.vim or after/plugin/dashboard.lua:
lua require('project-dashboard').setup({})

πŸš€ Usage

Automatic Opening

The dashboard automatically opens when you:

  • Open Neovim in a git repository directory without specifying a file
  • Navigate to a git repository with :cd /path/to/repo

Manual Opening

Open the dashboard anytime with:

:ProjectDashboard

Keybindings

When the dashboard is open:

  • q - Close dashboard
  • Any file navigation key - Dashboard auto-closes when you open a file

βš™οΈ Configuration

Minimal Configuration

require('project-dashboard').setup({})

Full Configuration (with defaults)

require('project-dashboard').setup({
  -- Auto-open dashboard when entering a git repository
  auto_open = true,
  
  -- Show performance timing in the command line
  show_timing = true,
  
  -- Conservative auto-open behavior
  -- Won't open if files are specified or session is being loaded
  auto_open_conservative = true,
  
  -- Layout configuration
  layout = {
    margin_x = 8,  -- horizontal margin from screen edges
    margin_y = 1,  -- vertical margin from top/bottom
  },
  
  -- GitHub API integration
  github = {
    enabled = true,
    timeout = 5000,  -- timeout in milliseconds
  },
  
  -- Tile configuration
  tiles = {
    enabled = true,
    
    -- Tile dimensions
    width = 45,   -- minimum tile width (tiles expand to fill space)
    height = 12,  -- tile height in lines
    
    -- Spacing between tiles
    gap_x = 3,  -- horizontal gap between tiles
    gap_y = 1,  -- vertical gap between rows
  }
})

Common Customizations

Wider margins for more padding

require('project-dashboard').setup({
  layout = {
    margin_x = 15,  -- more horizontal padding
    margin_y = 3,   -- more vertical padding
  }
})

Tighter tile spacing

require('project-dashboard').setup({
  tiles = {
    gap_x = 2,  -- less horizontal spacing
    gap_y = 0,  -- no vertical spacing between rows
  }
})

Disable auto-open

require('project-dashboard').setup({
  auto_open = false
})
-- Then manually open with :ProjectDashboard

Disable GitHub API (faster loading, no internet required)

require('project-dashboard').setup({
  github = {
    enabled = false
  }
})

πŸ“Š What Information is Displayed?

πŸ“ Project Info

  • Project name
  • Current git branch
  • Remote repository URL

πŸ“„ File Statistics

  • Total files in the project
  • Total lines of code
  • Breakdown by language with percentages

πŸ’» Languages

  • Top programming languages by line count
  • Visual bar charts showing percentage
  • File counts per language

🌿 Git Statistics

  • Total commits
  • Number of branches
  • Number of remotes

πŸ‘₯ Top Contributors

  • Top 5 contributors by commit count
  • Name and commit count for each

πŸ™ GitHub Information (if remote is GitHub)

  • ⭐ Stars
  • 🍴 Forks
  • πŸ› Open issues
  • πŸ’» Primary language
  • πŸ“ Repository description

πŸ§ͺ Testing

This plugin includes a comprehensive test suite using plenary.nvim.

Run all tests

make test

Run specific test suites

make test-init        # Test plugin initialization
make test-git         # Test git functionality
make test-tiles       # Test tile layout

Manual testing

# Test dashboard in headless mode
nvim --headless -c "lua require('project-dashboard').setup({})" -c "ProjectDashboard" -c "sleep 3" -c "qa"

πŸ”§ Development

See AGENTS.md for development guidelines and code style conventions.

Project Structure

project-dashboard.nvim/
β”œβ”€β”€ lua/project-dashboard/
β”‚   β”œβ”€β”€ init.lua           # Main plugin entry point
β”‚   β”œβ”€β”€ dashboard.lua      # Dashboard rendering and UI
β”‚   β”œβ”€β”€ git.lua            # Git and GitHub integration
β”‚   β”œβ”€β”€ stats.lua          # File statistics and analysis
β”‚   └── tiles.lua          # Tile layout system
β”œβ”€β”€ plugin/                # Neovim plugin loader
β”œβ”€β”€ tests/                 # Test suite (plenary.nvim)
β”œβ”€β”€ examples/              # Configuration examples
└── docs/                  # Additional documentation

πŸ› Troubleshooting

Dashboard doesn't auto-open

  • Check that you're in a git repository: git status
  • Verify auto_open = true in your config
  • Try manually opening with :ProjectDashboard

GitHub data shows "Unable to fetch"

  • Check internet connection
  • Verify the remote URL is a GitHub repository: git remote -v
  • Check GitHub API rate limits (60 requests/hour for unauthenticated)
  • Try disabling and re-enabling: :lua require('project-dashboard').setup({ github = { enabled = false }})

Contributors not showing

This should be fixed in the latest version. If you still see "No contributors":

  • Verify you have commits: git log
  • Try running manually: git shortlog -sn --all
  • Check Neovim messages: :messages

Performance issues on large repositories

  • Disable GitHub API for faster loading: github = { enabled = false }
  • The plugin uses async loading and should handle large repos well
  • Check performance timing with show_timing = true

🀝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Areas for contribution

  • Additional tile types (tests, CI status, etc.)
  • Support for other git hosting services (GitLab, Bitbucket)
  • Custom tile ordering and layout
  • Theme/color customization
  • Performance optimizations

πŸ“ License

MIT License - see LICENSE file for details

πŸ™ Acknowledgments

πŸ“¬ Support


Made with ❀️ for the Neovim community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published