Skip to content

Commit a08f9bd

Browse files
committed
feat!: remove desc and statistics (#1)
1 parent 4ed128b commit a08f9bd

File tree

5 files changed

+52
-330
lines changed

5 files changed

+52
-330
lines changed

README.md

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010

1111
## Why?
1212

13-
Vim's built-in marks are great, but they're global and get messy fast. Marksman keeps your bookmarks organized by project, adds powerful search capabilities, and provides a clean interface to manage them with modern features like undo support and mark descriptions.
13+
Vim's built-in marks are great, but they're global and get messy fast. Marksman keeps your bookmarks organized by project, adds powerful search capabilities, and provides a clean interface to manage them with modern features like smart naming and file path display.
1414

1515
## Features
1616

1717
- **Project-scoped marks** - Each project gets its own isolated set of bookmarks
1818
- **Persistent storage** - Your marks survive Neovim restarts with automatic backup
1919
- **Smart naming** - Context-aware auto-generation of mark names based on code structure
2020
- **Quick access** - Jump to your most recent marks with single keys
21-
- **Enhanced search** - Find marks by name, description, file path, or content
22-
- **Mark descriptions** - Add context and notes to your bookmarks
23-
- **Undo support** - Restore accidentally deleted marks
24-
- **Statistics** - View detailed analytics about your mark usage
21+
- **Enhanced search** - Find marks by name, file path, or content
2522
- **Validation** - Check and clean up marks pointing to non-existent files
2623
- **Interactive UI** - Browse and manage marks in an enhanced floating window
2724
- **Multiple integrations** - Works with Telescope, Snacks.nvim, and more
@@ -57,9 +54,7 @@ Vim's built-in marks are great, but they're global and get messy fast. Marksman
5754
},
5855
auto_save = true,
5956
max_marks = 100,
60-
enable_descriptions = true,
6157
search_in_ui = true,
62-
undo_levels = 10,
6358
sort_marks = true,
6459
silence = false,
6560
minimal = false,
@@ -83,8 +78,6 @@ require("marksman").setup({
8378
},
8479
auto_save = true,
8580
max_marks = 100,
86-
enable_descriptions = true,
87-
undo_levels = 10,
8881
})
8982
```
9083

@@ -132,57 +125,39 @@ require("marksman").setup({
132125
- Press Enter or 1-9 to jump
133126
- `d` to delete
134127
- `r` to rename
135-
- `e` to edit description
136128
- `/` to search
137-
- `u` to undo last deletion
138129
- `v` to validate marks
139-
- `s` to show statistics
140130

141131
### Advanced Features
142132

143-
#### Mark Descriptions
144-
Add context to your marks for better organization:
145-
```lua
146-
require("marksman").add_mark("api_endpoint", "Main API route handler")
147-
```
148-
149133
#### Search Functionality
150134
Search through all mark data:
151135
```lua
152136
require("marksman").search_marks("api controller")
153137
```
154138

155-
#### Undo Deletions
156-
Restore accidentally deleted marks:
157-
```lua
158-
require("marksman").undo_last_deletion()
159-
```
160-
161139
## Commands
162140

163141
```
164-
:MarkAdd [name] [description] - Add a mark with optional description
165-
:MarkGoto [name] - Jump to mark or show marks list
166-
:MarkDelete [name] - Delete a mark
167-
:MarkRename old new - Rename a mark
168-
:MarkList - Show all marks in enhanced UI
169-
:MarkClear - Clear all marks in project
170-
:MarkSearch [query] - Search marks
171-
:MarkUndo - Undo last deletion
172-
:MarkExport - Export marks to JSON
173-
:MarkImport - Import marks from JSON
142+
:MarkAdd [name] - Add a mark with optional name
143+
:MarkGoto [name] - Jump to mark or show marks list
144+
:MarkDelete [name] - Delete a mark
145+
:MarkRename old new - Rename a mark
146+
:MarkList - Show all marks in enhanced UI
147+
:MarkClear - Clear all marks in project
148+
:MarkSearch [query] - Search marks
149+
:MarkExport - Export marks to JSON
150+
:MarkImport - Import marks from JSON
174151
```
175152

176153
## Enhanced UI Features
177154

178-
The floating window now includes:
155+
The floating window includes:
179156

180157
- **Real-time search** - Press `/` to filter marks instantly
181-
- **Mark descriptions** - View and edit contextual information
182158
- **Enhanced navigation** - Better keyboard shortcuts and visual feedback
183-
- **Statistics** - Press `s` to view detailed mark analytics
159+
- **File path display** - View relative file paths for better context
184160
- **Validation** - Press `v` to check mark integrity
185-
- **Undo support** - Press `u` to restore deleted marks
186161

187162
## Telescope Integration
188163

@@ -207,14 +182,11 @@ local function telescope_marksman()
207182
local entries = {}
208183
for name, mark in pairs(marks) do
209184
local display_text = name
210-
if mark.description and mark.description ~= "" then
211-
display_text = display_text .. " - " .. mark.description
212-
end
213185

214186
table.insert(entries, {
215187
value = name,
216188
display = display_text .. " (" .. vim.fn.fnamemodify(mark.file, ":~:.") .. ":" .. mark.line .. ")",
217-
ordinal = name .. " " .. (mark.description or "") .. " " .. mark.file,
189+
ordinal = name .. " " .. mark.file,
218190
filename = mark.file,
219191
lnum = mark.line,
220192
col = mark.col,
@@ -281,14 +253,10 @@ function M.snacks_marksman()
281253
vim.fn.fnamemodify(mark.file, ":~:."),
282254
tonumber(mark.line) or 1
283255
),
284-
ordinal = name .. " " .. (mark.description or "") .. " " .. vim.fn.fnamemodify(mark.file, ":t"),
256+
ordinal = name .. " " .. vim.fn.fnamemodify(mark.file, ":t"),
285257
mark_name = name,
286258
}
287259

288-
if mark.description and mark.description ~= "" then
289-
entry.display = entry.display .. " - " .. mark.description
290-
end
291-
292260
table.insert(results, entry)
293261
end
294262

@@ -313,16 +281,14 @@ end
313281
local marksman = require("marksman")
314282

315283
-- Basic operations
316-
marksman.add_mark("my_mark", "Optional description")
284+
marksman.add_mark("my_mark")
317285
marksman.goto_mark("my_mark")
318286
marksman.goto_mark(1) -- Jump to first mark by index
319287
marksman.delete_mark("my_mark")
320288
marksman.rename_mark("old_name", "new_name")
321289

322290
-- Enhanced features
323-
marksman.update_mark_description("my_mark", "New description")
324291
marksman.search_marks("search query")
325-
marksman.undo_last_deletion()
326292
marksman.show_marks()
327293

328294
-- Utility functions
@@ -337,7 +303,6 @@ marksman.import_marks()
337303
```lua
338304
local storage = require("marksman.storage")
339305

340-
storage.get_statistics() -- Get detailed analytics
341306
storage.validate_marks() -- Check mark integrity
342307
storage.get_project_name() -- Get current project name
343308
```
@@ -349,12 +314,9 @@ storage.get_project_name() -- Get current project name
349314
| `keymaps` | table | `{...}` | Key mappings for mark operations |
350315
| `auto_save` | boolean | `true` | Automatically save marks |
351316
| `max_marks` | number | `100` | Maximum marks per project |
352-
| `enable_descriptions` | boolean | `true` | Enable mark descriptions |
353317
| `search_in_ui` | boolean | `true` | Enable search in UI |
354-
| `undo_levels` | number | `10` | Number of deletions to remember |
355318
| `sort_marks` | boolean | `true` | Sort marks by access time (false = insertion order) |
356-
| `sort_marks` | boolean | `true` | Sort marks by access time (false = insertion order) |
357-
| `minimal` | boolean | `false` | Set to true for clean UI (only order and filename)|
319+
| `minimal` | boolean | `false` | Set to true for clean UI (only order and filepath)|
358320
| `highlights` | table | `{...}` | Custom highlight groups |
359321

360322
### Sorting Behavior
@@ -399,10 +361,12 @@ Marksman uses multiple methods to find your project root:
399361
### Search Algorithm
400362
The search function looks through:
401363
- Mark names
402-
- Mark descriptions
403364
- File names and paths
404365
- Code context (the line content)
405366

367+
### File Path Display
368+
The UI now shows relative file paths instead of just filenames, making it easier to distinguish between files with the same name in different directories.
369+
406370
## Performance
407371

408372
- **Lazy loading**: Modules are only loaded when needed

lua/marksman/init.lua

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ local default_config = {
2929
},
3030
auto_save = true,
3131
max_marks = 100,
32-
enable_descriptions = true,
3332
search_in_ui = true,
34-
undo_levels = 10,
3533
sort_marks = true,
3634
silent = false,
3735
minimal = false, -- Set to true for clean UI (only order and filename)
@@ -98,7 +96,6 @@ function M.add_mark(name, description)
9896
line = line,
9997
col = col,
10098
text = vim.fn.getline("."):sub(1, 80),
101-
description = description or "",
10299
created_at = os.time(),
103100
accessed_at = os.time(),
104101
}
@@ -176,19 +173,6 @@ function M.rename_mark(old_name, new_name)
176173
end
177174
end
178175

179-
function M.update_mark_description(name, description)
180-
local storage_module = get_storage()
181-
local success = storage_module.update_mark_description(name, description)
182-
183-
if success then
184-
notify("󰃀 Mark description updated: " .. name, vim.log.levels.INFO)
185-
return true
186-
else
187-
notify("Failed to update mark description", vim.log.levels.WARN)
188-
return false
189-
end
190-
end
191-
192176
function M.show_marks()
193177
local storage_module = get_storage()
194178
local ui_module = get_ui()
@@ -249,19 +233,6 @@ function M.import_marks()
249233
return storage_module.import_marks()
250234
end
251235

252-
function M.undo_last_deletion()
253-
local storage_module = get_storage()
254-
local restored = storage_module.undo_last_deletion()
255-
256-
if restored then
257-
notify("󰃀 Restored mark: " .. restored, vim.log.levels.INFO)
258-
return true
259-
else
260-
notify("Nothing to undo", vim.log.levels.INFO)
261-
return false
262-
end
263-
end
264-
265236
function M.setup(opts)
266237
config = vim.tbl_deep_extend("force", default_config, opts or {})
267238

@@ -319,7 +290,6 @@ function M.setup(opts)
319290
end,
320291
{ nargs = 1 },
321292
},
322-
{ "MarkUndo", M.undo_last_deletion, {} },
323293
}
324294

325295
for _, cmd in ipairs(commands) do

0 commit comments

Comments
 (0)