Mongoose is a Neovim plugin that helps you understand and optimize your editing patterns by tracking and analyzing your keystroke usage across different filetypes. Think of it as a fitness tracker for your Neovim usage – it observes how you work and provides insights to help you become more efficient.
Mongoose silently watches your editing patterns and provides valuable insights about your Neovim usage:
- Tracks keystroke patterns per filetype
- Measures command execution duration
- Shows your most frequently used key sequences
- Maintains statistics across sessions
- Provides real-time analytics through a floating window
- Offers AI-powered analysis of your Vim usage patterns
- Provides personalized recommendations for improvement
- Zero impact on editor performance
{
"XiaoConstantine/mongoose.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("mongoose").setup()
-- Optional: Add local llm for analysis
require("mongoose").configure_llm({
provider = "llamacpp",
})
-- Optional: Add a keymap to show analytics
vim.keymap.set('n', '<leader>ma', '<cmd>Mongoose<CR>', {
silent = true,
desc = "Show Mongoose Analytics"
})
-- Optional: Add keybinding for LLM analysis
vim.keymap.set("n", "<leader>ml", "<cmd>MongooseLLMAnalyze<cr>", {
silent = true,
desc = "Analyze Vim usage with LLM",
})
end
}
use {
'XiaoConstantine/mongoose.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
-- Basic setup
require('mongoose').setup()
-- Optional: Configure LLM integration
require("mongoose").configure_llm({
provider = "llamacpp",
})
-- Optional: Add keybindings
vim.keymap.set('n', '<leader>ma', '<cmd>Mongoose<CR>', {
silent = true,
desc = "Show Mongoose Analytics"
})
vim.keymap.set("n", "<leader>ml", "<cmd>MongooseLLMAnalyze<cr>", {
silent = true,
desc = "Analyze Vim usage with LLM",
})
end
}
Clone the repository into your Neovim packages directory:
git clone https://github.com/XiaoConstantine/mongoose.nvim \
~/.local/share/nvim/site/pack/plugins/start/mongoose.nvim
Mongoose starts tracking your keystrokes automatically after setup. To view your usage analytics:
- Use the command
:Mongoose
- Or use the default keymap
<leader>ma
(if configured) - Run
:MongooseLLMAnalyze
to generate an AI analysis of your editing patterns - View the analysis by pressing
l
in the Mongoose analytics window
The analytics window shows:
- Total keystrokes for the current filetype
- Most frequently used key sequences
- Average duration for each sequence
Get personalized recommendations for:
- Inefficient patterns in your workflow
- More efficient alternatives
- A structured learning plan
- Advanced Vim techniques suited to your style
The analytics window provides several key metrics:
- Total Keystrokes: The number of keystrokes recorded for the current filetype
- Most Used Sequences: Your most common key combinations, ordered by frequency
- Average Duration: How long it typically takes you to execute each sequence
This information can help you:
- Identify repetitive patterns that could be simplified with custom mappings
- Discover which commands you use most frequently
- Find opportunities to learn more efficient commands
- Track your progress as you learn new Neovim features
Mongoose works out of the box with sensible defaults, but you can customize it during setup:
require('mongoose').setup({
-- Configuration options coming soon!
})
Mongoose stores your usage data in:
~/.local/share/nvim/mongoose_analytics.json
The data is saved automatically and persists between Neovim sessions. The file is human-readable JSON if you want to examine or backup your usage patterns.
Mongoose uses Neovim's built-in key event handling to track your keystrokes efficiently. It:
- Captures keystrokes in real-time without impacting performance
- Groups related keystrokes into meaningful sequences
- Maintains separate statistics for each filetype
- Periodically saves data to preserve your usage history
- Provides analytics through a clean, floating window interface
MIT License - See LICENSE for details