From 49e5fa571005da10d156d14f82e145afaf96214e Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 16 May 2025 22:33:54 +0300 Subject: =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/dap.lua | 118 ++++------------------------------------- nvim/lua/plugins/dapui.lua | 4 +- nvim/lua/plugins/lualine.lua | 3 +- nvim/lua/plugins/telescope.lua | 53 ++++++++++++++---- nvim/lua/plugins/theme.lua | 21 -------- nvim/lua/plugins/tree.lua | 41 ++++++++++++-- 6 files changed, 92 insertions(+), 148 deletions(-) delete mode 100644 nvim/lua/plugins/theme.lua (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index 58cc7f9..da87df9 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -21,59 +21,8 @@ local function setup_go_configuration(dap, configs) type = "go", name = "Debug", request = "launch", - program = "${file}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug (Arguments)", - request = "launch", - program = "${file}", - args = get_arguments, - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug (Arguments & Build Flags)", - request = "launch", - program = "${file}", - args = get_arguments, - buildFlags = get_build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug Package", - request = "launch", - program = "${fileDirname}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Attach", - mode = "local", - request = "attach", - processId = filtered_pick_process, - buildFlags = configs.delve.build_flags, - }, - { - type = "go", - name = "Debug test", - request = "launch", - mode = "test", - program = "${file}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug test (go.mod)", - request = "launch", - mode = "test", - program = "./${relativeFileDirname}", + program = "${workspaceFolder}", + args = {}, buildFlags = configs.delve.build_flags, outputMode = configs.delve.output_mode, }, @@ -164,61 +113,40 @@ return { silent = true, }, { - "", + "", -- S-F5 function() - require("dap").step_over() + require("dap").restart() end, silent = true, }, { - "", + "", -- C-F5 function() - require("dap").step_into() + require("dap").terminate() end, silent = true, }, { - "", - function() - require("dap").step_out() - end, - silent = true, - }, - { - "dc", - function() - require("dap").continue() - end, - silent = true, - }, - { - "so", + "", function() require("dap").step_over() end, silent = true, }, { - "si", + "", function() require("dap").step_into() end, silent = true, }, { - "st", + "", -- S-F7 function() require("dap").step_out() end, silent = true, }, - { - "b", - function() - require("dap").toggle_breakpoint() - end, - silent = true, - }, { "", function() @@ -226,33 +154,5 @@ return { end, silent = true, }, - { - "B", - function() - require("dap").set_breakpoint() - end, - silent = true, - }, - { - "lp", - function() - require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) - end, - silent = true, - }, - { - "dr", - function() - require("dap").repl.open() - end, - silent = true, - }, - { - "dl", - function() - require("dap").run_last() - end, - silent = true, - }, }, } diff --git a/nvim/lua/plugins/dapui.lua b/nvim/lua/plugins/dapui.lua index b63e2ac..93df74b 100644 --- a/nvim/lua/plugins/dapui.lua +++ b/nvim/lua/plugins/dapui.lua @@ -6,7 +6,7 @@ return { }, keys = { { - "du", + "", function() require("dapui").toggle() end, @@ -27,7 +27,7 @@ return { silent = true, }, { - "ds", + "", function() local widgets = require("dap.ui.widgets") widgets.centered_float(widgets.scopes) diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 19bcb8e..c35b162 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -1,9 +1,10 @@ +local colors = require("theme.colors") return { "nvim-lualine/lualine.nvim", opts = { options = { icons_enabled = true, - theme = "onedark", + theme = "auto", component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, disabled_filetypes = { diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 2348275..aabcd9c 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,19 +1,50 @@ return { "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - pickers = { - buffers = { - initial_mode = "normal", - }, - }, - defaults = { - file_ignore_patterns = { "vendor", "node_modules" }, - }, + dependencies = { + "nvim-lua/plenary.nvim", }, + config = function() + local actions = require("telescope.actions") + require("telescope").setup({ + extensions = { + project = { + sync_with_nvim_tree = true, + }, + }, + pickers = { + buffers = { + initial_mode = "normal", + }, + }, + defaults = { + file_ignore_patterns = { "vendor", "node_modules" }, + mappings = { + i = { + [""] = actions.close, + }, + n = { + [""] = actions.close, + }, + }, + }, + }) + end, keys = { { "ff", "Telescope find_files", noremap = true, silent = true, desc = "Find files" }, { "fg", "Telescope live_grep", noremap = true, silent = true, desc = "Live grep" }, - { "fb", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, + { + "fb", + "Telescope current_buffer_fuzzy_fund", + noremap = true, + silent = true, + desc = "Find current file", + }, + { "", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, + { "gc", "Telescope git_commits", noremap = true, silent = true }, + { "gs", "Telescope git_status", noremap = true, silent = true }, + { "ch", "Telescope commands_history", noremap = true, silent = true }, + { "e", "Telescope diagnostics", noremap = true, silent = true }, + { "gi", "Telescope lsp_implementations", noremap = true, silent = true }, + { "gr", "Telescope lsp_references", noremap = true, silent = true }, }, } diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua deleted file mode 100644 index 72a6f81..0000000 --- a/nvim/lua/plugins/theme.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - "navarasu/onedark.nvim", - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - require("onedark").setup({ - style = "darker", - colors = { - bright_orange = "#ff8800", -- define a new color - }, - highlights = { - -- ["@lsp.type.keyword"] = { fg = "$green", fmt = "bold,underline" }, - -- ["@lsp.type.property"] = { fg = "$bright_orange", bg = "#00ff00", fmt = "bold" }, - -- ["@lsp.type.function"] = { fg = "#0000ff", sp = "$cyan", fmt = "underline,italic" }, - -- ["@lsp.type.method"] = { link = "@function" }, - -- To add language specific config - -- ["@lsp.type.variable.go"] = { fg = "none" }, - }, - }) - require("onedark").load() - end, -} diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 4807024..94d1f11 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -1,18 +1,49 @@ +local HEIGHT_RATIO = 0.8 +local WIDTH_RATIO = 0.5 + return { "nvim-tree/nvim-tree.lua", dependencies = { "nvim-tree/nvim-web-devicons", }, opts = { + disable_netrw = true, + hijack_netrw = true, hijack_directories = { - enable = true, -- Перехватывать открытие директорий - auto_open = true, -- Автоматически открывать при старте + enable = true, + auto_open = true, }, sort = { sorter = "case_sensitive", }, view = { - width = 30, + -- width = 30, + float = { + enable = true, + open_win_config = function() + local screen_w = vim.opt.columns:get() + local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + local window_w = screen_w * WIDTH_RATIO + local window_h = screen_h * HEIGHT_RATIO + local window_w_int = math.floor(window_w) + local window_h_int = math.floor(window_h) + local center_x = (screen_w - window_w) / 2 + local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + return { + border = "rounded", + relative = "editor", + row = center_y, + col = center_x, + width = window_w_int, + height = window_h_int, + } + end, + }, + width = function() + return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + end, + adaptive_size = true, + centralize_selection = true, }, git = { enable = true, @@ -29,9 +60,11 @@ return { filters = { dotfiles = false, }, + sync_root_with_cwd = true, + respect_buf_cwd = true, update_focused_file = { enable = true, - update_root = false, + update_root = true, }, }, keys = { -- cgit v1.2.3