Перешел на lazy nvim, навел порядок в плагинах
This commit is contained in:
		
							parent
							
								
									91873ed81a
								
							
						
					
					
						commit
						446d2716e7
					
				
					 25 changed files with 790 additions and 469 deletions
				
			
		| 
						 | 
				
			
			@ -1,39 +1,69 @@
 | 
			
		|||
local cmp = require'cmp'
 | 
			
		||||
cmp.setup{
 | 
			
		||||
	snippet = {
 | 
			
		||||
		-- REQUIRED - you must specify a snippet engine
 | 
			
		||||
		expand = function(args)
 | 
			
		||||
			vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
 | 
			
		||||
			-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
 | 
			
		||||
			-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
 | 
			
		||||
			-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
 | 
			
		||||
			-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
 | 
			
		||||
 | 
			
		||||
			-- For `mini.snippets` users:
 | 
			
		||||
			-- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
 | 
			
		||||
			-- insert({ body = args.body }) -- Insert at cursor
 | 
			
		||||
			-- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
 | 
			
		||||
			-- require("cmp.config").set_onetime({ sources = {} })
 | 
			
		||||
		end,
 | 
			
		||||
return {
 | 
			
		||||
	"hrsh7th/nvim-cmp",
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		"hrsh7th/cmp-nvim-lsp",
 | 
			
		||||
		"hrsh7th/cmp-buffer",
 | 
			
		||||
		"hrsh7th/cmp-path",
 | 
			
		||||
		"saadparwaiz1/cmp_luasnip",
 | 
			
		||||
		{
 | 
			
		||||
			"L3MON4D3/LuaSnip",
 | 
			
		||||
			lazy = true,
 | 
			
		||||
			version = "v2.*",
 | 
			
		||||
			build = "make install_jsregexp",
 | 
			
		||||
			opts = {
 | 
			
		||||
				history = true,
 | 
			
		||||
				delete_check_events = "TextChanged",
 | 
			
		||||
			},
 | 
			
		||||
			dependencies = { "rafamadriz/friendly-snippets" },
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.snippets")
 | 
			
		||||
			end,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	window = {
 | 
			
		||||
		completion = cmp.config.window.bordered(),
 | 
			
		||||
		documentation = cmp.config.window.bordered(),
 | 
			
		||||
	},
 | 
			
		||||
	mapping = cmp.mapping.preset.insert({
 | 
			
		||||
		['<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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
 | 
			
		||||
	}),
 | 
			
		||||
	sources = cmp.config.sources({
 | 
			
		||||
		{ name = 'nvim_lsp' },
 | 
			
		||||
		{ name = 'vsnip' }, -- For vsnip users.
 | 
			
		||||
		-- { name = 'luasnip' }, -- For luasnip users.
 | 
			
		||||
		-- { name = 'ultisnips' }, -- For ultisnips users.
 | 
			
		||||
		-- { name = 'snippy' }, -- For snippy users.
 | 
			
		||||
	}, {
 | 
			
		||||
		{ name = 'buffer' },
 | 
			
		||||
	})
 | 
			
		||||
	config = function()
 | 
			
		||||
		local cmp = require("cmp")
 | 
			
		||||
		local source_mapping = {
 | 
			
		||||
			buffer = "[Buffer]",
 | 
			
		||||
			nvim_lsp = "[LSP]",
 | 
			
		||||
			nvim_lua = "[Lua]",
 | 
			
		||||
			path = "[Path]",
 | 
			
		||||
		}
 | 
			
		||||
		cmp.setup({
 | 
			
		||||
			mapping = cmp.mapping.preset.insert({
 | 
			
		||||
				["<CR>"] = cmp.mapping.confirm({ select = true }),
 | 
			
		||||
				["<Tab>"] = cmp.mapping(function(fallback)
 | 
			
		||||
					if require("luasnip").expand_or_jumpable() then
 | 
			
		||||
						require("luasnip").expand_or_jump()
 | 
			
		||||
					else
 | 
			
		||||
						fallback()
 | 
			
		||||
					end
 | 
			
		||||
				end, { "i", "s" }),
 | 
			
		||||
				["<S-Tab>"] = cmp.mapping(function(fallback)
 | 
			
		||||
					if require("luasnip").jumpable(-1) then
 | 
			
		||||
						require("luasnip").jump(-1)
 | 
			
		||||
					else
 | 
			
		||||
						fallback()
 | 
			
		||||
					end
 | 
			
		||||
				end, { "i", "s" }),
 | 
			
		||||
			}),
 | 
			
		||||
			snippet = {
 | 
			
		||||
				expand = function(args)
 | 
			
		||||
					require("luasnip").lsp_expand(args.body)
 | 
			
		||||
				end,
 | 
			
		||||
			},
 | 
			
		||||
			formatting = {
 | 
			
		||||
				format = function(entry, vim_item)
 | 
			
		||||
					vim_item.menu = source_mapping[entry.source.name] or "[Unknown]"
 | 
			
		||||
					return vim_item
 | 
			
		||||
				end,
 | 
			
		||||
			},
 | 
			
		||||
			sources = cmp.config.sources({
 | 
			
		||||
				{ name = "nvim_lsp", priority = 1000 },
 | 
			
		||||
				{ name = "luasnip", priority = 750 },
 | 
			
		||||
				{ name = "path", priority = 500 },
 | 
			
		||||
			}, {
 | 
			
		||||
				{ name = "buffer" },
 | 
			
		||||
			}),
 | 
			
		||||
		})
 | 
			
		||||
	end,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								nvim/lua/plugins/columns.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								nvim/lua/plugins/columns.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
return {
 | 
			
		||||
	"m4xshen/smartcolumn.nvim",
 | 
			
		||||
	opts = {
 | 
			
		||||
		colorcolumn = "80",
 | 
			
		||||
		disabled_filetypes = { "help", "text" },
 | 
			
		||||
		custom_colorcolumn = {},
 | 
			
		||||
		scope = "file",
 | 
			
		||||
		editorconfig = true,
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										34
									
								
								nvim/lua/plugins/conform.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								nvim/lua/plugins/conform.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,34 @@
 | 
			
		|||
return {
 | 
			
		||||
	"stevearc/conform.nvim",
 | 
			
		||||
	opts = {
 | 
			
		||||
		formatters_by_ft = {
 | 
			
		||||
			javascript = { "prettier" },
 | 
			
		||||
			typescript = { "prettier" },
 | 
			
		||||
			javascriptreact = { "prettier" },
 | 
			
		||||
			typescriptreact = { "prettier" },
 | 
			
		||||
			css = { "prettier" },
 | 
			
		||||
			html = { "prettier" },
 | 
			
		||||
			json = { "prettier" },
 | 
			
		||||
			yaml = { "prettier" },
 | 
			
		||||
			markdown = { "prettier" },
 | 
			
		||||
			graphql = { "prettier" },
 | 
			
		||||
			lua = { "stylua" },
 | 
			
		||||
			python = { "isort", "black" },
 | 
			
		||||
			go = { "gofmt" },
 | 
			
		||||
		},
 | 
			
		||||
		format_on_save = {
 | 
			
		||||
			lsp_fallback = true,
 | 
			
		||||
			async = false,
 | 
			
		||||
			timeout_ms = 500,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	keys = {
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>mp",
 | 
			
		||||
			function()
 | 
			
		||||
				require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 })
 | 
			
		||||
			end,
 | 
			
		||||
			desc = "Format file or range (in visual mode)",
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,9 +1,153 @@
 | 
			
		|||
require("dap-go").setup()
 | 
			
		||||
require("dap").adapters.go = {
 | 
			
		||||
	type = "server",
 | 
			
		||||
	port = "${port}",
 | 
			
		||||
	executable = {
 | 
			
		||||
		command = "dlv",
 | 
			
		||||
		args = { "dap", "-l", "127.0.0.1:${port}" },
 | 
			
		||||
return {
 | 
			
		||||
	"leoluz/nvim-dap-go",
 | 
			
		||||
	dependencies = { "mfussenegger/nvim-dap" },
 | 
			
		||||
	opts = true,
 | 
			
		||||
	config = function()
 | 
			
		||||
		local dap, dapui = require("dap"), require("dapui")
 | 
			
		||||
 | 
			
		||||
		dap.adapters.go = {
 | 
			
		||||
			type = "server",
 | 
			
		||||
			port = "${port}",
 | 
			
		||||
			executable = {
 | 
			
		||||
				command = "dlv",
 | 
			
		||||
				args = { "dap", "-l", "127.0.0.1:${port}" },
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
		dap.listeners.before.attach.dapui_config = function()
 | 
			
		||||
			dapui.open()
 | 
			
		||||
		end
 | 
			
		||||
		dap.listeners.before.launch.dapui_config = function()
 | 
			
		||||
			dapui.open()
 | 
			
		||||
		end
 | 
			
		||||
		dap.listeners.before.event_terminated.dapui_config = function()
 | 
			
		||||
			dapui.close()
 | 
			
		||||
		end
 | 
			
		||||
		dap.listeners.before.event_exited.dapui_config = function()
 | 
			
		||||
			dapui.close()
 | 
			
		||||
		end
 | 
			
		||||
		vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
 | 
			
		||||
		vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
 | 
			
		||||
		vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
 | 
			
		||||
 | 
			
		||||
		vim.fn.sign_define(
 | 
			
		||||
			"DapBreakpoint",
 | 
			
		||||
			{ text = "🐞", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
 | 
			
		||||
		)
 | 
			
		||||
		vim.fn.sign_define(
 | 
			
		||||
			"DapBreakpointCondition",
 | 
			
		||||
			{ text = "ﳁ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
 | 
			
		||||
		)
 | 
			
		||||
		vim.fn.sign_define(
 | 
			
		||||
			"DapBreakpointRejected",
 | 
			
		||||
			{ text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
 | 
			
		||||
		)
 | 
			
		||||
		vim.fn.sign_define(
 | 
			
		||||
			"DapLogPoint",
 | 
			
		||||
			{ text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
 | 
			
		||||
		)
 | 
			
		||||
		vim.fn.sign_define(
 | 
			
		||||
			"DapStopped",
 | 
			
		||||
			{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
 | 
			
		||||
		)
 | 
			
		||||
	end,
 | 
			
		||||
	keys = {
 | 
			
		||||
		{
 | 
			
		||||
			"<F5>",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").continue()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<F10>",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_over()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<F11>",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_into()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<F12>",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_out()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>dc",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").continue()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>so",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_over()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>si",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_into()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>st",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").step_out()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>b",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").toggle_breakpoint()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<A-b>",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").toggle_breakpoint()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>B",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").set_breakpoint()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>lp",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>dr",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").repl.open()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>dl",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap").run_last()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										75
									
								
								nvim/lua/plugins/dapui.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								nvim/lua/plugins/dapui.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,75 @@
 | 
			
		|||
return {
 | 
			
		||||
	"rcarriga/nvim-dap-ui",
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		"mfussenegger/nvim-dap",
 | 
			
		||||
		"nvim-neotest/nvim-nio",
 | 
			
		||||
	},
 | 
			
		||||
	keys = {
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>du",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dapui").toggle()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>dh",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap.ui.widgets").hover()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>dp",
 | 
			
		||||
			function()
 | 
			
		||||
				require("dap.ui.widgets").preview()
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"<Leader>ds",
 | 
			
		||||
			function()
 | 
			
		||||
				local widgets = require("dap.ui.widgets")
 | 
			
		||||
				widgets.centered_float(widgets.scopes)
 | 
			
		||||
			end,
 | 
			
		||||
			silent = true,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	opts = {
 | 
			
		||||
		icons = {
 | 
			
		||||
			expanded = "▾",
 | 
			
		||||
			collapsed = "▸",
 | 
			
		||||
		},
 | 
			
		||||
		mappings = {
 | 
			
		||||
			open = "o",
 | 
			
		||||
			remove = "d",
 | 
			
		||||
			edit = "e",
 | 
			
		||||
			repl = "r",
 | 
			
		||||
			toggle = "t",
 | 
			
		||||
		},
 | 
			
		||||
		expand_lines = vim.fn.has("nvim-0.7"),
 | 
			
		||||
		layouts = {
 | 
			
		||||
			{
 | 
			
		||||
				elements = {
 | 
			
		||||
					"repl",
 | 
			
		||||
					"breakpoints",
 | 
			
		||||
					"scopes",
 | 
			
		||||
				},
 | 
			
		||||
				size = 0.3,
 | 
			
		||||
				position = "bottom",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		floating = {
 | 
			
		||||
			max_height = nil,
 | 
			
		||||
			max_width = nil,
 | 
			
		||||
			border = "single",
 | 
			
		||||
			mappings = {
 | 
			
		||||
				close = { "q", "<Esc>" },
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		windows = { indent = 1 },
 | 
			
		||||
		render = {
 | 
			
		||||
			max_type_length = nil,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,28 +0,0 @@
 | 
			
		|||
local conform = require("conform")
 | 
			
		||||
 | 
			
		||||
conform.setup({
 | 
			
		||||
	formatters_by_ft = {
 | 
			
		||||
		javascript = { "prettier" },
 | 
			
		||||
		typescript = { "prettier" },
 | 
			
		||||
		javascriptreact = { "prettier" },
 | 
			
		||||
		typescriptreact = { "prettier" },
 | 
			
		||||
		css = { "prettier" },
 | 
			
		||||
		html = { "prettier" },
 | 
			
		||||
		json = { "prettier" },
 | 
			
		||||
		yaml = { "prettier" },
 | 
			
		||||
		markdown = { "prettier" },
 | 
			
		||||
		graphql = { "prettier" },
 | 
			
		||||
		lua = { "stylua" },
 | 
			
		||||
		python = { "isort", "black" },
 | 
			
		||||
		go = { "gofmt" },
 | 
			
		||||
	},
 | 
			
		||||
	format_on_save = {
 | 
			
		||||
		lsp_fallback = true,
 | 
			
		||||
		async = false,
 | 
			
		||||
		timeout_ms = 500,
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
 | 
			
		||||
	conform.format({ lsp_fallback = true, async = false, timeout_ms = 500 })
 | 
			
		||||
end, { desc = "Format file or range (in visual mode)" })
 | 
			
		||||
							
								
								
									
										12
									
								
								nvim/lua/plugins/go.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								nvim/lua/plugins/go.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
return {
 | 
			
		||||
	"ray-x/go.nvim",
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		"ray-x/guihua.lua",
 | 
			
		||||
		"neovim/nvim-lspconfig",
 | 
			
		||||
		"nvim-treesitter/nvim-treesitter",
 | 
			
		||||
	},
 | 
			
		||||
	config = true,
 | 
			
		||||
	event = { "CmdlineEnter" },
 | 
			
		||||
	ft = { "go", "gomod" },
 | 
			
		||||
	build = ':lua require("go.install").update_all_sync()',
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								nvim/lua/plugins/goimpl.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								nvim/lua/plugins/goimpl.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
return {
 | 
			
		||||
	"edolphin-ydf/goimpl.nvim",
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		"nvim-lua/plenary.nvim",
 | 
			
		||||
		"nvim-lua/popup.nvim",
 | 
			
		||||
		"nvim-telescope/telescope.nvim",
 | 
			
		||||
		"nvim-treesitter/nvim-treesitter",
 | 
			
		||||
	},
 | 
			
		||||
	config = function()
 | 
			
		||||
		require("telescope").load_extension("goimpl")
 | 
			
		||||
	end,
 | 
			
		||||
	keys = {
 | 
			
		||||
		{
 | 
			
		||||
			"<leader>im",
 | 
			
		||||
			function()
 | 
			
		||||
				require("telescope").extensions.goimpl.goimpl({})
 | 
			
		||||
			end,
 | 
			
		||||
			desc = "Generate stub for interface on a type for golang",
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,99 +0,0 @@
 | 
			
		|||
return require("packer").startup({
 | 
			
		||||
	function(use)
 | 
			
		||||
		use("wbthomason/packer.nvim")
 | 
			
		||||
		use("nvim-lua/plenary.nvim")
 | 
			
		||||
		use("neovim/nvim-lspconfig")
 | 
			
		||||
		use("navarasu/onedark.nvim")
 | 
			
		||||
		use("Snyssfx/goerr-nvim")
 | 
			
		||||
		use({
 | 
			
		||||
			"lukas-reineke/indent-blankline.nvim",
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("ibl").setup()
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"rcarriga/nvim-dap-ui",
 | 
			
		||||
			requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"leoluz/nvim-dap-go",
 | 
			
		||||
			requires = { "mfussenegger/nvim-dap" },
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.dap")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"hrsh7th/nvim-cmp",
 | 
			
		||||
			requires = {
 | 
			
		||||
				"hrsh7th/cmp-nvim-lsp",
 | 
			
		||||
				"hrsh7th/cmp-buffer",
 | 
			
		||||
				"hrsh7th/cmp-path",
 | 
			
		||||
				"hrsh7th/cmp-vsnip",
 | 
			
		||||
				"hrsh7th/vim-vsnip",
 | 
			
		||||
			},
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.cmp")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"nvim-lualine/lualine.nvim",
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.lualine")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"nvim-treesitter/nvim-treesitter",
 | 
			
		||||
			run = ":TSUpdate",
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.treesitter")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({ "nvim-telescope/telescope-file-browser.nvim" })
 | 
			
		||||
		use({
 | 
			
		||||
			"nvim-telescope/telescope.nvim",
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.telescope")
 | 
			
		||||
			end,
 | 
			
		||||
			requires = "nvim-lua/plenary.nvim",
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"nvim-tree/nvim-tree.lua",
 | 
			
		||||
			requires = {
 | 
			
		||||
				"nvim-tree/nvim-web-devicons",
 | 
			
		||||
			},
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.tree")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"stevearc/conform.nvim",
 | 
			
		||||
			config = function()
 | 
			
		||||
				require("plugins.format")
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		use({
 | 
			
		||||
			"mfussenegger/nvim-dap",
 | 
			
		||||
			config = function()
 | 
			
		||||
				local dap = require("dap")
 | 
			
		||||
				-- Общие конфигурации для Go
 | 
			
		||||
				dap.configurations.go = {
 | 
			
		||||
					{
 | 
			
		||||
						type = "go",
 | 
			
		||||
						name = "Debug",
 | 
			
		||||
						request = "launch",
 | 
			
		||||
						program = "${file}",
 | 
			
		||||
						showLog = true,
 | 
			
		||||
						console = "integratedTerminal",
 | 
			
		||||
					},
 | 
			
		||||
				}
 | 
			
		||||
			end,
 | 
			
		||||
		})
 | 
			
		||||
		if packer_bootstrap then
 | 
			
		||||
			require("packer").sync()
 | 
			
		||||
		end
 | 
			
		||||
	end,
 | 
			
		||||
	config = {
 | 
			
		||||
		-- The root has to be a directory named "pack"
 | 
			
		||||
		package_root = vim.fn.stdpath("data") .. "/site/pack",
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			@ -1,40 +1,43 @@
 | 
			
		|||
require('lualine').setup {
 | 
			
		||||
	options = {
 | 
			
		||||
		icons_enabled = true,
 | 
			
		||||
		theme = 'auto',
 | 
			
		||||
		component_separators = { left = '', right = ''},
 | 
			
		||||
		section_separators = { left = '', right = ''},
 | 
			
		||||
		disabled_filetypes = {
 | 
			
		||||
			statusline = {},
 | 
			
		||||
			winbar = {},
 | 
			
		||||
return {
 | 
			
		||||
	"nvim-lualine/lualine.nvim",
 | 
			
		||||
	opts = {
 | 
			
		||||
		options = {
 | 
			
		||||
			icons_enabled = true,
 | 
			
		||||
			theme = "auto",
 | 
			
		||||
			component_separators = { left = "", right = "" },
 | 
			
		||||
			section_separators = { left = "", right = "" },
 | 
			
		||||
			disabled_filetypes = {
 | 
			
		||||
				statusline = {},
 | 
			
		||||
				winbar = {},
 | 
			
		||||
			},
 | 
			
		||||
			ignore_focus = {},
 | 
			
		||||
			always_divide_middle = true,
 | 
			
		||||
			globalstatus = false,
 | 
			
		||||
			refresh = {
 | 
			
		||||
				statusline = 1000,
 | 
			
		||||
				tabline = 1000,
 | 
			
		||||
				winbar = 1000,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		ignore_focus = {},
 | 
			
		||||
		always_divide_middle = true,
 | 
			
		||||
		globalstatus = false,
 | 
			
		||||
		refresh = {
 | 
			
		||||
			statusline = 1000,
 | 
			
		||||
			tabline = 1000,
 | 
			
		||||
			winbar = 1000,
 | 
			
		||||
		}
 | 
			
		||||
		sections = {
 | 
			
		||||
			lualine_a = { "mode" },
 | 
			
		||||
			lualine_b = { "branch", "diff", "diagnostics" },
 | 
			
		||||
			lualine_c = { "filename" },
 | 
			
		||||
			lualine_x = { "encoding", "fileformat", "filetype" },
 | 
			
		||||
			lualine_y = { "progress" },
 | 
			
		||||
			lualine_z = { "location" },
 | 
			
		||||
		},
 | 
			
		||||
		inactive_sections = {
 | 
			
		||||
			lualine_a = {},
 | 
			
		||||
			lualine_b = {},
 | 
			
		||||
			lualine_c = { "filename" },
 | 
			
		||||
			lualine_x = { "location" },
 | 
			
		||||
			lualine_y = {},
 | 
			
		||||
			lualine_z = {},
 | 
			
		||||
		},
 | 
			
		||||
		tabline = {},
 | 
			
		||||
		winbar = {},
 | 
			
		||||
		inactive_winbar = {},
 | 
			
		||||
		extensions = {},
 | 
			
		||||
	},
 | 
			
		||||
	sections = {
 | 
			
		||||
		lualine_a = {'mode'},
 | 
			
		||||
		lualine_b = {'branch', 'diff', 'diagnostics'},
 | 
			
		||||
		lualine_c = {'filename'},
 | 
			
		||||
		lualine_x = {'encoding', 'fileformat', 'filetype'},
 | 
			
		||||
		lualine_y = {'progress'},
 | 
			
		||||
		lualine_z = {'location'}
 | 
			
		||||
	},
 | 
			
		||||
	inactive_sections = {
 | 
			
		||||
		lualine_a = {},
 | 
			
		||||
		lualine_b = {},
 | 
			
		||||
		lualine_c = {'filename'},
 | 
			
		||||
		lualine_x = {'location'},
 | 
			
		||||
		lualine_y = {},
 | 
			
		||||
		lualine_z = {}
 | 
			
		||||
	},
 | 
			
		||||
	tabline = {},
 | 
			
		||||
	winbar = {},
 | 
			
		||||
	inactive_winbar = {},
 | 
			
		||||
	extensions = {}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										33
									
								
								nvim/lua/plugins/onedark.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								nvim/lua/plugins/onedark.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,33 @@
 | 
			
		|||
return {
 | 
			
		||||
	"navarasu/onedark.nvim",
 | 
			
		||||
	opts = {
 | 
			
		||||
		style = "darker",
 | 
			
		||||
		transparent = false, -- Show/hide background
 | 
			
		||||
		term_colors = true, -- Change terminal color as per the selected theme style
 | 
			
		||||
		ending_tildes = true, -- Show the end-of-buffer tildes. By default they are hidden
 | 
			
		||||
		cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu
 | 
			
		||||
		toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "<leader>ts"
 | 
			
		||||
		toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between
 | 
			
		||||
 | 
			
		||||
		code_style = {
 | 
			
		||||
			comments = "italic",
 | 
			
		||||
			keywords = "none",
 | 
			
		||||
			functions = "none",
 | 
			
		||||
			strings = "none",
 | 
			
		||||
			variables = "none",
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		lualine = {
 | 
			
		||||
			transparent = false, -- lualine center bar transparency
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		colors = {}, -- Override default colors
 | 
			
		||||
		highlights = {}, -- Override highlight groups
 | 
			
		||||
 | 
			
		||||
		diagnostics = {
 | 
			
		||||
			darker = true, -- darker colors for diagnostic
 | 
			
		||||
			undercurl = true, -- use undercurl instead of underline for diagnostics
 | 
			
		||||
			background = true, -- use background color for virtual text
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								nvim/lua/plugins/snippets.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								nvim/lua/plugins/snippets.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
require("luasnip").config.setup({
 | 
			
		||||
	history = true,
 | 
			
		||||
	update_events = "TextChanged,TextChangedI",
 | 
			
		||||
})
 | 
			
		||||
require("luasnip.loaders.from_vscode").lazy_load()
 | 
			
		||||
require("luasnip.loaders.from_vscode").lazy_load({
 | 
			
		||||
	paths = { vim.fn.stdpath("config") .. "/snippets" },
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			@ -1,10 +1,19 @@
 | 
			
		|||
require("telescope").setup({
 | 
			
		||||
	pickers = {
 | 
			
		||||
		buffers = {
 | 
			
		||||
			initial_mode = "normal",
 | 
			
		||||
return {
 | 
			
		||||
	"nvim-telescope/telescope.nvim",
 | 
			
		||||
	dependencies = { "nvim-lua/plenary.nvim" },
 | 
			
		||||
	opts = {
 | 
			
		||||
		pickers = {
 | 
			
		||||
			buffers = {
 | 
			
		||||
				initial_mode = "normal",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		defaults = {
 | 
			
		||||
			file_ignore_patterns = { "vendor", "node_modules" },
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	defaults = {
 | 
			
		||||
		file_ignore_patterns = { "vendor", "node_modules" },
 | 
			
		||||
	keys = {
 | 
			
		||||
		{ "<leader>ff", "<cmd>Telescope find_files<CR>", noremap = true, silent = true, desc = "Find files" },
 | 
			
		||||
		{ "<leader>fg", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true, desc = "Live grep" },
 | 
			
		||||
		{ "<leader>fb", "<cmd>Telescope buffers<CR>", noremap = true, silent = true, desc = "Find buffers" },
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,27 +1,51 @@
 | 
			
		|||
require("nvim-tree").setup({
 | 
			
		||||
	sort = {
 | 
			
		||||
		sorter = "case_sensitive",
 | 
			
		||||
return {
 | 
			
		||||
	"nvim-tree/nvim-tree.lua",
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		"nvim-tree/nvim-web-devicons",
 | 
			
		||||
	},
 | 
			
		||||
	view = {
 | 
			
		||||
		width = 30,
 | 
			
		||||
	},
 | 
			
		||||
	git = {
 | 
			
		||||
		enable = true,
 | 
			
		||||
	},
 | 
			
		||||
	renderer = {
 | 
			
		||||
		group_empty = true,
 | 
			
		||||
		highlight_git = true,
 | 
			
		||||
		icons = {
 | 
			
		||||
			show = {
 | 
			
		||||
				git = true,
 | 
			
		||||
	opts = {
 | 
			
		||||
		hijack_directories = {
 | 
			
		||||
			enable = true, -- Перехватывать открытие директорий
 | 
			
		||||
			auto_open = true, -- Автоматически открывать при старте
 | 
			
		||||
		},
 | 
			
		||||
		sort = {
 | 
			
		||||
			sorter = "case_sensitive",
 | 
			
		||||
		},
 | 
			
		||||
		view = {
 | 
			
		||||
			width = 30,
 | 
			
		||||
		},
 | 
			
		||||
		git = {
 | 
			
		||||
			enable = true,
 | 
			
		||||
		},
 | 
			
		||||
		renderer = {
 | 
			
		||||
			group_empty = true,
 | 
			
		||||
			highlight_git = true,
 | 
			
		||||
			icons = {
 | 
			
		||||
				show = {
 | 
			
		||||
					git = true,
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		filters = {
 | 
			
		||||
			dotfiles = false,
 | 
			
		||||
		},
 | 
			
		||||
		update_focused_file = {
 | 
			
		||||
			enable = true,
 | 
			
		||||
			update_root = false,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	filters = {
 | 
			
		||||
		dotfiles = false,
 | 
			
		||||
	keys = {
 | 
			
		||||
		{
 | 
			
		||||
			"<C-c>",
 | 
			
		||||
			function()
 | 
			
		||||
				local api = require("nvim-tree.api")
 | 
			
		||||
				local global_cwd = vim.fn.getcwd(-1, -1)
 | 
			
		||||
				api.tree.change_root(global_cwd)
 | 
			
		||||
			end,
 | 
			
		||||
			noremap = true,
 | 
			
		||||
			silent = true,
 | 
			
		||||
			desc = "Change tree root to CWD",
 | 
			
		||||
		},
 | 
			
		||||
		{ "<F3>", ":NvimTreeToggle<CR>", noremap = true, silent = true, desc = "Toggle file tree" },
 | 
			
		||||
	},
 | 
			
		||||
	update_focused_file = {
 | 
			
		||||
		enable = true,
 | 
			
		||||
		update_root = false,
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,47 +1,66 @@
 | 
			
		|||
require("nvim-treesitter.configs").setup({
 | 
			
		||||
	highlight = { enable = true },
 | 
			
		||||
	ensure_installed = {
 | 
			
		||||
		"c",
 | 
			
		||||
		"lua",
 | 
			
		||||
		"python",
 | 
			
		||||
		"bash",
 | 
			
		||||
		"go",
 | 
			
		||||
		"html",
 | 
			
		||||
		"css",
 | 
			
		||||
		"javascript",
 | 
			
		||||
		"typescript",
 | 
			
		||||
		"git_config",
 | 
			
		||||
		"git_rebase",
 | 
			
		||||
		"gitattributes",
 | 
			
		||||
		"gitcommit",
 | 
			
		||||
		"gitignore",
 | 
			
		||||
		"gomod",
 | 
			
		||||
		"gosum",
 | 
			
		||||
		"gotmpl",
 | 
			
		||||
		"gowork",
 | 
			
		||||
		"hjson",
 | 
			
		||||
		"ini",
 | 
			
		||||
		"json",
 | 
			
		||||
		"json5",
 | 
			
		||||
		"jsonnet",
 | 
			
		||||
		"latex",
 | 
			
		||||
		"make",
 | 
			
		||||
		"markdown",
 | 
			
		||||
		"markdown_inline",
 | 
			
		||||
		"nginx",
 | 
			
		||||
		"proto",
 | 
			
		||||
		"rust",
 | 
			
		||||
		"templ",
 | 
			
		||||
		"todotxt",
 | 
			
		||||
		"toml",
 | 
			
		||||
		"tsx",
 | 
			
		||||
		"typescript",
 | 
			
		||||
		"vim",
 | 
			
		||||
		"vimdoc",
 | 
			
		||||
		"xml",
 | 
			
		||||
		"yaml",
 | 
			
		||||
		"sql",
 | 
			
		||||
		"ssh_config",
 | 
			
		||||
return {
 | 
			
		||||
	"nvim-treesitter/nvim-treesitter",
 | 
			
		||||
	build = ":TSUpdate",
 | 
			
		||||
	opts = {
 | 
			
		||||
		highlight = { enable = true },
 | 
			
		||||
		ensure_installed = {
 | 
			
		||||
			"c",
 | 
			
		||||
			"lua",
 | 
			
		||||
			"python",
 | 
			
		||||
			"bash",
 | 
			
		||||
			"go",
 | 
			
		||||
			"html",
 | 
			
		||||
			"css",
 | 
			
		||||
			"javascript",
 | 
			
		||||
			"typescript",
 | 
			
		||||
			"git_config",
 | 
			
		||||
			"git_rebase",
 | 
			
		||||
			"gitattributes",
 | 
			
		||||
			"gitcommit",
 | 
			
		||||
			"gitignore",
 | 
			
		||||
			"gomod",
 | 
			
		||||
			"gosum",
 | 
			
		||||
			"gotmpl",
 | 
			
		||||
			"gowork",
 | 
			
		||||
			"hjson",
 | 
			
		||||
			"ini",
 | 
			
		||||
			"json",
 | 
			
		||||
			"json5",
 | 
			
		||||
			"jsonnet",
 | 
			
		||||
			"latex",
 | 
			
		||||
			"make",
 | 
			
		||||
			"markdown",
 | 
			
		||||
			"markdown_inline",
 | 
			
		||||
			"nginx",
 | 
			
		||||
			"proto",
 | 
			
		||||
			"rust",
 | 
			
		||||
			"templ",
 | 
			
		||||
			"todotxt",
 | 
			
		||||
			"toml",
 | 
			
		||||
			"tsx",
 | 
			
		||||
			"typescript",
 | 
			
		||||
			"vim",
 | 
			
		||||
			"vimdoc",
 | 
			
		||||
			"xml",
 | 
			
		||||
			"yaml",
 | 
			
		||||
			"sql",
 | 
			
		||||
			"ssh_config",
 | 
			
		||||
		},
 | 
			
		||||
		ignore_install = { "gdhsader", "phpdoc" },
 | 
			
		||||
		indent = { enable = true },
 | 
			
		||||
		auto_install = true,
 | 
			
		||||
		sync_install = false,
 | 
			
		||||
		textobjects = { select = { enable = true, lookahead = true } },
 | 
			
		||||
	},
 | 
			
		||||
	ignore_install = { "gdhsader", "phpdoc" },
 | 
			
		||||
})
 | 
			
		||||
	dependencies = {
 | 
			
		||||
		{ "nvim-treesitter/nvim-treesitter-textobjects" },
 | 
			
		||||
		{
 | 
			
		||||
			"nvim-treesitter/nvim-treesitter-context",
 | 
			
		||||
			opts = {
 | 
			
		||||
				enable = true,
 | 
			
		||||
				mode = "topline",
 | 
			
		||||
				line_numbers = true,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue