Skip to content

Commit 88901ec

Browse files
committed
feat: Add Treesitter support, marks caching, and fixed-size UI
Add marks file caching in storage module that validates against file modification times to reduce I/O operations. Implement comprehensive Treesitter integration for more accurate context detection when generating mark names, with fallback to regex patterns. Redesign the UI with a fixed 80x20 window size, featuring dimmed help text at the bottom and visual separators between sections. The changes maintain backward compatibility while providing significant performance gains through caching and more intelligent mark naming through Treesitter AST analysis.
1 parent ace36b6 commit 88901ec

File tree

3 files changed

+419
-125
lines changed

3 files changed

+419
-125
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Vim's built-in marks are great, but they're global and get messy fast. Marksman
1818

1919
- **Project-scoped marks** - Each project gets its own isolated set of bookmarks
2020
- **Persistent storage** - Your marks survive Neovim restarts with automatic backup
21-
- **Smart naming** - Context-aware auto-generation based on code structure
21+
- **Smart naming** - Context-aware auto-generation using Treesitter and pattern matching
2222
- **Quick access** - Jump to marks with single keys or interactive UI
2323
- **Enhanced search** - Find marks by name, file path, or content with real-time filtering
2424
- **Mark reordering** - Move marks up/down to organize them as needed
2525
- **Multiple integrations** - Works with Telescope, Snacks.nvim, and more
26-
- **Memory efficient** - Lazy loading, cleanup, and debounced operations
26+
- **Memory efficient** - Lazy loading, marks caching, cleanup, and debounced operations
2727
- **Robust error handling** - Graceful fallbacks and comprehensive validation
2828

2929
## Requirements
@@ -135,6 +135,9 @@ require("marksman").setup({
135135
ProjectMarksFile = { fg = "#56B6C2" },
136136
ProjectMarksLine = { fg = "#D19A66" },
137137
ProjectMarksText = { fg = "#5C6370", italic = true },
138+
ProjectMarksHelp = { fg = "#5C6370" },
139+
ProjectMarksBorder = { fg = "#5A5F8C" },
140+
ProjectMarksSeparator = { fg = "#3E4451" },
138141
},
139142
})
140143
```
@@ -253,15 +256,19 @@ marksman.show_marks("optional_search")
253256

254257
## How it works
255258

256-
**Storage**: Marks are stored in `~/.local/share/nvim/marksman_[hash].json` per project with automatic backup.
259+
**Storage**: Marks are stored in `~/.local/share/nvim/marksman_[hash].json` per project with automatic backup and caching for improved performance.
257260

258-
**Smart Naming**: Auto-generates context-aware names:
261+
**Smart Naming**: Auto-generates context-aware names using Treesitter when available, falling back to pattern matching:
259262
- `fn:calculate_total` for functions
260263
- `class:UserModel` for classes
261264
- `var:api_key` for variables
265+
- `method:process_data` for methods
266+
- `interface:Serializable` for interfaces
267+
- `trait:Iterator` for Rust traits
268+
- `type:Config` for type definitions
262269
- `filename:line` as fallback
263270

264-
**Project Detection**: Uses Git root, common project files (.git, package.json, etc.), or current directory.
271+
**Project Detection**: Uses Git root, common project files (.git, package.json, etc.), or current directory with 30-second caching.
265272

266273
**Search**: Multi-field search across mark names, file paths, and code content.
267274

0 commit comments

Comments
 (0)