diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-09-20 23:08:00 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-09-20 23:08:00 -0300 |
| commit | fa3e94e60b9edc7c3620f43e207b915eae84bab0 (patch) | |
| tree | 10617c9508c797ffb9bcf3bdb09c60ae69371662 /lua | |
| parent | 6364400a98c93cdf6f2209670be1d2b6e31ee6ab (diff) | |
| download | nvim-conf-fa3e94e60b9edc7c3620f43e207b915eae84bab0.tar.gz nvim-conf-fa3e94e60b9edc7c3620f43e207b915eae84bab0.zip | |
feat: solo dejo phpactor
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/config/options.lua | 2 | ||||
| -rw-r--r-- | lua/pi/completition/init.lua | 18 | ||||
| -rw-r--r-- | lua/pi/dap/configs/cpp.lua | 10 | ||||
| -rw-r--r-- | lua/pi/lsp/default.lua | 2 | ||||
| -rw-r--r-- | lua/pi/lsp/null-ls.lua | 5 | ||||
| -rw-r--r-- | lua/pi/lsp/servers/ts_ls.lua (renamed from lua/pi/lsp/servers/tsserver.lua) | 0 | ||||
| -rw-r--r-- | lua/pi/php/gateway.lua | 137 | ||||
| -rw-r--r-- | lua/pi/php/lsp.lua | 151 | ||||
| -rw-r--r-- | lua/pi/php/servers.lua | 38 | ||||
| -rw-r--r-- | lua/plugins/animation.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/noice.lua | 256 | ||||
| -rw-r--r-- | lua/plugins/none-ls.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/phpactor.lua | 61 |
13 files changed, 211 insertions, 473 deletions
diff --git a/lua/config/options.lua b/lua/config/options.lua index af53cb8..1400d03 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -26,7 +26,7 @@ opt.hidden = true opt.expandtab = true -- Configura el ancho de la tabulación y la indentación. -opt.tabstop = 2 +opt.tabstop = 4 opt.softtabstop = 4 opt.shiftwidth = 4 diff --git a/lua/pi/completition/init.lua b/lua/pi/completition/init.lua index 5b9fd18..418c6d2 100644 --- a/lua/pi/completition/init.lua +++ b/lua/pi/completition/init.lua @@ -55,14 +55,14 @@ cmp.setup { ["<c-space>"] = cmp.mapping.complete(), }, sources = { - -- { name = "dictionary", keyword_length = 2}, + { name = "dictionary", keyword_length = 2}, { name = "nvim_lua" }, { name = "nvim_lsp" }, { name = "path" }, { name = "luasnip" }, { name = "copilot" }, {name = "codeium"}, - { name = 'cmp_ai' }, + -- { name = 'cmp_ai' }, { name = 'html-css', option = { max_count = {}, -- not ready yet @@ -86,7 +86,8 @@ cmp.setup { local bufs = {} for _, win in ipairs(vim.api.nvim_list_wins()) do local bufnr = vim.api.nvim_win_get_buf(win) - if vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" then + local buftype = vim.api.nvim_get_option_value("buftype", { buf = bufnr }) + if buftype ~= "terminal" then bufs[bufnr] = true end end @@ -163,6 +164,17 @@ cmp.setup { end vim_item.kind = KIND_ICONS[vim_item.kind] or vim_item.kind + -- Add maxwidth and ellipsis_char in the middle + local maxwidth = 20 + local ellipsis_char = '...' + if #vim_item.abbr > maxwidth then + local half_width = math.floor((maxwidth - #ellipsis_char) / 2) + vim_item.abbr = string.sub( + vim_item.abbr, + 1, + half_width + ) .. ellipsis_char .. string.sub(vim_item.abbr, -half_width) + end return vim_item end }, diff --git a/lua/pi/dap/configs/cpp.lua b/lua/pi/dap/configs/cpp.lua index d51d6bd..a2718b0 100644 --- a/lua/pi/dap/configs/cpp.lua +++ b/lua/pi/dap/configs/cpp.lua @@ -3,7 +3,7 @@ local dap = require("dap") dap.adapters.cppdbg = { id = 'cppdbg', type = 'executable', - command = '~/.local/share/nvim/mason/packages/cpptools/extension/debugAdapters/bin/OpenDebugAD7', + command = '/home/elvis/.local/share/nvim/mason/packages/cpptools/extension/debugAdapters/bin/OpenDebugAD7', } dap.configurations.cpp = { @@ -16,6 +16,9 @@ dap.configurations.cpp = { end, cwd = '${workspaceFolder}', stopAtEntry = true, + args = function() + return vim.split(vim.fn.input('Program arguments: ', ''), " ") + end, }, { name = 'Attach to gdbserver :1234', @@ -28,6 +31,11 @@ dap.configurations.cpp = { program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') end, + args = function() + return vim.split(vim.fn.input('Program arguments: ', ''), " ") + end, }, } + dap.configurations.c = dap.configurations.cpp + diff --git a/lua/pi/lsp/default.lua b/lua/pi/lsp/default.lua index ff5c97e..b2be73e 100644 --- a/lua/pi/lsp/default.lua +++ b/lua/pi/lsp/default.lua @@ -14,7 +14,7 @@ return { rust_analyzer = { enable = true }, svelte = { enable = true }, tailwindcss = { enable = true, filetypes = {"blade", "html", "svelte"} }, - tsserver = { enable = true }, + ts_ls = { enable = true }, volar = { enable = true }, texlab = { enable = true, filetypes = {"tex", "bib"} }, pyright = { enable = true, filetypes = {"python"} }, diff --git a/lua/pi/lsp/null-ls.lua b/lua/pi/lsp/null-ls.lua index 70693d9..a9c4412 100644 --- a/lua/pi/lsp/null-ls.lua +++ b/lua/pi/lsp/null-ls.lua @@ -38,7 +38,10 @@ null_ls.setup { end, }, null_ls.builtins.formatting.pint, - null_ls.builtins.formatting.clang_format, + -- null_ls.builtins.formatting.clang_format, + null_ls.builtins.formatting.clang_format.with { + extra_args = { "--style={IndentWidth: 4}" }, + }, }, } diff --git a/lua/pi/lsp/servers/tsserver.lua b/lua/pi/lsp/servers/ts_ls.lua index c68c894..c68c894 100644 --- a/lua/pi/lsp/servers/tsserver.lua +++ b/lua/pi/lsp/servers/ts_ls.lua diff --git a/lua/pi/php/gateway.lua b/lua/pi/php/gateway.lua deleted file mode 100644 index 83c95e9..0000000 --- a/lua/pi/php/gateway.lua +++ /dev/null @@ -1,137 +0,0 @@ -local pickers = require "telescope.pickers" -local finders = require "telescope.finders" -local conf = require("telescope.config").values -local action_state = require "telescope.actions.state" -local action_set = require "telescope.actions.set" -local actions = require "telescope.actions" -local get_node_text = vim.treesitter.get_node_text - -local gateway = {} - -local get_definition_buffer = function(type) - local uri = vim.uri_from_fname(vim.fn.getcwd() .. "/config/graphql/_" .. type .. ".yaml") - local buff = vim.uri_to_bufnr(uri) - vim.fn.bufload(buff) - - return buff -end - -local get_all_definitions = function() - local mutations_definitions = gateway.get_graphql_definitions(get_definition_buffer "mutation") - local queries_definitions = gateway.get_graphql_definitions(get_definition_buffer "query") - for _, definition in ipairs(queries_definitions) do - table.insert(mutations_definitions, definition) - end - - return mutations_definitions -end - --- "'@=mutation(\"App\\\\GraphQL\\\\Mutations\\\\Mutation::action\", ...)'", -local open_resolver = function(resolver) - -- need to parse to get this values - local args = string.match(resolver, "'@=mutation%((.+)%)'") - if args == nil then - args = string.match(resolver, "'@=query%((.+)%)'") - end - if args == nil then - return - end - - local args_tbl = vim.split(args, ", ") - local fqn = string.match(args_tbl[1], '"(.+)"') - fqn = string.gsub(fqn, "\\\\", "\\") - -- P(fqn) - - require("pi.php.lsp").find(fqn, "phpactor") -end - ---- @param bufnr integer Buff id -gateway.get_graphql_definitions = function(bufnr) - vim.treesitter.query.set( - "yaml", - "GraphQL_endpoints", - [[ - (document (block_node (block_mapping (block_mapping_pair - value: (block_node (block_mapping (block_mapping_pair - value: (block_node (block_mapping (block_mapping_pair - value: (block_node (block_mapping (block_mapping_pair - key: (flow_node) @mutation - value: (block_node (block_mapping (block_mapping_pair - key: (flow_node) @resolve (#eq? @resolve "resolve") - value: (flow_node) @resolver - ))) - ))) - ))) - ))) - )))) - ]] - ) - - local query = vim.treesitter.query.get("yaml", "GraphQL_endpoints") - - local elements = {} - - local parsers = require "nvim-treesitter.parsers" - local parser = parsers.get_parser(bufnr) - local tree = parser:parse()[1] - - for id, node in query:iter_captures(tree:root(), bufnr) do - if query.captures[id] == "mutation" then - table.insert(elements, { - value = get_node_text(node, bufnr), - lnum = node:start() + 1, - buffer = bufnr, - }) - elseif query.captures[id] == "resolver" then - elements[#elements].resolver = get_node_text(node, bufnr) - end - end - - return elements -end - ---- gets the graphql function defined on a given buffer ---- @param opts table: options to pass to the picker -gateway.graphql_definitions = function(opts) - opts = opts or {} - pickers - .new(opts, { - promt_title = "Queries", - finder = finders.new_table { - results = get_all_definitions(), - entry_maker = function(entry) - -- buffer = 43, - -- lnum = 82, - -- resolver = "'@=mutation(\"App\\\\GraphQL\\\\Mutation\\\\Mutation::action\", ...)'", - -- value = "deleteVehicleImage" - return { - value = entry, - display = entry.value, - ordinal = entry.value, - path = vim.api.nvim_buf_get_name(entry.buffer), - lnum = entry.lnum, - resolver = entry.resolver, - } - end, - }, - sorter = conf.generic_sorter(opts), - previewer = conf.grep_previewer(opts), - attach_mappings = function(prompt_bufnr, map) - action_set.select:enhance { - post = function() - local selection = action_state.get_selected_entry() - vim.api.nvim_win_set_cursor(0, { selection.lnum, 0 }) - end, - } - map("i", "<c-o>", function() - actions.close(prompt_bufnr) - local selection = action_state.get_selected_entry() - open_resolver(selection.resolver) - end) - return true - end, - }) - :find() -end - -return gateway diff --git a/lua/pi/php/lsp.lua b/lua/pi/php/lsp.lua deleted file mode 100644 index 24711a1..0000000 --- a/lua/pi/php/lsp.lua +++ /dev/null @@ -1,151 +0,0 @@ -local Path = require "plenary.path" - -local lsp = {} - -local open_filename = function(filename) - if vim.api.nvim_buf_get_name(0) ~= filename then - filename = Path:new(vim.fn.fnameescape(filename)):normalize(vim.loop.cwd()) - pcall(vim.cmd, string.format("%s %s", "edit", filename)) - end -end - ----@param server_name string ----@return table|nil, boolean -local get_client = function(server_name) - local clients = vim.lsp.get_clients { name = server_name } - local client = clients[1] or nil - local new_instance = false - - if not client then - local server = require("lspconfig")[server_name] - local config = server.make_config(vim.fn.getcwd()) - local client_id = vim.lsp.start(config) - client = vim.lsp.get_client_by_id(client_id) - new_instance = true - end - - return client, new_instance -end - -local function go_to(client, is_new_instance, full_class, method) - local class_parts = vim.split(full_class, "\\") - local class = class_parts[#class_parts] - - local resp = client.request_sync("workspace/symbol", { query = class }, nil) - - local locations = vim.lsp.util.symbols_to_items(resp.result or {}, nil) or {} - if vim.tbl_isempty(locations) then - vim.api.nvim_err_writeln("Empty response looking for class: " .. full_class) - if is_new_instance then - vim.lsp.stop_client(client.id) - end - return - end - - local class_location = nil - for idx, location in pairs(locations) do - if location.text == string.format("[Class] %s", full_class) then - class_location = locations[idx] - break - end - end - - if class_location == nil then - vim.api.nvim_err_writeln("Could not find class for : " .. full_class) - if is_new_instance then - vim.lsp.stop_client(client.id) - end - return - end - - open_filename(class_location.filename) - - local params = vim.lsp.util.make_position_params(0) - if is_new_instance then - vim.lsp.buf_attach_client(0, client.id) - end - - vim.lsp.buf_request(0, "textDocument/documentSymbol", params, function(method_err, method_server_result, _, _) - if method_err then - vim.api.nvim_err_writeln("Error when finding workspace symbols: " .. method_err.message) - if is_new_instance then - vim.lsp.stop_client(client.id) - end - return - end - - local method_locations = vim.lsp.util.symbols_to_items(method_server_result or {}, 0) or {} - if vim.tbl_isempty(method_locations) then - vim.api.nvim_err_writeln(string.format("empty response looking for method: %s", method or "__invoke")) - if is_new_instance then - vim.lsp.stop_client(client.id) - end - return - end - - local method_location = nil - for _, value in ipairs(method_locations) do - if value.text == string.format("[Method] %s", method or "__invoke") then - method_location = value - break - end - end - - if method_location == nil then - if is_new_instance then - vim.lsp.stop_client(client.id) - end - return - end - - local row = method_location.lnum - local col = method_location.col - 1 - - if row and col then - local ok, err_msg = pcall(vim.api.nvim_win_set_cursor, 0, { row, col }) - if not ok then - vim.api.nvim_err_writeln("Erro setting row and col " .. err_msg) - end - vim.cmd "normal zt" - end - if is_new_instance then - vim.lsp.stop_client(client.id) - end - end) -end - ----Return a buffer id for the given client ----@param server_name string ----@return integer|nil -lsp.get_lsp_buffer = function(server_name) - local clients = vim.lsp.get_clients { name = server_name } - if #clients == 0 then - return nil - end - - local buffers = vim.lsp.get_buffers_by_client_id(clients[1].id) - - if #buffers == 0 then - return nil - end - - return buffers[1] -end - ---- @param fqn string: fully name to search Class::method -lsp.find = function(fqn, server_name) - local search = vim.split(fqn, "::") - local fqn_class = search[1] - local method = search[2] - - local client, is_new_instance = get_client(server_name) - - if not client then - vim.api.nvim_err_writeln "Could not get lsp client" - return - end - - go_to(client, is_new_instance, fqn_class, method) -end - -return lsp diff --git a/lua/pi/php/servers.lua b/lua/pi/php/servers.lua deleted file mode 100644 index 9450152..0000000 --- a/lua/pi/php/servers.lua +++ /dev/null @@ -1,38 +0,0 @@ -local phpactor = {} - --- TODO possible improvement look how it works underline --- use the client directly to call, no need for the buffer --- to find a class. --- vim.lsp.start() should return the client - -function phpactor.findclass(buffer, fqn, callback) - local class_parts = vim.split(fqn, "\\") - local class = class_parts[#class_parts] - - vim.lsp.buf_request(buffer, "workspace/symbol", { query = class }, function(err, server_result, _, _) - if err then - callback(nil, "Error when finding workspace symbols: " .. err.message) - - return - end - - local locations = vim.lsp.util.symbols_to_items(server_result or {}, buffer) or {} - if vim.tbl_isempty(locations) then - vim.api.nvim_err_writeln("Empty response looking for class: " .. fqn) - return - end - end) -end - --- getting the config I can re use the client --- the next thing is to make the request with the client -local config = require("lspconfig").phpactor -config.root_dir = vim.fn.getcwd() -local client_id = vim.lsp.start(config) - -vim.lsp.get_client_by_id(client_id) --- use client.request or request_sync --- look for the direct of the symbol -return { - phpactor = phpactor, -} diff --git a/lua/plugins/animation.lua b/lua/plugins/animation.lua index 386c761..865287e 100644 --- a/lua/plugins/animation.lua +++ b/lua/plugins/animation.lua @@ -4,7 +4,7 @@ return { "anuvyklack/middleclass", }, keys = { - {"<leader>aa", function () + {"<leader>AA", function () require("pi.animations").redraw_buffer() end} }, diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 70e81e9..7cd5593 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -5,108 +5,208 @@ return { }, event = "VeryLazy", opts = { - lsp = { - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - -- -- you can enable a preset for easier configuration - presets = { - bottom_search = true, -- use a classic bottom cmdline for search - -- command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - -- inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = true, -- add a border to hover docs and signature help - }, cmdline = { - view = "cmdline", + enabled = true, -- enables the Noice cmdline UI + view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom + opts = {}, -- global options for the cmdline. See section on views + ---@type table<string, CmdlineFormat> + format = { + -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. + -- view: (default is cmdline view) + -- opts: any options passed to the view + -- icon_hl_group: optional hl_group for the icon + -- title: set to anything or empty string to hide + cmdline = { pattern = "^:", icon = "", lang = "vim" }, + search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, + search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, + filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, + lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" }, + help = { pattern = "^:%s*he?l?p?%s+", icon = "" }, + input = { view = "cmdline_input", icon = " " }, -- Used by input() + -- lua = false, -- to disable a format, set to `false` + }, }, messages = { + -- NOTE: If you enable messages, then the cmdline is enabled automatically. + -- This is a current Neovim limitation. enabled = true, -- enables the Noice messages UI view = "notify", -- default view for messages view_error = "notify", -- view for errors view_warn = "notify", -- view for warnings view_history = "messages", -- view for :messages - view_search = false, -- view for search count messages. Set to `false` to disable + view_search = "virtualtext", -- view for search count messages. Set to `false` to disable }, - routes = { - { + popupmenu = { + enabled = true, -- enables the Noice popupmenu UI + ---@type 'nui'|'cmp' + backend = "nui", -- backend to use to show regular cmdline completions + ---@type NoicePopupmenuItemKind|false + -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) + kind_icons = {}, -- set to `false` to disable icons + }, + -- default options for require('noice').redirect + -- see the section on Command Redirection + ---@type NoiceRouteConfig + redirect = { + view = "popup", + filter = { event = "msg_show" }, + }, + -- You can add any custom commands below that will be available with `:Noice command` + ---@type table<string, NoiceCommand> + commands = { + history = { + -- options for the message history that you get with `:Noice` view = "split", + opts = { enter = true, format = "details" }, filter = { - cmdline = "G", - }, - opts = { - enter = true, - render = "plain", - format = { "{message}" }, - replace = true, - close = { - events = { "BufLeave" }, - keys = { "q" }, + any = { + { event = "notify" }, + { error = true }, + { warning = true }, + { event = "msg_show", kind = { "" } }, + { event = "lsp", kind = "message" }, }, }, }, - { - view = "split", + -- :Noice last + last = { + view = "popup", + opts = { enter = true, format = "details" }, filter = { - cmdline = "Notifications", - }, - opts = { - enter = true, - render = "plain", - format = { "{message}" }, - replace = true, - close = { - events = { "BufLeave" }, - keys = { "q" }, + any = { + { event = "notify" }, + { error = true }, + { warning = true }, + { event = "msg_show", kind = { "" } }, + { event = "lsp", kind = "message" }, }, }, + filter_opts = { count = 1 }, }, - { - view = "mini", - filter = { - cmdline = "w", - }, + -- :Noice errors + errors = { + -- options for the message history that you get with `:Noice` + view = "popup", + opts = { enter = true, format = "details" }, + filter = { error = true }, + filter_opts = { reverse = true }, }, - { + all = { + -- options for the message history that you get with `:Noice` + view = "split", + opts = { enter = true, format = "details" }, + filter = {}, + }, + }, + notify = { + -- Noice can be used as `vim.notify` so you can route any notification like other messages + -- Notification messages have their level and other properties set. + -- event is always "notify" and kind can be any log level as a string + -- The default routes will forward notifications to nvim-notify + -- Benefit of using Noice for this is the routing and consistent history view + enabled = true, + view = "notify", + }, + lsp = { + progress = { + enabled = true, + -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin + -- See the section on formatting for more details on how to customize. + --- @type NoiceFormat|string + format = "lsp_progress", + --- @type NoiceFormat|string + format_done = "lsp_progress_done", + throttle = 1000 / 30, -- frequency to update lsp progress message view = "mini", - filter = { - find = "Config Change Detected. Reloading...", + }, + override = { + -- override the default lsp markdown formatter with Noice + ["vim.lsp.util.convert_input_to_markdown_lines"] = false, + -- override the lsp markdown formatter with Noice + ["vim.lsp.util.stylize_markdown"] = false, + -- override cmp documentation with Noice (needs the other options to work) + ["cmp.entry.get_documentation"] = false, + }, + hover = { + enabled = true, + silent = false, -- set to true to not show a message if hover is not available + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + signature = { + enabled = true, + auto_open = { + enabled = true, + trigger = true, -- Automatically show signature help when typing a trigger character from the LSP + luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes + throttle = 50, -- Debounce lsp signature help request by 50ms }, + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation }, - { - view = "mini", - filter = { - any = { - { - event = "msg_show", - find = "lines yanked", - }, - { - event = "msg_show", - find = "more lines", - }, - { - event = "msg_show", - find = "direnv:", - }, - { - find = "laravel.sail.", - }, - { - find = "Pattern not found", - }, - { - event = "msg_show", - kind = "", - find = "change;", - }, - }, + message = { + -- Messages shown by lsp servers + enabled = true, + view = "notify", + opts = {}, + }, + -- defaults for hover and signature help + documentation = { + view = "hover", + ---@type NoiceViewOptions + opts = { + lang = "markdown", + replace = true, + render = "plain", + format = { "{message}" }, + win_options = { concealcursor = "n", conceallevel = 3 }, }, }, }, + markdown = { + hover = { + ["|(%S-)|"] = vim.cmd.help, -- vim help links + ["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links + }, + highlights = { + ["|%S-|"] = "@text.reference", + ["@%S+"] = "@parameter", + ["^%s*(Parameters:)"] = "@text.title", + ["^%s*(Return:)"] = "@text.title", + ["^%s*(See also:)"] = "@text.title", + ["{%S-}"] = "@parameter", + }, + }, + health = { + checker = true, -- Disable if you don't want health checks to run + }, + ---@type NoicePresets + presets = { + -- you can enable a preset by setting it to true, or a table that will override the preset config + -- you can also add custom presets that you can enable/disable with enabled=true + bottom_search = false, -- use a classic bottom cmdline for search + command_palette = false, -- position the cmdline and popupmenu together + long_message_to_split = false, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. + ---@type NoiceConfigViews + views = {}, ---@see section on views + ---@type NoiceRouteConfig[] + routes = {}, --- @see section on routes + ---@type table<string, NoiceFilter> + status = {}, --- @see section on statusline components + ---@type NoiceFormatOptions + format = {}, --- @see section on formatting + routes = { + { view = "split", filter = { cmdline = "G" }, opts = { enter = true, render = "plain", format = { "{message}" }, replace = true, close = { events = { "BufLeave" }, keys = { "q" } } } }, + { view = "split", filter = { cmdline = "Notifications" }, opts = { enter = true, render = "plain", format = { "{message}" }, replace = true, close = { events = { "BufLeave" }, keys = { "q" } } } }, + { view = "mini", filter = { cmdline = "w" } }, + { view = "mini", filter = { find = "Config Change Detected. Reloading..." } }, + { view = "mini", filter = { any = { { event = "msg_show", find = "lines yanked" }, { event = "msg_show", find = "more lines" }, { event = "msg_show", find = "direnv:" }, { find = "laravel.sail." }, { find = "Pattern not found" }, { event = "msg_show", kind = "", find = "change;" } } } }, + }, }, } diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 6ddd127..58286ff 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -5,5 +5,7 @@ return "nvimtools/none-ls-extras.nvim", "gbprod/none-ls-luacheck.nvim", "gbprod/none-ls-shellcheck.nvim", + -- "gbprod/none-ls-php.nvim", + -- "gbprod/none-ls-ecs.nvim", }, } diff --git a/lua/plugins/phpactor.lua b/lua/plugins/phpactor.lua deleted file mode 100644 index 1988c92..0000000 --- a/lua/plugins/phpactor.lua +++ /dev/null @@ -1,61 +0,0 @@ -local phpactor = function () - vim.ui.select({ - "class_inflect", - "context_menu", - "expand_class", - "generate_accessor", - "change_visibility", - "copy_class", - "import_class", - "import_missing_classes", - "move_class", - "navigate", - "new_class", - "transform", - "update", - "config", - "status", - "cache_clear", - }, { - prompt = "Phpactor Action", - }, function(choice) - if choice == nil or choice == "" then - return - end - - -- TODO: add option for new class in same directory - if choice == "new_class" then - return vim.ui.input({ - prompt = "New Class", - }, function(value) - if value == nil then - return - end - -- TODO: check filename generation to validate the path - require("phpactor").rpc("new_class", { text_value = vim.fn.getcwd() .. '/' .. value .. ".php" }) - end) - end - - require("phpactor").rpc(choice, {}) - end) -end - -return { - "adalessa/phpactor.nvim", - cmd = { "PhpActor" }, - keys = { - { "<leader>pa", phpactor, desc = "PhpActor options" }, - { "<leader>pc", ":PhpActor context_menu<cr>", desc = "PhpActor context menu" }, - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - opts = { - install = { - bin = 'phpactor' - }, - lspconfig = { - enabled = false, - }, - }, -} |