From 750dc94452c827e432116297e0cbd76b610ef65d Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 28 Sep 2022 14:48:52 +0200 Subject: small changes, checking the changes of using phpactor --- lua/alpha/telescope/mappings.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lua/alpha/telescope/mappings.lua') diff --git a/lua/alpha/telescope/mappings.lua b/lua/alpha/telescope/mappings.lua index e389a5e..b9166ac 100644 --- a/lua/alpha/telescope/mappings.lua +++ b/lua/alpha/telescope/mappings.lua @@ -1,23 +1,21 @@ TelescopeMapArgs = TelescopeMapArgs or {} -local map_tele = function(key, f, options, buffer) - local map_key = vim.api.nvim_replace_termcodes(key .. f, true, true, true) +local map_tele = function(key, f, options, buffer, mode) + mode = mode or "n" - TelescopeMapArgs[map_key] = options or {} - - local mode = "n" - local rhs = string.format("lua R('alpha.telescope')['%s'](TelescopeMapArgs['%s'])", f, map_key) + local rhs = function () + R('alpha.telescope')[f](options or {}) + end local map_options = { - noremap = true, + remap = false, silent = true, } + if buffer then + map_options.buffer = buffer + end - if not buffer then - vim.api.nvim_set_keymap(mode, key, rhs, map_options) - else - vim.api.nvim_buf_set_keymap(0, mode, key, rhs, map_options) - end + vim.keymap.set(mode, key, rhs, map_options) end -- not shure what this line does @@ -39,7 +37,7 @@ map_tele("bp", "file_browser") map_tele("gs", "git_status") map_tele("ve", "diagnostics") map_tele("fp", "my_plugins") -map_tele("rr", "refactor") +map_tele("rr", "refactor", {}, nil, {"n", "v"}) map_tele("pa", "laravel") map_tele("pm", "gateway") -- cgit v1.2.3