04-01-2026

This commit is contained in:
2026-01-04 22:29:08 +04:00
parent 9572c0d939
commit 6b1f963f4f
34 changed files with 1201 additions and 550 deletions

View File

@@ -0,0 +1 @@
return {}

View File

@@ -1,72 +1,159 @@
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"L3MON4D3/LuaSnip",
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local luasnip = require("luasnip")
local cmp = require("cmp")
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
require("luasnip.loaders.from_vscode").lazy_load()
"hrsh7th/cmp-nvim-lsp",
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
"L3MON4D3/LuaSnip",
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local luasnip = require("luasnip")
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump()
elseif has_words_before() then cmp.complete()
else fallback() end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then cmp.select_prev_item()
elseif luasnip.jumpable(-1) then luasnip.jump(-1)
else fallback() end
end, { "i", "s" }),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
})
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources(
{{ name = 'git' }},
{{ name = 'buffer' }}
)
})
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {{ name = 'buffer' }}
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources(
{{ name = 'path' }},
{{ name = 'cmdline' }}
)
})
end,
},
require("luasnip.loaders.from_vscode").lazy_load()
local has_words_before = function()
if vim.api.nvim_get_mode().mode == "c" then
return true
end
local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("%S")
end
cmp.setup({
-- Производительность
performance = {
debounce = 60,
throttle = 30,
fetching_timeout = 200,
async_budget = 1,
max_view_entries = 10,
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
-- Сортировка источников по приоритету
sources = cmp.config.sources({
{ name = "nvim_lsp", priority = 1000, keyword_length = 2 },
{ name = "luasnip", priority = 900, keyword_length = 1 },
{ name = "buffer", priority = 500, keyword_length = 3 },
{ name = "path", priority = 250, keyword_length = 1 },
}),
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({
select = true,
behavior = cmp.ConfirmBehavior.Replace,
}),
},
-- Форматирование
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Иконки
local icons = {
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "",
}
vim_item.kind = string.format("%s %s", icons[vim_item.kind] or "?", vim_item.kind)
local source_name = entry.source.name
local menu_map = {
nvim_lsp = "[LSP]",
luasnip = "[Snip]",
buffer = "[Buf]",
path = "[Path]",
nvim_lua = "[Lua]",
cmdline = "[Cmd]",
}
vim_item.menu = menu_map[source_name] or ("[" .. source_name .. "]")
-- Укорочение длинных имен
local label = vim_item.abbr
local truncated_label = vim.fn.strcharpart(label, 0, 50)
if truncated_label ~= label then
vim_item.abbr = truncated_label .. ""
end
return vim_item
end,
},
-- Экспериментальные фичи
experimental = {
ghost_text = {
hl_group = "Comment", -- призрачный текст
},
},
})
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({ { name = "git" } }, { { name = "buffer" } }),
})
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = { { name = "buffer" } },
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }),
})
end,
},
}

View File

@@ -1,14 +0,0 @@
return {
{
"j-morano/buffer_manager.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {},
keys = {
{ "<LEADER>b", function() require("buffer_manager.ui").toggle_quick_menu() end },
{ "<S-h>", function() require("buffer_manager.ui").nav_prev() end },
{ "<S-l>", function() require("buffer_manager.ui").nav_next() end }
}
}
}

View File

@@ -1,6 +1,6 @@
return {
-- Подсветка цвета (не только в css)
{
"ap/vim-css-color"
}
-- Подсветка цвета (не только в css)
{
"ap/vim-css-color",
},
}

View File

@@ -1,61 +1,154 @@
return {
-- {
-- -- Загрука темы из pywal
-- "dylanaraps/wal.vim",
-- config = function()
-- vim.cmd([[colorscheme wal]])
-- end,
-- }
-- {
-- -- Загрука темы из pywal
-- "dylanaraps/wal.vim",
-- config = function()
-- vim.cmd([[colorscheme wal]])
-- end,
-- }
{
-- Отличная тема, но слишком яркий фон
"ellisonleao/gruvbox.nvim",
lazy = false,
priority = 1000,
config = function()
vim.o.background = "dark"
vim.cmd([[colorscheme gruvbox]])
end
}
{
-- Отличная тема, но слишком яркий фон
"ellisonleao/gruvbox.nvim",
lazy = false,
priority = 1000,
config = function()
vim.o.background = "dark"
-- vim.cmd([[colorscheme gruvbox]])
require("gruvbox").setup({
-- Основные настройки контраста
contrast = "hard", -- "hard", "medium", "soft"
-- {
-- "RRethy/nvim-base16",
-- config = function()
-- vim.cmd([[colorscheme base16-gruvbox-dark-hard]])
-- end
-- }
-- Тёмная версия
terminal_colors = true,
-- {
-- "nanotech/jellybeans.vim",
-- lazy = false,
-- priority = 1000,
-- config = function()
-- vim.cmd([[colorscheme jellybeans]])
-- end
-- }
-- Настройки яркости
undercurl = true,
underline = true,
bold = true,
italic = {
strings = false,
comments = false,
operators = false,
folds = false,
},
-- {
-- "junegunn/seoul256.vim",
-- config = function()
-- vim.g.seoul256_background = 233
-- vim.cmd([[colorscheme seoul256]])
-- end
-- }
-- Цветовые настройки
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
-- {
-- "Mofiqul/vscode.nvim",
-- config = function()
-- require("vscode").load("dark")
-- end
-- }
-- Более тёмные цвета
palette_overrides = {
dark0_hard = "#0d0e0f", -- самый тёмный фон
dark0 = "#1d2021", -- стандартный фон
dark1 = "#282828",
dark2 = "#32302f",
dark3 = "#3c3836",
dark4 = "#504945",
-- {
-- "sainnhe/everforest",
-- config = function()
-- vim.g.everforest_background = "hard"
-- vim.o.background = "dark"
-- -- require("everforest")
-- vim.cmd([[colorscheme everforest]])
-- end
-- }
-- Более насыщенные цвета
bright_red = "#fb4934",
bright_green = "#b8bb26",
bright_yellow = "#fabd2f",
bright_blue = "#83a598",
bright_purple = "#d3869b",
bright_aqua = "#8ec07c",
bright_orange = "#fe8019",
},
-- Контрастные настройки
overrides = {
-- Пример: сделать выделение контрастнее
Visual = { bg = "#3c3836", fg = "#ebdbb2" },
Search = { bg = "#fe8019", fg = "#282828" },
IncSearch = { bg = "#fb4934", fg = "#282828" },
-- Контрастные границы
FloatBorder = { fg = "#ebdbb2" },
-- Более тёмный LineNr
LineNr = { fg = "#7c6f64" },
CursorLineNr = { fg = "#d5c4a1", bold = true },
},
})
-- Дополнительные Vim команды для увеличения контраста
vim.cmd([[
colorscheme gruvbox
" Дополнительные настройки контраста
highlight Normal guibg=#0d0e0f
highlight NormalNC guibg=#0d0e0f
highlight SignColumn guibg=#0d0e0f
highlight EndOfBuffer guifg=#0d0e0f
" Более контрастные комментарии
highlight Comment guifg=#928374
" Контрастные номера строк
highlight LineNr guifg=#7c6f64 guibg=#0d0e0f
highlight CursorLineNr guifg=#ebdbb2 guibg=#0d0e0f
" Контрастный скроллбар
highlight Pmenu guibg=#1d2021
highlight PmenuSel guibg=#504945
" Более тёмные границы
highlight WinSeparator guifg=#504945
]])
end,
},
-- {
-- "morhetz/gruvbox",
-- priority = 1000,
-- init = function()
-- vim.g.gruvbox_contrast_dark = "hard"
-- vim.g.gruvbox_background = "hard"
-- vim.cmd("colorscheme gruvbox")
-- end,
-- },
-- {
-- "RRethy/nvim-base16",
-- config = function()
-- vim.cmd([[colorscheme base16-gruvbox-dark-hard]])
-- end,
-- },
-- {
-- "nanotech/jellybeans.vim",
-- lazy = false,
-- priority = 1000,
-- config = function()
-- vim.cmd([[colorscheme jellybeans]])
-- end,
-- },
-- {
-- "junegunn/seoul256.vim",
-- config = function()
-- vim.g.seoul256_background = 233
-- vim.cmd([[colorscheme seoul256]])
-- end
-- }
-- {
-- "Mofiqul/vscode.nvim",
-- config = function()
-- require("vscode").load("dark")
-- end,
-- },
-- {
-- "sainnhe/everforest",
-- config = function()
-- vim.g.everforest_background = "hard"
-- vim.o.background = "dark"
-- -- require("everforest")
-- vim.cmd([[colorscheme everforest]])
-- end,
-- },
}

View File

@@ -1,8 +1,17 @@
return {
-- Быстрое комментирование
-- gcc - закоментировать строку
-- (VISUAL) gc - закоментировать выделенные строки
{
"tpope/vim-commentary"
}
-- Быстрое комментирование
-- gcc - закоментировать строку
-- (VISUAL) gc - закоментировать выделенные строки
-- {
-- "tpope/vim-commentary",
-- },
{
"numToStr/Comment.nvim",
},
-- gcc - toggle current line
-- gbc - toggle current block
-- [count]gcc | [count]gbc
-- gc[count]{motion} | gb[count]{motion}
-- VISUAL: gc | gb
}

View File

@@ -1,42 +1,65 @@
return {
-- Поддержка git
{
"lewis6991/gitsigns.nvim",
config = function()
require('gitsigns').setup()
-- Поддержка git
{
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
},
},
config = function(_, opts)
require("gitsigns").setup(opts)
local function map(mode, l, r, opts)
opts = opts or { noremap = true, silent = true }
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
local function map(mode, l, r, opts)
opts = opts or { noremap = true, silent = true }
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
local gs = package.loaded.gitsigns
local gs = package.loaded.gitsigns
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, {expr=true})
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, {expr=true})
map("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
map("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
map('n', '<leader>gs', gs.stage_hunk)
map('n', '<leader>gr', gs.reset_hunk)
map('v', '<leader>gs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('v', '<leader>gr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('n', '<leader>gS', gs.stage_buffer)
map('n', '<leader>gu', gs.undo_stage_hunk)
map('n', '<leader>gR', gs.reset_buffer)
map('n', '<leader>gp', gs.preview_hunk)
map('n', '<leader>gb', function() gs.blame_line{full=true} end)
map('n', '<leader>gtb', gs.toggle_current_line_blame)
map('n', '<leader>gd', gs.diffthis)
map('n', '<leader>gD', function() gs.diffthis('~') end)
map('n', '<leader>gtd', gs.toggle_deleted)
end
}
-- map("n", "<leader>gs", gs.stage_hunk)
-- map("n", "<leader>gr", gs.reset_hunk)
-- map("v", "<leader>gs", function()
-- gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
-- end)
-- map("v", "<leader>gr", function()
-- gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
-- end)
-- map("n", "<leader>gS", gs.stage_buffer)
-- map("n", "<leader>gu", gs.undo_stage_hunk)
-- map("n", "<leader>gR", gs.reset_buffer)
-- map("n", "<leader>gp", gs.preview_hunk)
-- map("n", "<leader>gb", function()
-- gs.blame_line({ full = true })
-- end)
-- map("n", "<leader>gtb", gs.toggle_current_line_blame)
-- map("n", "<leader>gd", gs.diffthis)
-- map("n", "<leader>gD", function()
-- gs.diffthis("~")
-- end)
-- map("n", "<leader>gtd", gs.toggle_deleted)
end,
},
}

View File

@@ -0,0 +1,17 @@
return {
"lervag/vimtex",
lazy = false,
init = function()
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_compiler_method = "latexmk"
vim.g.vimtex_quickfix_mode = 0
vim.g.maplocalleader = ","
vim.api.nvim_create_autocmd("FileType", {
pattern = "tex",
callback = function()
vim.opt_local.syntax = "on" -- Использовать синтаксис VimTeX
end,
})
end,
config = function() end,
}

View File

@@ -0,0 +1,43 @@
return {
-- Прыжок в любое место по символу
{ "tpope/vim-repeat", event = "VeryLazy" },
{
"ggandor/flit.nvim",
dependencies = {
"ggandor/leap.nvim",
},
keys = function()
local ret = {}
for _, key in ipairs({ "f", "F", "t", "T" }) do
ret[#ret + 1] = { key, mode = { "n", "x", "o" } }
end
return ret
end,
opts = { labeled_modes = "nx" },
},
{
"ggandor/leap.nvim",
keys = {
{ "<Leader>j", mode = { "n", "x", "o" }, desc = "Leap forward to" },
{ "<Leader>k", mode = { "n", "x", "o" }, desc = "Leap backward to" },
{ "<Leader>J", mode = { "n", "x", "o" }, desc = "Leap from windows" },
},
config = function(_, opts)
local leap = require("leap")
for k, v in pairs(opts) do
leap.opts[k] = v
end
-- leap.add_default_mappings(true)
-- Удаляем конфликтующие маппинги, если они есть
-- vim.keymap.del({ "x", "o" }, "x")
-- vim.keymap.del({ "x", "o" }, "X")
-- Прыжок вперёд
vim.keymap.set({ "n", "x", "o" }, "<Leader>j", "<Plug>(leap-forward)")
-- Прыжок назад
vim.keymap.set({ "n", "x", "o" }, "<Leader>k", "<Plug>(leap-backward)")
-- Прыжок между окнами
vim.keymap.set({ "n", "x", "o" }, "<Leader>J", "<Plug>(leap-from-window)")
end,
},
}

View File

@@ -1,125 +1,235 @@
return {
{
"williamboman/mason.nvim",
dependencies = {
"mason-org/mason-registry",
},
opts = {}
},
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
},
keys = {
{ "<LEADER>lh", vim.lsp.buf.hover },
{ "<LEADER>lr", vim.lsp.buf.rename },
{ "<LEADER>lf", function()
vim.lsp.buf.format({
async = true,
bufnr = bufnr,
filter = function(client)
return client.name == "null-ls"
end
})
end
},
{ "<LEADER>lgr", vim.lsp.buf.references },
{ "<LEADER>lgi", vim.lsp.buf.implementation },
{ "<LEADER>lsh", vim.lsp.buf.signature_help },
{
"mason-org/mason.nvim",
opts = {},
dependencies = {
"mason-org/mason-registry",
},
},
{
"mason-org/mason-lspconfig.nvim",
opts = {
automatic_installation = true,
automatic_enable = true,
ensure_installed = {
"bashls",
"lua_ls",
{ "<LEADER>ldj", vim.diagnostic.goto_next },
{ "<LEADER>ldk", vim.diagnostic.goto_prev },
"vtsls", -- ts_ls + vue support
"html",
"cssls",
"jsonls",
{ "<LEADER>lgd", vim.lsp.buf.definition },
{ "<LEADER>lgtd", vim.lsp.buf.type_definition },
"pyright",
{ "<LEADER>law", vim.lsp.buf.add_workspace_folder },
{ "<LEADER>ldw", vim.lsp.buf.remove_workspace_folder },
{ "<LEADER>llw", function()
print(vim.inspect(vim.lsp.buf.list_workplace_folders()))
end },
"yamlls",
},
},
dependencies = {
"mason-org/mason.nvim",
},
},
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/nvim-cmp",
"j-hui/fidget.nvim",
"folke/trouble.nvim",
},
keys = {
{ "<LEADER>l", desc = "LSP Features" },
{ "<LEADER>lh", vim.lsp.buf.hover, desc = "Get info from LSP" },
{ "<LEADER>lr", vim.lsp.buf.rename, desc = "Rename" },
{
"<LEADER>lf",
function()
vim.lsp.buf.format({
async = true,
-- bufnr = bufnr,
filter = function(client)
return client.name == "null-ls"
end,
})
end,
desc = "Format code",
},
{ "<LEADER>lgr", vim.lsp.buf.references, desc = "Open references" },
{ "<LEADER>lgi", vim.lsp.buf.implementation, desc = "Open implementation" },
{ "<LEADER>lsh", vim.lsp.buf.signature_help, desc = "Optn signature help" },
{ "<LEADER>lca", vim.lsp.buf.code_action },
},
config = function()
local lspconfig = require("lspconfig")
local mason_lspconfig = require("mason-lspconfig")
{ "<LEADER>ldj", vim.diagnostic.goto_next, desc = "Go to next problem" },
{
"<LEADER>ldk",
vim.diagnostic.goto_prev,
desc = "Go to previous problem",
},
local LSP_SERVERS = {
"tsserver",
"html",
"cssls",
"tailwindcss",
"pyright"
}
{ "<LEADER>lgd", vim.lsp.buf.definition, desc = "Open definition" },
{ "<LEADER>lgt", vim.lsp.buf.type_definition, desc = "Open type definition" },
mason_lspconfig.setup({
ensure_installed = LSP_SERVERS,
automatic_installation = true,
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
for _, server in pairs(LSP_SERVERS) do
lspconfig[server].setup(
{
capabilities = capabilities,
on_attach = on_attach,
}
)
end
end,
},
{
"nvimtools/none-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"nvim-lua/plenary.nvim",
"williamboman/mason-null-ls.nvim",
},
config = function()
local null_ls = require("null-ls")
null_ls.setup({
source = {
-- null_ls.builtins.diagnostics.eslint_d,
-- null_ls.builtins.code_actions.eslint_d,
null_ls.builtins.diagnostics.stylelint,
null_ls.builtins.formatting.prettier,
null_ls.builtins.code_actions.gitsigns,
null_ls.builtins.formatting.autopep8,
null_ls.builtins.diagnostics.pycodestyle,
null_ls.builtins.diagnostics.pydocstyle,
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormatting", {}),
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
async = false,
bufnr = bufnr,
filter = function(client)
return client.name == "null-ls"
end
})
end,
})
end
end,
})
require("mason-null-ls").setup({
ensure_installed = nil,
automatic_installation = true,
handlers = {}
})
end
},
{
"j-hui/fidget.nvim",
opts = {}
},
{
"<LEADER>law",
vim.lsp.buf.add_workspace_folder,
desc = "Add folder to workspace",
},
{
"<LEADER>ldw",
vim.lsp.buf.remove_workspace_folder,
desc = "Remove folder from workspace",
},
{
"<LEADER>llw",
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end,
desc = "List workspace folders",
},
{
"<LEADER>lca",
vim.lsp.buf.code_action,
desc = "Open code actions",
},
},
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local on_attach = function(client, bufnr)
vim.notify(client.name .. " attached", vim.log.levels.INFO)
end
vim.lsp.config("*", {
capabilities = capabilities,
on_attach = on_attach,
})
vim.lsp.config("vtsls", {
settings = {
vtsls = {
tsserver = {
globalPlugins = {
{
name = "@vue/typescript-plugin",
location = vim.fn.stdpath("data")
.. "/mason/packages/vue-language-server/node_modules/@vue/language-server",
languages = { "vue" },
configNamespace = "typescript",
},
},
},
},
},
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
})
vim.lsp.config("clangd", {
capabilities = capabilities,
on_attach = on_attach,
settings = {
clangd = {
fallbackFlags = {
"--std=c++23",
"-Wall",
"-Wextra",
"-Wpedantic",
},
},
},
filetypes = { "c", "cpp", "objc", "objcpp", "tpp" },
})
end,
},
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
},
opts = {
ensure_installed = {
"prettierd",
"eslint_d",
"stylua",
"shfmt",
"shellcheck",
"autopep8",
"black",
"isort",
},
automatic_installation = true,
handlers = {},
},
},
{
"nvimtools/none-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "williamboman/mason.nvim" },
config = function()
local null_ls = require("null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
source = {},
on_attach = function(client, bufnr)
local sources = null_ls.get_sources()
local source_names = {}
for _, source in ipairs(sources) do
if source.filetypes then
for ft, _ in pairs(source.filetypes) do
if ft == vim.bo[bufnr].filetype then
table.insert(source_names, source.name)
end
end
end
end
local message = "NullLS attached"
if #source_names > 0 then
message = message .. " with sources: " .. table.concat(source_names, ", ")
else
message = message .. " (no sources for this filetype)"
end
vim.notify(message, vim.log.levels.INFO)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
async = false,
filter = function(format_client)
return format_client.name == "null-ls"
end,
})
end,
})
end
end,
})
end,
},
{
"j-hui/fidget.nvim",
opts = {
notification = {
window = {
max_width = 60,
max_height = 5,
winblend = 0,
},
filter = vim.log.levels.DEBUG,
},
},
config = function(_, opts)
local fidget = require("fidget")
fidget.setup(opts)
vim.notify = fidget.notify
end,
},
}

View File

@@ -0,0 +1,14 @@
return {
-- {
-- "MeanderingProgrammer/render-markdown.nvim",
-- dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
-- ---@module 'render-markdown'
-- ---@type render.md.UserConfig
-- opts = {},
-- },
{
"nvim-treesitter/nvim-treesitter",
dependencies = { "OXY2DEV/markview.nvim" },
lazy = false,
},
}

View File

@@ -1,16 +1,15 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
keys = {
{ "<LEADER>f", "<CMD>:Neotree toggle<CR>" }
},
}
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
keys = {
{ "<LEADER>f", "<CMD>:Neotree toggle<CR>", desc = "Toggle NeoTree" },
},
},
}

View File

@@ -1,6 +1,6 @@
return {
-- Поддержка русского языка в командном режиме
{
"powerman/vim-plugin-ruscmd"
}
-- Поддержка русского языка в командном режиме
-- {
-- "powerman/vim-plugin-ruscmd",
-- },
}

View File

@@ -1,14 +1,14 @@
return {
-- Строка состояния
-- (можно конфигурировать, пока не разобрался)
-- {
-- "itchyny/lightline.vim"
-- }
-- Строка состояния
-- (можно конфигурировать, пока не разобрался)
-- {
-- "itchyny/lightline.vim"
-- }
-- Лучше выглядит и кастомизируется
{
"nvim-lualine/lualine.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {}
}
-- Лучше выглядит и кастомизируется
{
"nvim-lualine/lualine.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {},
},
}

View File

@@ -1,20 +1,18 @@
return {
{
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup()
end
{
"kylechui/nvim-surround",
event = "VeryLazy",
-- insert = "<C-g>s",
-- insert_line = "<C-g>S",
-- normal = "ys",
-- normal_cur = "yss",
-- normal_line = "yS",
-- normal_cur_line = "ySS",
-- visual = "S",
-- visual_line = "gS",
-- delete = "ds",
-- change = "cs",
-- change_line = "cS",
},
-- insert = "<C-g>s",
-- insert_line = "<C-g>S",
-- normal = "ys",
-- normal_cur = "yss",
-- normal_line = "yS",
-- normal_cur_line = "ySS",
-- visual = "S",
-- visual_line = "gS",
-- delete = "ds",
-- change = "cs",
-- change_line = "cS",
},
}

View File

@@ -1,48 +1,56 @@
return {
{
-- Диалоговое окно поиска
"nvim-telescope/telescope.nvim", tag = "0.1.5",
-- event = { "BufReadPre", "BufNewFile" },
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-ui-select.nvim",
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-symbols.nvim"
},
keys = {
{ "<LEADER>tff", "<CMD>Telescope find_files<CR>" },
{ "<LEADER>tg", "<CMD>Telescope live_grep<CR>" },
{ "<LEADER>tb", "<CMD>Telescope buffers<CR>" },
{ "<LEADER>th", "<CMD>Telescope help_tags<CR>" },
{
-- Диалоговое окно поиска
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
-- event = { "BufReadPre", "BufNewFile" },
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-ui-select.nvim",
"nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-symbols.nvim",
},
keys = {
{ "<LEADER>tf", "<CMD>Telescope find_files<CR>" },
{ "<LEADER>tg", "<CMD>Telescope live_grep<CR>" },
{ "<LEADER>tb", "<CMD>Telescope buffers<CR>" },
{ "<LEADER>tfb", "<CMD>Telescope file_browser<CR>" },
{ "<LEADER>tfb", "<CMD>Telescope file_browser<CR>" },
{ "<LEADER>ts", "<CMD>Telescope symbols<CR>" }
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({})
},
["file_browser"] = {
theme = "ivy",
},
["symbols"] = {}
},
pickers = {
buffers = {
mappings = {
i = { ["<C-d>"] = actions.delete_buffer + actions.move_to_top },
n = { ["<C-d>"] = actions.delete_buffer + actions.move_to_top }
}
}
}
})
{ "<LEADER>gc", "<CMD>Telescope git_bcommits<CR>" },
{ "<LEADER>gb", "<CMD>Telescope git_branches<CR>" },
{ "<LEADER>gs", "<CMD>Telescope git_branches<CR>" },
telescope.load_extension("file_browser")
telescope.load_extension("ui-select")
end,
}
{ "<LEADER>ts", "<CMD>Telescope symbols<CR>" },
{ "<LEADER>th", "<CMD>Telescope help_tags<CR>" },
-- { "<LEADER>tn", "<CMD>Telescope fidget<CR>" },
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
["file_browser"] = {
theme = "ivy",
},
["symbols"] = {},
},
pickers = {
buffers = {
mappings = {
i = { ["<C-d>"] = actions.delete_buffer + actions.move_to_top },
n = { ["<C-d>"] = actions.delete_buffer + actions.move_to_top },
},
},
},
})
telescope.load_extension("file_browser")
telescope.load_extension("ui-select")
telescope.load_extension("fidget")
end,
},
}

View File

@@ -1,18 +1,17 @@
return {
{
"akinsho/toggleterm.nvim",
version = "*",
config = true,
keys = {
{ "<LEADER>T", "<CMD>ToggleTerm<CR>" },
{ "<LEADER>Tf", "<CMD>ToggleTerm direction=float<CR>" },
{ "<LEADER>Th", "<CMD>ToggleTerm direction=horizontal<CR>" },
{ "<LEADER>Tv", "<CMD>ToggleTerm direction=vertical<CR>" },
{ "<ESC>", [[<C-\><C-n>]], mode = "t" },
{ "<C-T>", "<CMD>ToggleTerm<CR>", mode = "t" },
{ "<C-d>", false, mode = "t" },
{ "<C-T>c", [[<C-\><C-n><CMD>:bd!<CR>]], mode = "t" }
}
}
{
"akinsho/toggleterm.nvim",
version = "*",
config = true,
keys = {
{ "<LEADER>T", "<CMD>ToggleTerm<CR>" },
{ "<LEADER>Tf", "<CMD>ToggleTerm direction=float<CR>" },
{ "<LEADER>Th", "<CMD>ToggleTerm direction=horizontal<CR>" },
{ "<LEADER>Tv", "<CMD>ToggleTerm direction=vertical<CR>" },
{ "<ESC>", [[<C-\><C-n>]], mode = "t" },
{ "<C-T>", "<CMD>ToggleTerm<CR>", mode = "t" },
{ "<C-d>", false, mode = "t" },
{ "<C-T>c", [[<C-\><C-n><CMD>:bd!<CR>]], mode = "t" },
},
},
}

View File

@@ -1,16 +1,16 @@
return {
{
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim"
},
opts = {},
config = function()
require("todo-comments").setup()
end,
keys = {
{ "<LEADER>Ct", "<CMD>TroubleToggle todo<CR>" }
}
}
{
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
},
opts = {},
config = function()
require("todo-comments").setup()
end,
keys = {
{ "<LEADER>Ct", "<CMD>TroubleToggle todo<CR>" },
},
},
}

View File

@@ -1,31 +1,37 @@
return {
{
-- Подсветка синтаксиса
"nvim-treesitter/nvim-treesitter",
dependencies = {
"windwp/nvim-ts-autotag",
},
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = {
"html", "markdown", "latex",
"css", "scss", -- "less", not found
"javascript", -- "jsx", not found
"typescript", "tsx",
"python", "lua",
"vim", "vimdoc", "query",
"bash",
"c",
"json", "yaml",
},
sync_install = false,
highlight = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true },
autotag = { enable = true }
})
end
}
{
-- Подсветка синтаксиса
"nvim-treesitter/nvim-treesitter",
dependencies = {
"windwp/nvim-ts-autotag",
"m4xshen/autoclose.nvim",
},
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
auto_install = true,
sync_install = false,
highlight = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true },
-- autotag = { enable = true }
disable = { "tex", "latex" },
})
require("nvim-ts-autotag").setup({
-- Опциональные настройки
enable_close = true,
enable_rename = true,
enable_close_on_slash = false,
})
require("autoclose").setup()
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*.tpp",
callback = function()
vim.bo.filetype = "cpp"
end,
})
end,
},
}

View File

@@ -1,7 +1,7 @@
return {
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "<LEADER>tt", "<CMD>TroubleToggle<CR>" },
{ "<LEADER>tc", "<CMD>TroubleClose<CR>" },
@@ -15,6 +15,6 @@ return {
{ "<LEADER>tlr", "<CMD>TroubleToggle lsp_references<CR>" },
{ "<LEADER>tld", "<CMD>TroubleToggle lsp_definitions<CR>" },
{ "<LEADER>tltd", "<CMD>TroubleToggle lsp_type_definitions<CR>" },
}
}
},
},
}

View File

@@ -0,0 +1,9 @@
return {
{
"folke/which-key.nvim",
event = "VeryLazy",
ignore = {
pattern = { "^.*[А-Яа-я].*$" },
},
},
}