Skip to content

Commit c8a539c

Browse files
committed
feat: minimal ui mode
1 parent b812bf6 commit c8a539c

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ Vim's built-in marks are great, but they're global and get messy fast. Marksman
6060
enable_descriptions = true,
6161
search_in_ui = true,
6262
undo_levels = 10,
63-
sort_marks = true, -- Set to false to keep insertion order
64-
silence = false, -- Set to true to disable all notifications
63+
sort_marks = true,
64+
silence = false,
65+
minimal = false,
6566
},
6667
}
6768
```
@@ -352,7 +353,8 @@ storage.get_project_name() -- Get current project name
352353
| `search_in_ui` | boolean | `true` | Enable search in UI |
353354
| `undo_levels` | number | `10` | Number of deletions to remember |
354355
| `sort_marks` | boolean | `true` | Sort marks by access time (false = insertion order) |
355-
| `silence` | boolean | `false` | If notifications should be shown|
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)|
356358
| `highlights` | table | `{...}` | Custom highlight groups |
357359

358360
### Sorting Behavior

lua/marksman/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ local default_config = {
3434
undo_levels = 10,
3535
sort_marks = true,
3636
silent = false,
37+
minimal = false, -- Set to true for clean UI (only order and filename)
3738
}
3839

3940
local config = {}

lua/marksman/ui.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,42 @@ local function create_marks_content(marks, search_query)
139139
end)
140140
end
141141

142+
-- MINIMAL MODE: Show only order and filename
143+
if config.minimal then
144+
if vim.tbl_isempty(filtered_marks) then
145+
table.insert(lines, " No marks")
146+
return lines, highlights, {}
147+
end
148+
149+
for i, name in ipairs(mark_names) do
150+
local mark = filtered_marks[name]
151+
local filename = vim.fn.fnamemodify(mark.file, ":t")
152+
local line = string.format("[%d] %s", i, filename)
153+
table.insert(lines, line)
154+
155+
local line_idx = #lines - 1
156+
mark_info[line_idx] = { name = name, mark = mark, index = i }
157+
158+
-- Highlight the number
159+
table.insert(highlights, {
160+
line = line_idx,
161+
col = 0,
162+
end_col = string.len(string.format("[%d]", i)),
163+
hl_group = "ProjectMarksNumber",
164+
})
165+
-- Highlight the filename
166+
table.insert(highlights, {
167+
line = line_idx,
168+
col = string.len(string.format("[%d] ", i)),
169+
end_col = -1,
170+
hl_group = "ProjectMarksFile",
171+
})
172+
end
173+
174+
return lines, highlights, mark_info
175+
end
176+
177+
-- NORMAL MODE: Full detailed view
142178
-- Header
143179
local title = search_query
144180
and search_query ~= ""

0 commit comments

Comments
 (0)