-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.lua
More file actions
516 lines (482 loc) · 16.8 KB
/
Copy pathconfig.lua
File metadata and controls
516 lines (482 loc) · 16.8 KB
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
-- general
lvim.log.level = "warn"
lvim.format_on_save = true
-- vim.cmd('set background=light')
-- lvim.colorscheme = "github_dimmed"
lvim.colorscheme = "kanagawa"
lvim.builtin.lualine.options.theme = "auto"
-- vim.background = "light"
-- vim.g.gruvbox_bold = 1;
-- vim.g.gruvbox_italic = 1;
-- vim.g.gruvbox_contrast_dark = "soft"
vim.opt.hidden = false
vim.opt.cmdheight = 1;
vim.opt.wrap = true
vim.opt.termguicolors = true
vim.opt.winblend = 0
vim.opt.pumblend = 0
-- wsl2
if vim.fn.has "wsl" == 1 then
vim.g.clipboard = {
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
}
end
-- keymappings [view all the defaults by pressing <leader>Lk]
lvim.leader = ","
-- lvim.keys.normal_mode["<leader>o>"] = ":SymbolsOutline<CR>"
lvim.keys.normal_mode["<leader>t"] = ":TodoLocList<CR>"
-- add your own keymapping
-- auto install lsp server
lvim.lsp.installer.setup.automatic_servers_installation = true
-- builtin
lvim.builtin.alpha.active = true
lvim.builtin.alpha.mode = "dashboard"
lvim.builtin.alpha.dashboard.section.header.val = {
" ████████╗ █████╗ ██████╗ ███████╗",
" ╚══██╔══╝██╔══██╗██╔═══██╗ ██╔════╝",
" ██║ ███████║██║ ██║█████╗███████╗",
" ██║ ██╔══██║██║ ██║╚════╝╚════██║",
" ██║ ██║ ██║╚██████╔╝ ███████║",
" ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝",
}
lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.dap.active = true
-- if you don't want all the parsers change this to a table of the ones you want
lvim.builtin.treesitter.ensure_installed = {
"bash", "c", "cpp", "javascript", "json", "lua", "python", "typescript", "tsx",
"css", "rust", "java", "yaml", "dart"
}
-- auto install
lvim.builtin.treesitter.ignore_install = { "haskell" }
lvim.builtin.treesitter.highlight.enabled = true
-- gitsigns
lvim.builtin.gitsigns.opts.current_line_blame = true
-- indent blackline
lvim.builtin.indentlines.options.space_char_blankline = " "
lvim.builtin.indentlines.options.show_current_context = true
lvim.builtin.indentlines.options.show_current_context_start = true
-- flutter
-- lvim.builtin.which_key.mappings["F"] = {
-- name = "+Flutter",
-- c = { "<cmd>Telescope flutter commands<cr>", "Open Flutter Commans" },
-- d = { "<cmd>FlutterDevices<cr>", "Flutter Devices" },
-- e = { "<cmd>FlutterEmulators<cr>", "Flutter Emulators" },
-- r = { "<cmd>FlutterReload<cr>", "Hot Reload App" },
-- R = { "<cmd>FlutterRestart<cr>", "Hot Restart app" },
-- q = { "<cmd>FlutterQuit<cr>", "Quit running application" },
-- v = { "<cmd>Telescope flutter fvm<cr>", "Flutter version" },
-- }
-- plugins
lvim.plugins = {
-- { 'sainnhe/everforest' },
-- { 'sainnhe/sonokai' },
-- { 'joshdick/onedark.vim' },
-- {
-- 'projekt0n/github-nvim-theme'
-- },
{ 'easymotion/vim-easymotion' },
-- { "github/copilot.vim" },
-- { "catppuccin/nvim", name = "catppuccin", priority = 1000 },
-- {
-- 'Exafunction/codeium.vim',
-- event = 'BufEnter'
-- },
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({})
end,
},
{
"zbirenbaum/copilot-cmp",
config = function()
require("copilot_cmp").setup({
suggestion = { enabled = false },
panel = { enabled = false }
})
end
},
{
"rebelot/kanagawa.nvim",
config = function()
require('kanagawa').setup({
compile = false, -- enable compiling the colorscheme
undercurl = true, -- enable undercurls
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true },
statementStyle = { bold = true },
typeStyle = {},
transparent = false, -- do not set background color
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
terminalColors = true, -- define vim.g.terminal_color_{0,17}
colors = { -- add/modify theme and palette colors
palette = {},
theme = { wave = {}, lotus = {}, dragon = {}, all = {} },
},
overrides = function(colors) -- add/modify highlights
return {}
end,
theme = "wave", -- Load "wave" theme when 'background' option is not set
background = { -- map the value of 'background' option to a theme
dark = "wave", -- try "dragon" !
light = "lotus"
},
})
end,
},
{
"2nthony/vitesse.nvim",
dependencies = {
"tjdevries/colorbuddy.nvim"
},
config = function()
require("vitesse").setup {
transparnet_background = true,
comment_italics = true,
transparent_background = true,
transparent_float_background = true, -- aka pum(popup menu) background
reverse_visual = true,
dim_nc = true,
cmp_cmdline_disable_search_highlight_group = true, -- disable search highlight group for cmp item
-- if `transparent_float_background` false, make telescope border color same as float background
telescope_border_follow_float_background = true,
-- diagnostic virtual text background, like error lens
diagnostic_virtual_text_background = true,
}
end
},
{
"simrat39/symbols-outline.nvim",
config = function()
require('symbols-outline').setup {
width = 15
}
end
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
init = function() vim.g.mkdp_filetypes = { "markdown" } end,
ft = { "markdown" },
},
{
"folke/todo-comments.nvim",
event = "BufRead",
config = function()
require("todo-comments").setup {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
keywords = {
FIX = {
icon = " ", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
},
TODO = { icon = " ", color = "info" },
HACK = { icon = " ", color = "warning" },
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*]], -- pattern or table of patterns, used for highlightng (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
pattern = [[\b(KEYWORDS)]], -- ripgrep regex
},
}
end,
},
{
'NvChad/nvim-colorizer.lua',
config = function()
local colorizer = require("colorizer")
colorizer.setup {
filetypes = { "*" },
user_default_options = { mode = "background", },
}
end
},
--{
-- "akinsho/flutter-tools.nvim",
-- dependencies = { "nvim-lua/plenary.nvim", "stevearc/dressing.nvim" },
-- config = function()
-- require('flutter-tools').setup {
-- -- flutter_path = "~/development/flutter",
-- fvm = true, -- takes priority over path, uses <workspace>/.fvm/flutter_sdk if enabled
-- ui = {
-- -- the border type to use for all floating windows, the same options/formats
-- -- used for ":h nvim_open_win" e.g. "single" | "shadow" | {<table-of-eight-chars>}
-- border = "rounded",
-- -- This determines whether notifications are show with `vim.notify` or with the plugin's custom UI
-- -- please note that this option is eventually going to be deprecated and users will need to
-- -- depend on plugins like `nvim-notify` instead.
-- notification_style = "plugin",
-- },
-- decorations = {
-- statusline = {
-- -- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline
-- -- this will show the current version of the flutter app from the pubspec.yaml file
-- app_version = true,
-- -- set to true to be able use the 'flutter_tools_decorations.device' in your statusline
-- -- this will show the currently running device if an application was started with a specific
-- -- device
-- device = true,
-- },
-- },
-- outline = {
-- open_cmd = "30vnew", -- command to use to open the outline buffer
-- auto_open = false, -- if true this will open the outline automatically when it is first populated
-- },
-- debugger = {
-- enabled = true,
-- run_via_dap = true,
-- register_configurations = function(_)
-- local dap = require("dap")
-- -- dap.adapters.dart = {
-- -- type = "executable",
-- -- command = "node",
-- -- args = { debugger_path, "flutter" },
-- -- }
-- dap.set_log_level("TRACE")
-- dap.configurations.dart = {}
-- require("dap.ext.vscode").load_launchjs()
-- end,
-- },
-- dev_log = {
-- enabled = false,
-- -- open_cmd = "tabedit", -- command to use to open the log buffer
-- },
-- lsp = {
-- color = { -- show the derived colours for dart variables
-- enabled = true, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
-- background = false, -- highlight the background
-- foreground = false, -- highlight the foreground
-- virtual_text = true, -- show the highlight using virtual text
-- virtual_text_str = "■", -- the virtual text character to highlight
-- },
-- settings = {
-- showTodos = true,
-- completeFunctionCalls = true,
-- renameFilesWithClasses = "prompt", -- "always"
-- enableSnippets = true,
-- enableSdkFormatter = true,
-- },
-- },
-- }
-- end
--},
"ChristianChiarulli/swenv.nvim",
"stevearc/dressing.nvim",
"mfussenegger/nvim-dap-python",
"nvim-neotest/neotest",
"nvim-neotest/neotest-python",
"mxsdev/nvim-dap-vscode-js",
{ "microsoft/vscode-js-debug", build = "npm install && npx gulp vsDebugServerBundle && mv dist out" }
}
-- autocomplete
-- -- copilot cmp
local ok, copilot = pcall(require, "copilot")
if not ok then
return
end
copilot.setup {
suggestion = {
keymap = {
accept = "<c-l>",
next = "<c-j>",
prev = "<c-k>",
dismiss = "<c-h>",
},
},
}
local copilot_opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "<c-s>", "<cmd>lua require('copilot.suggestion').toggle_auto_trigger()<CR>", copilot_opts)
-- lsp
-- dap
-- python
local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/")
pcall(function()
require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python")
end)
-- go
local dap = require("dap")
dap.adapters.go = function(callback, _)
local stdout = vim.loop.new_pipe(false)
local handle
local pid_or_err
local port = 38697
local opts = {
stdio = { nil, stdout },
args = { "dap", "-l", "127.0.0.1:" .. port },
detached = true,
}
handle, pid_or_err = vim.loop.spawn("dlv", opts, function(code)
stdout:close()
handle:close()
if code ~= 0 then
print("dlv exited with code", code)
end
end)
assert(handle, "Error running dlv: " .. tostring(pid_or_err))
stdout:read_start(function(err, chunk)
assert(not err, err)
if chunk then
vim.schedule(function()
require("dap.repl").append(chunk)
end)
end
end)
-- Wait for delve to start
vim.defer_fn(function()
callback { type = "server", host = "127.0.0.1", port = port }
end, 100)
end
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
dap.configurations.go = {
{
type = "go",
name = "Debug",
request = "launch",
program = "${file}",
},
{
type = "go",
name = "Debug test", -- configuration for debugging test files
request = "launch",
mode = "test",
program = "${file}",
},
-- works with go.mod packages and sub packages
{
type = "go",
name = "Debug test (go.mod)",
request = "launch",
mode = "test",
program = "./${relativeFileDirname}",
},
}
-- js
require("dap-vscode-js").setup({
debugger_path = (os.getenv("HOME") .. "/.local/share/lunarvim/site/pack/lazy/opt/vscode-js-debug"),
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost', 'node', 'firefox' },
})
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require 'dap.utils'.pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with \"localhost\"",
url = "http://localhost:5173",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-firefox-debug-userdatadir"
}
}
end
-- node
-- dap.adapters.node2 = {
-- type = 'executable',
-- command = 'node',
-- args = { mason_path .. 'packages/node-debug2-adapter/out/src/nodeDebug.js' },
-- }
-- dap.configurations.javascript = {
-- {
-- name = 'Launch',
-- type = 'node2',
-- request = 'launch',
-- program = '${file}',
-- cwd = vim.fn.getcwd(),
-- sourceMaps = true,
-- protocol = 'inspector',
-- console = 'integratedTerminal',
-- },
-- {
-- -- For this to work you need to make sure the node process is started with the `--inspect` flag.
-- name = 'Attach to process',
-- type = 'node2',
-- request = 'attach',
-- processId = require 'dap.utils'.pick_process,
-- },
-- }
-- formatters
local formatters = require "lvim.lsp.null-ls.formatters"
formatters.setup {
{
command = 'prettier',
filetypes = {
"typescript", "javascript", "typescriptreact", "javascriptreact", "html", "vue", "json"
}
}
}
-- linter
local linters = require "lvim.lsp.null-ls.linters"
linters.setup {
{
command = 'eslint',
filetypes = {
"typescript", "javascript", "typescriptreact", "javascriptreact"
}
}
}
-- Flutter .arb files should be concidered as json files
-- vim.filetype.add {
-- extension = {
-- arb = 'json',
-- }
-- }