-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmark.lua
117 lines (101 loc) · 2.8 KB
/
mark.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
return {
'chentoast/marks.nvim',
id = 'mark',
config = function(config)
require('marks').setup(config.mark)
end,
defaultConfig = {
'mark',
{
-- whether to map keybinds or not. default true
default_mappings = false,
-- which builtin marks to show. default {}
--[[ builtin_marks = { '.', '<', '>', '^' }, ]]
-- whether movements cycle back to the beginning/end of buffer. default true
cyclic = true,
-- whether the shada file is updated after modifying uppercase marks. default false
force_write_shada = true,
-- how often (in ms) to redraw signs/recompute mark positions.
-- higher values will have better performance but may cause visual lag,
-- while lower values may cause performance penalties. default 150.
refresh_interval = 250,
-- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
-- marks, and bookmarks.
-- can be either a table with all/none of the keys, or a single number, in which case
-- the priority applies to all marks.
-- default 10.
sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 },
excluded_filetypes = {},
-- marks.nvim allows you to configure up to 10 bookmark groups, each with its own
-- sign/virttext. Bookmarks can be used to group together positions and quickly move
-- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and
-- default virt_text is "".
bookmark_0 = {
sign = '⚑',
-- explicitly prompt for a virtual line annotation when setting a bookmark from this group.
-- defaults to false.
annotate = true,
},
mappings = {
set_next = 'mm',
set = 'm,',
delete_line = 'md',
delete_buf = 'mD',
next = 'mj',
prev = 'mk', -- pass false to disable only this default mapping
set_bookmark0 = 'm0',
set_bookmark1 = 'm1',
set_bookmark2 = 'm2',
set_bookmark3 = 'm3',
set_bookmark4 = 'm4',
set_bookmark5 = 'm5',
set_bookmark6 = 'm6',
set_bookmark7 = 'm7',
set_bookmark8 = 'm8',
set_bookmark9 = 'm9',
delete_bookmark = 'mbd',
},
},
},
keymaps = {
{
'n',
'ml',
function()
require('marks').mark_state:buffer_to_list('quickfixlist')
local ok, trouble = pcall(require, 'trouble')
if ok then
trouble.open('quickfix')
else
vim.cmd.copen()
end
end,
},
{
'n',
'mL',
function()
require('marks').mark_state:all_to_list('quickfixlist')
local ok, trouble = pcall(require, 'trouble')
if ok then
trouble.open('quickfix')
else
vim.cmd.copen()
end
end,
},
{
'n',
'mbl',
function()
require'marks'.bookmark_state:all_to_list('quickfixlist')
local ok, trouble = pcall(require, 'trouble')
if ok then
trouble.open('quickfix')
else
vim.cmd.copen()
end
end,
},
},
}