Skip to content

About

Visual complexity insights

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Timesense.nvim

Complexity analyzer and coding stats tracker for competitive programming.

Features

  • Inline complexity hints - Displays time/space complexity on every loop and function call
  • Overall complexity summary - Shows Time: O(n log n) | Space: O(n) at the top of your file
  • Comprehensive pattern detection - 50+ STL functions, graph algorithms, data structures
  • Nested operation support - Correctly handles sort inside loops, multiple nested structures
  • Coding statistics - Track time spent coding by language
  • Zero dependencies - Fully offline, no external tools required

Supported Patterns

Time Complexity Detection

  • Loops: for, while, do-while, range-based for
  • STL Functions: sort, binary_search, lower_bound, set/map operations, heap operations, and 40+ more
  • Algorithms: DFS/BFS, Dijkstra, Floyd-Warshall, DSU, Segment Trees, KMP, Sieve
  • Optimizations: Bitwise patterns (i & (i-1)), logarithmic loops, sqrt loops

Space Complexity Detection

  • Arrays, vectors, sets, maps, unordered containers
  • 2D structures and DP tables
  • Graph adjacency lists
  • Segment/Fenwick trees, DSU arrays

Installation

-- lazy.nvim
{
  'samonide/timesense.nvim',
  config = function()
    require('timesense').setup()
  end,
  cmd = 'Timesense',
  ft = { 'cpp', 'c' },
}

Quick Start

:Timesense complexity   " Analyze code complexity
:Timesense stats        " View coding statistics
:Timesense toggle       " Show/hide hints

See USAGE.md for detailed documentation.

Requirements

  • Neovim 0.8+
  • Currently supports C/C++ (Python/Java planned)

Disclaimer

This project used AI assistance for code comments and documentation.

License

MIT

About

Visual complexity insights

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages