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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
require "lspsaga".init_lsp_saga {
--border_style = "single",
saga_winblend = 20,
-- float_term = {
-- winblend = 25,
-- shadow_background = false,
-- },
move_in_saga = { next = '<C-n>', prev = '<C-p>' },
--move_in_saga = { prev = "k", next = "j" },
scroll_in_preview = {
scroll_down = "<C-d>",
scroll_up = "<C-u>",
},
diagnostic_header = { " ", " ", " ", " " },
-- add bracket or something with diagnostic source, just have 2 elements
-- use emoji lightbulb in default
code_action_icon = "",
--code_action_icon = "ﯦ ",
-- if true can press number to execute the codeaction in codeaction window
code_action_num_shortcut = true,
-- same as nvim-lightbulb but async
code_action_lightbulb = {
enable = false,
sign = false,
sign_priority = 20, --
virtual_text = true,
},
finder_icons = {
def = " ",
ref = " ",
link = " ",
},
-- preview lines of lsp_finder and definition preview
max_preview_lines = 5,
definition_action_keys = {
edit = '<CR>',
vsplit = '<C-y>',
split = '<C-x>',
tabe = '<C-t>',
quit = '<ESC>',
},
-- definition_preview_quit = '<ESC>',
-- finder_preview_hl_ns = 8,
finder_action_keys = {
open = "o",
vsplit = "v",
split = "s",
tabe = "t",
quit = "<ESC>",
scroll_down = "<C-j>",
scroll_up = "<C-k>", -- quit can be a table
},
code_action_keys = {
quit = "<ESC>",
exec = "l",
},
rename_action_quit = "<ESC>",
rename_in_select = true,
symbol_in_winbar = {
enable = true,
in_custom = false,
--in_custom = true,
separator = ' ',
--show_file = false,
show_file = true,
click_support = false,
},
show_outline = {
win_position = 'right',
--set special filetype win that outline window split.like NvimTree neotree
-- defx, db_ui
min_with = '',
win_width = 40,
auto_enter = false,
auto_preview = true,
virt_text = 'x',
jump_key = 'l',
-- auto refresh when change buffer
auto_refresh = true,
},
custom_kind = {
File = { " " },
Module = { " " },
Namespace = { "ﱕ " },
Package = { " " },
Class = { "ﴯ " },
Method = { "" },
Property = { "ﰠ " },
Field = { "ﰠ " },
Constructor = { " " },
Enum = { " " },
Interface = { " " },
Function = { " " },
Variable = { " " },
Constant = { " " },
String = { " " },
Number = { " " },
Boolean = { " " },
Array = { " " },
Object = { " " },
Key = { "- " },
Null = { " " },
EnumMember = { " " },
Struct = { " " },
Event = { " " },
Operator = { " " },
TypeParameter = { " " },
TypeAlias = { " " },
Parameter = { " " },
StaticMethod = { " " },
Macro = { "廓" },
},
}
-- Mappings.
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
map("n", "gd", "<CMD>Lspsaga peek_definition<CR>", opts)
--map("n", "gp", "<Cmd>Lspsaga peek_definition<CR>", opts)
map("n", "gi", "<CMD>Lspsaga lsp_finder<CR>", opts)
--map("n", "gh", "<CMD>Lspsaga hover_doc<CR>", opts)
map("n", "gs", "<CMD>Lspsaga signature_help<CR>", opts)
map("n", "ga", "<CMD>Lspsaga code_action<CR>", opts)
map("v", "ga", "<CMD><C-u>Lspsaga range_code_action<CR>", opts)
map("n", "gl", "<CMD>Lspsaga show_line_diagnostics<CR>", opts)
map("n", "go", "<CMD>Lspsaga open_floaterm fish<CR>", opts)
map("n", ";D", "<CMD>Lspsaga show_cursor_diagnostics<CR>", opts)
map("n", "<gr>", "<CMD>Lspsaga rename<CR>", opts)
map("n", "gk", "<CMD>Lspsaga diagnostic_jump_prev<CR>", opts)
map("n", "gj", "<CMD>Lspsaga diagnostic_jump_next<CR>", opts)
map("n", "[d", "<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
map("n", "]d", "<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
map("t", "<ESC>", "<CMD>Lspsaga close_floaterm<CR>", opts)
-- vim.keymap.set("n", "<C-f>", function() require "lspsaga.action".smart_scroll_with_saga(1) end, opts)
-- vim.keymap.set("n", "<C-b>", function() require "lspsaga.action".smart_scroll_with_saga(-1) end, opts)
vim.api.nvim_set_hl(0, "LspSagaHoverBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaTermBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspFloatWinBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaAutoPrew", { bg = "NONE", fg = "#BBE73D", })
vim.api.nvim_set_hl(0, "LspSagaAutoPreview", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaBorderTitle", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaCodeActionBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaCodeActionContent", { bg = "NONE", fg = "#000000", })
vim.api.nvim_set_hl(0, "LspSagaCodeActionTitle", { bg = "NONE", fg = "#000000", })
vim.api.nvim_set_hl(0, "LspSagaCodeActionTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "DefinitionBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "DefinitionArror", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "DefinitionSearch", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "DefinitionFile", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticSource", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticQuickFix", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticMap", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticLineCol", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticHeader", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticError", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticWarn", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticInfo", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticHint", { bg = "NONE", fg = "#929292", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticSource", { bg = "NONE", fg = "#C53B82", })
vim.api.nvim_set_hl(0, "LspSagaDiagnosticTruncateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaErrorTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaFinderSelection", { bg = "NONE", fg = "#888888", })
vim.api.nvim_set_hl(0, "LspSagaHintTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaHoverTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaInfoTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaLightBulb", { bg = "NONE", fg = "#BBE73D", })
vim.api.nvim_set_hl(0, "LspSagaLspFinderBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaRenameBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaRenameMatch", { bg = "NONE", fg = "#C53B82", })
vim.api.nvim_set_hl(0, "LspSagaShTrunCateLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaSignatureHelpBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "LspSagaTrunCatgeLine", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "TargetFileName", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "FinderParam", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "FinderVirtText", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "DefinitionsIcon", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "Definitions", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "ReferencesIcon", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "References", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "DefinitionCount", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "ReferencesCount", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "FinderPreviewSearch", { bg = "NONE", fg = "#888888", })
vim.api.nvim_set_hl(0, "FinderSpinnerBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "FinderSpinnerTitle", { bg = "NONE", fg = "#C53B82", })
vim.api.nvim_set_hl(0, "FinderSpinner", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "DefinitionPreviewTitle", { bg = "NONE", fg = "#666666", })
vim.api.nvim_set_hl(0, "SagaShadow", { bg = "NONE", fg = "#000000", })
--
---- Outline
vim.api.nvim_set_hl(0, "LSOutlinePreviewBorder", { bg = "NONE", fg = "#353535", })
vim.api.nvim_set_hl(0, "OutlineIndentEvn", { bg = "NONE", fg = "#ffffff", })
vim.api.nvim_set_hl(0, "OutlineIndentOdd", { bg = "NONE", fg = "#ffffff", })
vim.api.nvim_set_hl(0, "OutlineFoldPrefix", { bg = "NONE", fg = "#000000", })
vim.api.nvim_set_hl(0, "OutlineDetail", { bg = "NONE", fg = "#383838", })
--
vim.api.nvim_set_hl(0, "LSOutLineFile", { bg = "NONE", fg = "#AF87D7" })
vim.api.nvim_set_hl(0, "LSOutLineModule", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineNamespace", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLinePackage", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineClass", { bg = "NONE", fg = "#BBE73D", bold = true, italic = true })
vim.api.nvim_set_hl(0, "LSOutLineMethod", { bg = "NONE", fg = "#C53B82", italic = true })
vim.api.nvim_set_hl(0, "LSOutLineProperty", { bg = "NONE", fg = "#6A5A9D" })
vim.api.nvim_set_hl(0, "LSOutLineField", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineConstructor", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineEnum", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineInterface", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineFunction", { bg = "NONE", fg = "#C53B82", bold = true, italic = true })
vim.api.nvim_set_hl(0, "LSOutLineVariable", { bg = "NONE", fg = "#696969" })
vim.api.nvim_set_hl(0, "LSOutLineConstant", { bg = "NONE", fg = "#C53B82" })
vim.api.nvim_set_hl(0, "LSOutLineString", { bg = "NONE", fg = "#444444" })
vim.api.nvim_set_hl(0, "LSOutLineNumber", { bg = "NONE", fg = "#AFC460" })
vim.api.nvim_set_hl(0, "LSOutLineBoolean", { bg = "NONE", fg = "#C53B82" })
vim.api.nvim_set_hl(0, "LSOutLineArray", { bg = "NONE", fg = "#614F97" })
vim.api.nvim_set_hl(0, "LSOutLineObject", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineKey", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineNull", { bg = "NONE", fg = "#C53B82" })
vim.api.nvim_set_hl(0, "LSOutLineEnummember", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineStruct", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineEvent", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineOperator", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineTypeparameter", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineTypealias", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineParameter", { bg = "NONE", fg = "#8567A3" })
vim.api.nvim_set_hl(0, "LSOutLineStaticmethod", { bg = "NONE", fg = "#666666" })
vim.api.nvim_set_hl(0, "LSOutLineMacro", { bg = "NONE", fg = "#666666" })
-- vim.api.nvim_create_autocmd("BufEnter", {
-- callback = function ()
-- if #vim.api.nvim_list_wins() == 1 and vim.bo.filetype == "lspsagaoutline" then
-- vim.cmd "quit"
-- end
-- end
-- })
|