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
|
-- Plugin declarations
-- All plugins used in Neovim are defined here
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Initialize lazy.nvim with plugins
require("lazy").setup({
------------------------------------------------------------
-- UI
------------------------------------------------------------
-- Colorscheme
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("tokyonight-night")
end,
},
-- File browser
{
'stevearc/oil.nvim',
dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = "Oil",
},
-- Terminal
{
'akinsho/toggleterm.nvim',
version = "*",
cmd = {"ToggleTerm", "ToggleTermSendCurrentLine", "ToggleTermSendVisualLines"},
},
------------------------------------------------------------
-- EDITOR ENHANCEMENTS
------------------------------------------------------------
-- Telescope (fuzzy finder)
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
cmd = "Telescope",
},
-- Harpoon (quick file navigation)
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
},
-- Git integration
{
'tpope/vim-fugitive',
cmd = {"Git", "Gstatus", "Gblame", "Gdiffsplit", "Gread", "Gwrite", "Ggrep", "GMove", "GDelete"},
},
-- Undo history visualization
{
'mbbill/undotree',
cmd = "UndotreeToggle",
},
------------------------------------------------------------
-- CODE EDITING
------------------------------------------------------------
-- Syntax highlighting
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
event = { "BufReadPost", "BufNewFile" },
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
dependencies = {
'nvim-treesitter/nvim-treesitter-context',
},
},
-- Comments
{
'numToStr/Comment.nvim',
event = { "BufReadPost", "BufNewFile" },
},
-- Auto brackets
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true,
},
-- LaTeX support
{
"lervag/vimtex",
ft = {"tex", "latex"},
init = function()
vim.g.vimtex_view_method = "mupdf"
end
},
------------------------------------------------------------
-- LSP & COMPLETION
------------------------------------------------------------
-- LSP Base
{
"mason-org/mason.nvim",
"mason-org/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
},
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
-- Autocompletion
{
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = { 'rafamadriz/friendly-snippets' },
version = '1.*',
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = 'default' },
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = 'mono'
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = true} },
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
-- add lazydev to your completion providers
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
},
},
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" }
},
opts_extend = { "sources.default" }
},
}, {
-- Lazy.nvim options
install = { colorscheme = { "tokyonight-night" } },
checker = { enabled = true, frequency = 86400 }, -- Check for updates once per day
change_detection = { notify = false },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
|