From d43a4f3b7455599968b9e61c64944ef2759458d6 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Sun, 13 Feb 2022 12:32:19 +0100 Subject: More refactor move telescope to it's own repo and restructure --- lua/alpha/telescope/mappings.lua | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lua/alpha/telescope/mappings.lua (limited to 'lua/alpha/telescope/mappings.lua') diff --git a/lua/alpha/telescope/mappings.lua b/lua/alpha/telescope/mappings.lua new file mode 100644 index 0000000..411fc0c --- /dev/null +++ b/lua/alpha/telescope/mappings.lua @@ -0,0 +1,47 @@ +TelescopeMapArgs = TelescopeMapArgs or {} + +local map_tele = function(key, f, options, buffer) + local map_key = vim.api.nvim_replace_termcodes(key .. f, true, true, true) + + TelescopeMapArgs[map_key] = options or {} + + local mode = "n" + local rhs = string.format("lua R('alpha.telescope')['%s'](TelescopeMapArgs['%s'])", f, map_key) + + local map_options = { + noremap = true, + silent = true, + } + + 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 +end + +-- not shure what this line does +vim.api.nvim_set_keymap("c", "", "(TelescopeFuzzyCommandSearch)", { noremap = false, nowait = true }) + + +map_tele("pp", "project_files") +map_tele("gc", "branches") +map_tele("pw", "grep_word") +map_tele("ps", "grep_string") +map_tele("pf", "projectionist") +map_tele("rc", "search_config") +map_tele("ph", "help_tags") +map_tele("pe", "buffers") +map_tele("pr", "treesitter") +map_tele("bb", "file_browser") +map_tele("vrr", "lsp_references") +map_tele("gs", "git_status") +map_tele("pv", "find_symbol") +map_tele("ve", "lsp_document_diagnostics") +map_tele("fp", "my_plugins") + +map_tele("pa", "laravel") + + + +return map_tele -- cgit v1.2.3