-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.lua
142 lines (132 loc) · 3.88 KB
/
config.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
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
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
lvim.plugins = {
-- neo-scroll
-- {
-- "karb94/neoscroll.nvim",
-- event = "WinScrolled",
-- config = function()
-- require("neoscroll").setup()
-- end,
-- },
{
"nacro90/numb.nvim",
event = "BufRead",
config = function()
require("numb").setup {
show_numbers = true, -- Enable 'number' for the window while peeking
show_cursorline = true, -- Enable 'cursorline' for the window while peeking
}
end,
},
-- {
-- 'wfxr/minimap.vim',
-- build = "cargo install --locked code-minimap",
-- -- cmd = {"Minimap", "MinimapClose", "MinimapToggle", "MinimapRefresh", "MinimapUpdateHighlight"},
-- config = function()
-- vim.cmd("let g:minimap_width = 10")
-- vim.cmd("let g:minimap_auto_start = 1")
-- vim.cmd("let g:minimap_auto_start_win_enter = 1")
-- end,
-- },
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
lazy = true,
config = function()
require("persistence").setup {
dir = vim.fn.expand(vim.fn.stdpath "config" .. "/session/"),
options = { "buffers", "curdir", "tabpages", "winsize" },
}
end,
},
-- trouble
{
"folke/trouble.nvim",
cmd = "TroubleToggle",
},
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
},
-- multiple cursors
{
"mg979/vim-visual-multi",
branch = "master",
},
{
"zbirenbaum/copilot-cmp",
after = { "copilot.lua" },
config = function()
require("copilot_cmp").setup()
end,
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
{
"mrjones2014/nvim-ts-rainbow",
},
-- lightspeed
{
"ggandor/lightspeed.nvim",
event = "BufRead",
},
}
local ok, copilot = pcall(require, "copilot")
if not ok then
return
end
copilot.setup {
suggestion = {
toggle_auto_trigger = true,
keymap = {
accept = "<c-l>",
next = "<c-j>",
prev = "<c-k>",
dismiss = "<c-h>",
},
},
}
-- set trouble keymap
lvim.builtin.which_key.mappings["t"] = {
name = "Trouble",
r = { "<cmd>Trouble lsp_references<cr>", "References" },
f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
l = { "<cmd>Trouble loclist<cr>", "LocationList" },
w = { "<cmd>Trouble workspace_diagnostics<cr>", "Diagnostics" },
}
lvim.builtin.which_key.mappings["S"] = {
name = "Session",
c = { "<cmd>lua require('persistence').load()<cr>", "Restore last session for current dir" },
l = { "<cmd>lua require('persistence').load({ last = true })<cr>", "Restore last session" },
Q = { "<cmd>lua require('persistence').stop()<cr>", "Quit without saving session" },
}
lvim.builtin.which_key.setup.plugins.presets.z = true
lvim.builtin.telescope.defaults.file_ignore_patterns = { "node_modules" }
lvim.builtin.treesitter.rainbow.enable = true
-- format on save
lvim.format_on_save = true
lvim.reload_config_on_save = true
vim.opt.wrap = true
vim.opt.relativenumber = true
-- map ctrl left and right to change buffer
lvim.keys.normal_mode["<c-Left>"] = ":bprev<CR>"
lvim.keys.normal_mode["<c-Right>"] = ":bnext<CR>"
-- map redo to U
lvim.keys.normal_mode["U"] = "<C-r>"
-- map brackets to ctrl+d and ctrl+u
lvim.keys.normal_mode["["] = "<C-u>"
lvim.keys.normal_mode["]"] = "<C-d>"